HOL-Light/AArch64: Port proofs from mlkem-native#965
Conversation
CBMC Results (ML-DSA-65)
Full Results (180 proofs)
|
CBMC Results (ML-DSA-44)Full Results (180 proofs)
|
CBMC Results (ML-DSA-87)Full Results (180 proofs)
|
mkannwischer
left a comment
There was a problem hiding this comment.
Thanks @willieyz. Happy Near Year!
proofs/hol_light/aarch64/Makefile
Outdated
| mldsa/keccak_f1600_x1_scalar.o \ | ||
| mldsa/keccak_f1600_x1_v84a.o \ | ||
| mldsa/keccak_f1600_x2_v84a.o \ | ||
| mldsa/keccak_f1600_x4_v8a_scalar.o \ |
There was a problem hiding this comment.
Here something is off in terms of whitespace.
There was a problem hiding this comment.
These files should be autogenerated, see https://github.com/pq-code-package/mlkem-native/blob/ab3e6c00ac3d335e890929ef61791315e9192142/scripts/autogen#L2464
There was a problem hiding this comment.
Fixed. I have added the corresponding pattern to autogen script, updated the list joblist_aarch64 in def gen_hol_light_asm() and regenerated the related files from autogen.
| @@ -0,0 +1,297 @@ | |||
| (* | |||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |||
| * SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT-0 | |||
There was a problem hiding this comment.
Please update the HOL-Light README, see https://github.com/pq-code-package/mlkem-native/blob/main/proofs/hol_light/README.md
There was a problem hiding this comment.
Fixed.
I have added description related to these five hol-ight proof in proofs/hol_light/README.md under the chapter "What is covered?".
Regarding the copyright notice for the *.ml files: I noticed that the original keccak_*.ml files in mlkem-native do not include
Copyright (c) The mlkem-native project authors
Therefore, I have left the copyright section unchanged and did not add
Copyright (c) The mldsa-native project authors
Is this ok for you?
| (`!a rc A1 A2 A3 A4 pc stackpointer. | ||
| aligned 16 stackpointer /\ | ||
| nonoverlapping (a,800) (stackpointer,216) /\ | ||
| ALLPAIRS nonoverlapping | ||
| [(a,800); (stackpointer,216)] | ||
| [(word pc,LENGTH keccak_f1600_x4_v8a_scalar_mc); (rc,192)] | ||
| ==> ensures arm | ||
| (\s. aligned_bytes_loaded s (word pc) keccak_f1600_x4_v8a_scalar_mc /\ | ||
| read PC s = word (pc + KECCAK_F1600_X4_V8A_SCALAR_CORE_START) /\ | ||
| read SP s = stackpointer /\ | ||
| C_ARGUMENTS [a; rc] s /\ | ||
| wordlist_from_memory(a,25) s = A1 /\ | ||
| wordlist_from_memory(word_add a (word 200),25) s = A2 /\ | ||
| wordlist_from_memory(word_add a (word 400),25) s = A3 /\ | ||
| wordlist_from_memory(word_add a (word 600),25) s = A4 /\ | ||
| wordlist_from_memory(rc,24) s = round_constants) | ||
| (\s. read PC s = word(pc + KECCAK_F1600_X4_V8A_SCALAR_CORE_END) /\ | ||
| wordlist_from_memory(a,25) s = keccak 24 A1 /\ | ||
| wordlist_from_memory(word_add a (word 200),25) s = | ||
| keccak 24 A2 /\ | ||
| wordlist_from_memory(word_add a (word 400),25) s = | ||
| keccak 24 A3 /\ | ||
| wordlist_from_memory(word_add a (word 600),25) s = | ||
| keccak 24 A4) |
There was a problem hiding this comment.
Please also add the corresponding CBMC proofs for those functions - i think the contract are alreaday there.
There was a problem hiding this comment.
Hello, Matthias, thank you for your review and help!
I had add the corresponding CBMC proofs, and keep them in new commit: 2740fdf,
Also test with make result for reach five new added cbmc proofs,
If there is any problem, please kindly let me know, and I will fix it as soon as possible, many thanks!
1aae0c5 to
1fcede9
Compare
After PR #948 merged, mldsa-native and mlkem-native use identical AArch64 assembly for Keccak-F1600. Therefore, the HOL-light proofs on mlkem-native for Keccak-F1600 can also apply to mldsa-native as well. This commit port the hol-light proof for AArch64 FIPS202 backend from mlkem-native to mldsa-native, also update to CI workflow. The commit changes according to follwoing step: 1. Added keccak_f1600_*.S assembly files to proofs/hol_light/aarch64/, copied from mldsa/src/fips202/native/aarch64/src/ and modified with reference to mlkem. 2. Ported the HOL-Light proofs keccak_f1600_*.ml and keccak_spec.ml from mlkem-native to mldsa-native. 3. Updated the Makefile to include all newly added keccak_f1600_*.o objects, also update the description in `proofs/hol_light/README.md` to cover the new added keccak_f1600 hol-light proofs. 4. Tested locally using `tests hol_light`. 5. Updated the CI workflow .github/workflows/hol_light.yml to add the series of Keccak F1600 HOL-Light proofs to the hol_light_proofs field. Signed-off-by: willieyz <willie.zhao@chelpis.com>
After merging PR #948, `mldsa-native` and `mlkem-native` now share identical AArch64 assembly implementations. In addition to adding the HOL-Light proofs, we also need to provide the corresponding Keccak F1600 CBMC proofs. Since the contracts are already present there: - `x1_scalar.h` - `x1_v84a.h` - `x2_v84a.h` - `x4_v8a_scalar.h` - `x4_v8a_v84a_scalar.h` this commit ports the corresponding CBMC proofs from `mlkem-native`, adds the necessary Makefile entries and harnesses for these 5 contracts. Signed-off-by: willieyz <willie.zhao@chelpis.com>
1fcede9 to
2740fdf
Compare
After PR #948 merged, mldsa-native and mlkem-native use identical AArch64 assembly for Keccak-F1600. Therefore, the HOL-light proofs on mlkem-native for Keccak-F1600 can also apply to mldsa-native as well.
This PR port the hol-light proof for AArch64 FIPS202 backend from mlkem-native to mldsa-native, also update to CI workflow.
The PR changes according to follwoing step:
proofs/hol_light/aarch64/, copied frommldsa/src/fips202/native/aarch64/src/and modified with reference to mlkem.keccak_f1600_*.mlandkeccak_spec.mlfrom mlkem-native to mldsa-native.keccak_f1600_*.oobjects.tests hol_light..github/workflows/hol_light.ymlto add the series of Keccak F1600 HOL-Light proofs to thehol_light_proofsfield.