Skip to content

Conversation

@dkostic
Copy link
Contributor

@dkostic dkostic commented Nov 25, 2025

No description provided.

@dkostic dkostic requested a review from a team as a code owner November 25, 2025 00:38
@dkostic dkostic force-pushed the hol-x86-poly-basemul branch 5 times, most recently from 8155685 to 52cc0bd Compare November 25, 2025 04:36
@dkostic dkostic force-pushed the hol-x86-poly-basemul branch from 52cc0bd to d32e305 Compare November 25, 2025 17:44
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.

Looking really good @dkostic, thank you.

Could you clean up x86/proofs/mlkem_specs.ml? This has at least mentions of Arm and mldsa in it.

@dkostic
Copy link
Contributor Author

dkostic commented Nov 25, 2025

Looking really good @dkostic, thank you.

Could you clean up x86/proofs/mlkem_specs.ml? This has at least mentions of Arm and mldsa in it.

the reason it has mentions of Arm and ML-DSA is because I copied the whole script from s2n-bignum (https://github.com/awslabs/s2n-bignum/blob/main/common/mlkem_mldsa.ml). There, we tried to minimize duplication and consolidate all definitions and theorems that are common to ML-KEM and ML-DSA for x86 and Arm into a single file. I think we should follow the same approach here. We should aim to have a single mlkem_specs.ml file that can be shared between Arm and x86. I'd be fine with removing the ML-DSA parts but I think ideally we'd keep the file identical to the one in s2n-bignum.

Comment on lines +946 to +949
if platform.machine().lower() in ["arm64", "aarch64"]:
arm_or_x86 = "arm"
elif platform.machine().lower() in ["x86_64"]:
arm_or_x86 = "x86"
Copy link
Contributor

Choose a reason for hiding this comment

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

We should allow cross-checking of proofs, but this can be a follow-up

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

LGTM, many thanks @dkostic for the work. There are some follow-up issues we need to address, but they should not block the PR.

Comment on lines 167 to 183
# TODO: fix the interactive mode to work for both x86 and arm.
# hol_light_interactive_x86_64:
# name: HOL-Light interactive shell test
# runs-on: pqcp-x64
# needs: [ hol_light_bytecode_x86_64 ]
# if: github.repository_owner == 'pq-code-package' && !github.event.pull_request.head.repo.fork
# steps:
# - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# with:
# fetch-depth: 0
# - uses: ./.github/actions/setup-shell
# with:
# gh_token: ${{ secrets.GITHUB_TOKEN }}
# nix-shell: 'hol_light'
# script: |
# make -C proofs/hol_light/x86 mlkem/mlkem_poly_basemul_acc_montgomery_cached_k2.o
# echo 'needs "proofs/mlkem_poly_basemul_acc_montgomery_cached_k2.ml";;' | hol.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the issue here?

needs "arm/proofs/base.ml";;

needs "proofs/mlkem_specs.ml";;
needs "../common/mlkem_specs.ml";;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we not need to prefix all object file paths below with arm resp. x86_64?

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.

Apologies, I got some late questions about relative file paths and why the CI disables the interactive x86 HOL-Light shell test (may be related).

@dkostic dkostic force-pushed the hol-x86-poly-basemul branch from df0b7fa to 3cc281e Compare November 27, 2025 06:55
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.

3 participants