Add HOL Light pointwise-acc multiplication proofs for AArch64 and x86_64#1010
Add HOL Light pointwise-acc multiplication proofs for AArch64 and x86_64#1010
Conversation
c96a621 to
b9b5908
Compare
CBMC Results (ML-DSA-44)Full Results (186 proofs)
|
CBMC Results (ML-DSA-65)Full Results (186 proofs)
|
CBMC Results (ML-DSA-87)Full Results (186 proofs)
|
mkannwischer
left a comment
There was a problem hiding this comment.
Thanks @jakemas - the HOL-Light proofs look good to me. I checked the spec and everything makes sense to me.
The CBMC contracts, however, do not match that - please update.
Do you have an intuition why the proof for 44 is much slower than the one for 65? That does not seem to make sense to me. Would be good to improve this, but that could also be done in a follow-up PR.
| requires(array_abs_bound(a, 0, 4 * MLDSA_N, 75423753)) | ||
| requires(array_abs_bound(b, 0, 4 * MLDSA_N, 75423753)) |
There was a problem hiding this comment.
This does not match the HOL-Light pre-conditions:
(!i. i < 1024 ==> abs(ival(x i)) <= &8380416) /\
(!i. i < 1024 ==> abs(ival(y i)) <= &75423752) /\
| requires(array_abs_bound(a, 0, 4 * MLDSA_N, 75423753)) | ||
| requires(array_abs_bound(b, 0, 4 * MLDSA_N, 75423753)) |
There was a problem hiding this comment.
same in the x86 backend
ba6edd2 to
87d0267
Compare
Good catch. The bounds phase (proving congruence + boundedness for each of the 256 output coefficients) was using a slow approach for l4 that repeatedly calls I found this when developing the l7 proofs and optimized the approach there (as they were too slow without it), pre-computing all the Times improved 3-4x for L4:
|
| /* check-magic: off */ | ||
| requires(array_abs_bound(a, 0, 4 * MLDSA_N, 8380417)) | ||
| requires(array_abs_bound(b, 0, 4 * MLDSA_N, 75423753)) | ||
| /* check-magic: on */ | ||
| assigns(memory_slice(r, sizeof(int32_t) * MLDSA_N)) | ||
| /* check-magic: off */ | ||
| ensures(array_abs_bound(r, 0, MLDSA_N, 8380417)) | ||
| /* check-magic: on */ |
There was a problem hiding this comment.
nit: turning off check-magic once instead of twice would be less distracting.
There was a problem hiding this comment.
This is also present in #1006. Maybe you can still change that in both before we merge.
mkannwischer
left a comment
There was a problem hiding this comment.
Thanks @jakemas - this looks great to me. Thank you for the speed improvements for the L4 proof - that is greatly appreciated.
I think this is ready to be merged.
@hanno-becker, could you please double check the HOL-Light specs?
87d0267 to
21c0cbc
Compare
21c0cbc to
554a957
Compare
hanno-becker
left a comment
There was a problem hiding this comment.
Thanks a lot @jakemas, this is great work 🎉
Unless I'm missing something, we still need CBMC proofs for the native versions of pointwise_acc_montgomery?
Hanno is right: The CBMC proofs still need to be added.
8afaabe to
779cf15
Compare
|
Ok x86 CBMC proofs in, working on an issue with the arm ones.
|
8814c18 to
b464b88
Compare
|
CBMC proofs added. Rebasing now. |
b464b88 to
79f0d01
Compare
Port the ML-DSA pointwise multiplication-accumulation (l=4,5,7) and their HOL Light proofs of correctness from s2n-bignum to mldsa-native, for both AArch64 (NEON) and x86_64 (AVX2). Includes constant-time and memory safety proofs for both architectures. Ported from s2n-bignum PR #373. Signed-off-by: Jake Massimo <jakemas@amazon.com> Signed-off-by: Ubuntu <ubuntu@ip-172-31-29-57.us-west-2.compute.internal>
79f0d01 to
3b06637
Compare
Resolves:
polyvecl_pointwise_acc_montgomery#549polyvecl_pointwise_acc_montgomery#551Summary
Dependencies