HOL-Light: Add HOL Light proof and CBMC contracts for x86 poly_caddq#1068
Conversation
dcc44a1 to
297acb1
Compare
d2fc1d0 to
1a0d2aa
Compare
Benchmark: unrolled vs looped poly_caddq (rdtsc, best of 20 × 100k reps)
No performance difference — function is memory-bound. Code size: 876 bytes (unrolled) vs 115 bytes (looped). |
3d9ed0d to
83c172c
Compare
There was a problem hiding this comment.
Mac Mini (M1, 2020) benchmarks (opt)
Details
| Benchmark suite | Current: 83c172c | Previous: 1b47ba6 | Ratio |
|---|---|---|---|
ML-DSA-44 keypair |
46536 cycles |
46536 cycles |
1 |
ML-DSA-44 sign |
131052 cycles |
131050 cycles |
1.00 |
ML-DSA-44 verify |
47346 cycles |
47346 cycles |
1 |
ML-DSA-65 keypair |
81691 cycles |
81700 cycles |
1.00 |
ML-DSA-65 sign |
215419 cycles |
215395 cycles |
1.00 |
ML-DSA-65 verify |
79305 cycles |
79307 cycles |
1.00 |
ML-DSA-87 keypair |
132416 cycles |
132417 cycles |
1.00 |
ML-DSA-87 sign |
277558 cycles |
277443 cycles |
1.00 |
ML-DSA-87 verify |
134239 cycles |
134252 cycles |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Mac Mini (M1, 2020) benchmarks (no-opt)
Details
| Benchmark suite | Current: 83c172c | Previous: 1b47ba6 | Ratio |
|---|---|---|---|
ML-DSA-44 keypair |
112847 cycles |
112799 cycles |
1.00 |
ML-DSA-44 sign |
401127 cycles |
400982 cycles |
1.00 |
ML-DSA-44 verify |
120177 cycles |
120122 cycles |
1.00 |
ML-DSA-65 keypair |
192913 cycles |
192868 cycles |
1.00 |
ML-DSA-65 sign |
649933 cycles |
649945 cycles |
1.00 |
ML-DSA-65 verify |
192945 cycles |
192948 cycles |
1.00 |
ML-DSA-87 keypair |
318764 cycles |
318776 cycles |
1.00 |
ML-DSA-87 sign |
828766 cycles |
828806 cycles |
1.00 |
ML-DSA-87 verify |
326656 cycles |
326675 cycles |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
83c172c to
a18cdb1
Compare
oqs-bot
left a comment
There was a problem hiding this comment.
Intel Xeon 4th gen (c7i)
Details
| Benchmark suite | Current: 83c172c | Previous: 1b47ba6 | Ratio |
|---|---|---|---|
ML-DSA-44 keypair |
45341 cycles |
45511 cycles |
1.00 |
ML-DSA-44 sign |
136181 cycles |
136341 cycles |
1.00 |
ML-DSA-44 verify |
47302 cycles |
47440 cycles |
1.00 |
ML-DSA-65 keypair |
78737 cycles |
79043 cycles |
1.00 |
ML-DSA-65 sign |
222332 cycles |
222551 cycles |
1.00 |
ML-DSA-65 verify |
78083 cycles |
77883 cycles |
1.00 |
ML-DSA-87 keypair |
125052 cycles |
124670 cycles |
1.00 |
ML-DSA-87 sign |
276747 cycles |
276052 cycles |
1.00 |
ML-DSA-87 verify |
122413 cycles |
122354 cycles |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
oqs-bot
left a comment
There was a problem hiding this comment.
Intel Xeon 4th gen (c7i) (no-opt)
Details
| Benchmark suite | Current: 83c172c | Previous: 1b47ba6 | Ratio |
|---|---|---|---|
ML-DSA-44 keypair |
94218 cycles |
94105 cycles |
1.00 |
ML-DSA-44 sign |
329909 cycles |
329634 cycles |
1.00 |
ML-DSA-44 verify |
98793 cycles |
98714 cycles |
1.00 |
ML-DSA-65 keypair |
161733 cycles |
161653 cycles |
1.00 |
ML-DSA-65 sign |
538654 cycles |
539237 cycles |
1.00 |
ML-DSA-65 verify |
160327 cycles |
160249 cycles |
1.00 |
ML-DSA-87 keypair |
263770 cycles |
264627 cycles |
1.00 |
ML-DSA-87 sign |
694878 cycles |
695291 cycles |
1.00 |
ML-DSA-87 verify |
265915 cycles |
265870 cycles |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
fa7b5e4 to
23845c2
Compare
23845c2 to
20a14ee
Compare
20a14ee to
b4affc2
Compare
hanno-becker
left a comment
There was a problem hiding this comment.
@jakemas We should only have one 'core' spec. Either with just the functional description, or with functional description and bounds. We should have exactly one subroutine spec, with both functional description and bounds -- because that's what we want to be eyeball close to the CBMC spec.
Can you please adjust MLDSA_CADDQ_SUBROUTINE_CORRECT to include bounds? And preferably, not necessarily, also consolidate xx_CORRECT xx_CORRECT_BOUND?
2d34828 to
5d275a3
Compare
Ok done. Take a look and see what you think. |
5d275a3 to
79af38d
Compare
hanno-becker
left a comment
There was a problem hiding this comment.
Thanks @jakemas, the specs look good now. Two smaller issues remain that should be trivial to address.
hanno-becker
left a comment
There was a problem hiding this comment.
Please also adjust the README
14c7250 to
dd17c76
Compare
added ty! |
hanno-becker
left a comment
There was a problem hiding this comment.
Please remove the now-duplicate lemmas from the proof script and use their effective copies from mldsa_specs.ml
Adds formal verification for the x86_64 AVX2 poly_caddq implementation: - HOL Light proof of functional correctness (modular reduction) - Per-coefficient bounds folded directly into the core spec, matching the CBMC contract `ensures(array_bound(r, 0, MLDSA_N, 0, MLDSA_Q))` - Constant-time and memory safety proofs - CBMC contracts for the native x86_64 implementation Signed-off-by: Jake Massimo <jakemas@amazon.com>
dd17c76 to
92d4704
Compare
done! thanks! |
Resolves #492
Summary
poly_caddqHOL Light formal proof. Had to unroll loop, verified no performance changes.mld_poly_caddq_avx2and newpoly_caddq_native_x86_64CBMC proofMAP_UNTIL_TARGET_PCin x86_64mldsa_utils.ml(was matchingeventually arminstead ofeventually x86)Depends on: s2n-bignum #397 (VPCMPGTD instruction model)
HOL-Light / x86_64 HOL Light proof for poly_caddq_avx2_asm.S (pull_request)Successful in 10m