Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functional correctness proofs for AArch64-optimized NTT and invNTT in HOL Light #662

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

potsrevennil
Copy link
Contributor

@potsrevennil potsrevennil commented Jan 15, 2025

Summary:

Steps:

  • The makefile in s2n-bignum/arm/ is copied to proofs/hol_light and adjusted to be compatible with nix.
  • The nix patches for hol_light and s2n-bignum mainly fix the path issue (e.g. using relative paths) of the 2 projects.

Performed local tests:

  • lint passing
  • tests all passing
  • tests bench passing
  • tests cbmc passing

Do you expect this change to impact performance: Yes/No

If yes, please provide local benchmarking results.

@potsrevennil potsrevennil force-pushed the hol_light branch 5 times, most recently from 95845ba to e8d9c90 Compare January 16, 2025 16:01
@potsrevennil potsrevennil marked this pull request as ready for review January 16, 2025 16:50
@potsrevennil potsrevennil requested a review from a team as a code owner January 16, 2025 16:50
Copy link
Contributor

@hanno-becker hanno-becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is still fishy in the Makefile target for object files -- see comments.

Also, the following fails:

make -j8 p256/bignum_montmul_p256.native
$S2N_BIGNUM_DIR/tools/run-proof.sh ./p256/bignum_montmul_p256.native ./p256_output
> Fatal error: exception Failure("dest_cons4: 4-byte inst code 2839547939 != first 4 bytes of []")

Could you also add a brief README that explains what one should do to fully compile + run a proof, and refer to the nix environment for setup? Is it feasible to run at least one proof in CI to confirm that the setup is functional? (e.g. a "hol-light sanity check" job or similar)

@potsrevennil potsrevennil force-pushed the hol_light branch 2 times, most recently from 218e722 to 0d4929c Compare January 17, 2025 07:32
@hanno-becker hanno-becker self-requested a review January 17, 2025 08:37
Copy link
Contributor

@hanno-becker hanno-becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @potsrevennil for fixing the Makefile issue.

Something is still not right, though:

make -j8 p256/bignum_montmul_p256.correct

continues to fail with

Fatal error: exception Failure("dest_cons4: 4-byte inst code 2839547939 != first 4 bytes of []")
make: *** [Makefile:440: p256/bignum_montmul_p256.correct] Error 2

The scripts in s2n_bignum assume execution within the $ROOT/<arch>/
directory and rely on relative paths. To integrate these scripts with
Nix, it is necessary to adjust the paths used for loading scripts to
ensure compatibility.

Additionally, the Makefile located under $ROOT/<arch> has been copied
to the mlkem-native directory and modified as needed to support this
change.

Signed-off-by: Thing-han, Lim <[email protected]>
@hanno-becker hanno-becker changed the title Package hol_light and s2n-bignum into nix derivations Add functional correctness proofs for NTT and invNTT in HOL Light Jan 24, 2025
@hanno-becker hanno-becker changed the title Add functional correctness proofs for NTT and invNTT in HOL Light Add functional correctness proofs for AArch64-optimized NTT and invNTT in HOL Light Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add HOL-Light & s2n-bignum infrastructure to nix environment
2 participants