Draft
Conversation
Port the ML-DSA Forward NTT implementation and its HOL Light proof of correctness from s2n-bignum to mldsa-native. The proof verifies the AArch64 NEON NTT implementation at the object-code level, showing that the output coefficients are congruent to the forward NTT of the input modulo 8380417, with bounded output coefficients. A constant-time and memory safety proof is also included. New files: - aarch64/mldsa/mldsa_ntt.S: Assembly derived from dev/aarch64_opt/src/ntt.S - aarch64/proofs/mldsa_ntt.ml: HOL Light proof (MLDSA_NTT_CORRECT, MLDSA_NTT_SUBROUTINE_CORRECT, and MLDSA_NTT_SUBROUTINE_SAFE theorems) - aarch64/proofs/mldsa_specs.ml: Self-contained ML-DSA specifications and congruence/bounds propagation infrastructure, ported from s2n-bignum's common/mlkem_mldsa.ml with only ARM ML-DSA relevant definitions - aarch64/proofs/subroutine_signatures.ml: ML-DSA subroutine signatures for the safety proof infrastructure Modified files: - aarch64/proofs/aarch64_utils.ml: Add MEMORY_128_FROM_32_TAC - aarch64/Makefile: Add mldsa_ntt to build targets Signed-off-by: dkostic <dkostic@amazon.com>
- Add BYTECODE START/END markers to mldsa_ntt.ml for autogen - Add mldsa_ntt.o to dump_bytecode.ml - Extract zeta constants into auto-generated mldsa_zetas.ml - Add gen_aarch64_hol_light_zeta_file() to scripts/autogen - Add mldsa_ntt to the AArch64 HOL Light CI matrix Signed-off-by: dkostic <dkostic@amazon.com>
Add CBMC contract for mld_ntt_asm matching the bounds from the AArch64 NTT HOL Light proof (input: abs <= 8380416, output: abs <= 75423752). Add corresponding CBMC proof for mld_ntt_native using the contract. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Add contract to dev/ source files (arith_native_aarch64.h is auto-generated) Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Consolidate the shared ML-DSA specifications and congruence/bounds propagation infrastructure into a single file at proofs/hol_light/common/mldsa_specs.ml, used by both AArch64 and x86_64 proofs. The merged file contains: - Shared: bitreverse8, reorder, BITREVERSE8_CLAUSES, congruence/bounds infrastructure (CONGBOUND_WORD_*, ASM_CONGBOUND_RULE, etc.), SIMD simplification tactics - x86_64-specific: AVX2 NTT ordering, mldsa_montred/barred/montmul - AArch64-specific: arm_mldsa_forward_ntt, arm_mldsa_barmul ASM_CONGBOUND_RULE now handles both arm_mldsa_barmul and mldsa_montred/barred/montmul cases. Signed-off-by: dkostic <dkostic@amazon.com>
Signed-off-by: Dusan Kostic <dkostic@amazon.com>
Author
|
addresses #923 but blocked on some changes in the s2n-bignum repo |
Contributor
CBMC Results (ML-DSA-44)Full Results (176 proofs)
|
Contributor
CBMC Results (ML-DSA-65)Full Results (176 proofs)
|
Contributor
CBMC Results (ML-DSA-87)Full Results (176 proofs)
|
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.
rej_uniform#923ML-DSA aarch64 rejection sampling proof.
This proof was written entirely by Claude Opus 4.6.
The same proof in s2n-bignum: awslabs/s2n-bignum#378
The proof will fail in the CI because it relies on a few new Arm instructions that have to be added to s2n-bignum (see awslabs/s2n-bignum#378).
Also, this PR is on top of the NTT PR (#993), I'll rebase once the NTT PR is merged in.