Add HOL Light pointwise multiplication proofs for AArch64 and x86_64#1006
Open
Add HOL Light pointwise multiplication proofs for AArch64 and x86_64#1006
Conversation
ae648e4 to
4d3fefe
Compare
4d3fefe to
86eb0c4
Compare
Contributor
CBMC Results (ML-DSA-44)Full Results (181 proofs)
|
Contributor
CBMC Results (ML-DSA-65)Full Results (181 proofs)
|
Contributor
CBMC Results (ML-DSA-87)Full Results (181 proofs)
|
1a600f1 to
8d662d1
Compare
mkannwischer
reviewed
Apr 1, 2026
mkannwischer
requested changes
Apr 1, 2026
Contributor
mkannwischer
left a comment
There was a problem hiding this comment.
Thanks @jakemas. Looks great overall.
I left a couple of small comments.
| MLD_NAMESPACE(poly_pointwise_montgomery_asm) | ||
| void mld_poly_pointwise_montgomery_asm(int32_t *, const int32_t *, | ||
| const int32_t *); | ||
| void mld_poly_pointwise_montgomery_asm(int32_t *r, const int32_t *a, |
Contributor
There was a problem hiding this comment.
Same change should be made to aarch64_clean
f7b2481 to
f7dccd0
Compare
mkannwischer
approved these changes
Apr 2, 2026
Contributor
mkannwischer
left a comment
There was a problem hiding this comment.
Thanks for the changes @jakemas. LGTM.
@hanno-becker, could you also take a look please?
674af16 to
9c9f46c
Compare
hanno-becker
reviewed
Apr 5, 2026
Comment on lines
+506
to
+516
| nonoverlapping (word pc, LENGTH mldsa_pointwise_tmc) (r, 1024) /\ | ||
| nonoverlapping (word pc, LENGTH mldsa_pointwise_tmc) (a, 1024) /\ | ||
| nonoverlapping (word pc, LENGTH mldsa_pointwise_tmc) (b, 1024) /\ | ||
| nonoverlapping (word pc, LENGTH mldsa_pointwise_tmc) (consts, 2496) /\ | ||
| nonoverlapping (r, 1024) (a, 1024) /\ nonoverlapping (r, 1024) (b, 1024) /\ | ||
| nonoverlapping (r, 1024) (consts, 2496) /\ nonoverlapping (a, 1024) (b, 1024) /\ | ||
| nonoverlapping (a, 1024) (consts, 2496) /\ nonoverlapping (b, 1024) (consts, 2496) /\ | ||
| nonoverlapping (stackpointer, 8) (r, 1024) /\ | ||
| nonoverlapping (stackpointer, 8) (a, 1024) /\ | ||
| nonoverlapping (stackpointer, 8) (b, 1024) /\ | ||
| nonoverlapping (stackpointer, 8) (consts, 2496) |
Port the ML-DSA pointwise polynomial multiplication (Montgomery form) and its HOL Light proofs of correctness from s2n-bignum to mldsa-native, for both AArch64 (NEON) and x86_64 (AVX2). The proofs verify the assembly implementations at the object-code level, showing that output coefficients are congruent to the pointwise product of the inputs modulo Q=8380417, with bounded output coefficients (|output| <= Q-1). For AArch64, a constant-time and memory safety proof is also included. Ported from s2n-bignum commit ca6ec31a225a. Signed-off-by: Jake Massimo <jakemas@amazon.com>
9c9f46c to
d2e2991
Compare
hanno-becker
reviewed
Apr 5, 2026
|
|
||
| let mldsa_pointwise = define | ||
| `mldsa_pointwise (f:num->int) (g:num->int) i = | ||
| (f i * g i * &(inverse_mod 8380417 4294967296)) rem &8380417`;; |
Contributor
There was a problem hiding this comment.
Someone who reads this probably understands what is happening here, but a brief mention of Montgomery multiplication and the factor being 2^{-32} mod Q wouldn't hurt.
hanno-becker
reviewed
Apr 5, 2026
| - name: mldsa_intt | ||
| needs: ["mldsa_specs.ml", "mldsa_utils.ml", "mldsa_zetas.ml"] | ||
| - name: mldsa_pointwise | ||
| needs: ["mldsa_specs.ml", "mldsa_utils.ml"] |
Contributor
There was a problem hiding this comment.
Needs mldsa_zetas.ml as well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves:
poly_pointwise_montgomery#548poly_pointwise_montgomery#550Port the ML-DSA pointwise polynomial multiplication (Montgomery form) and its HOL Light proofs from s2n-bignum to mldsa-native for both AArch64 (NEON) and x86_64 (AVX2).
MLDSA_POINTWISE_CORRECT), subroutine form (MLDSA_POINTWISE_SUBROUTINE_CORRECT), and constant-time/memory safety (MLDSA_POINTWISE_SUBROUTINE_SAFE)MLDSA_POINTWISE_CORRECT), subroutine form with and without IBT (MLDSA_POINTWISE_SUBROUTINE_CORRECT,MLDSA_POINTWISE_NOIBT_SUBROUTINE_CORRECT), and constant-time/memory safety (MLDSA_POINTWISE_SUBROUTINE_SAFE)common/mldsa_specs.ml:mldsa_pointwise,mldsa_pointwise_montred,arm_mldsa_pointwise_montred,ARM_MLDSA_MONTRED_EQ,CONGBOUND_MLDSA_POINTWISE_MONTREDIncludes CBMC proofs.
The proofs verify the assembly at the object-code level, showing output coefficients are congruent to the pointwise product of the inputs modulo Q=8380417 with bounded outputs (|output| ≤ Q−1).