-
Notifications
You must be signed in to change notification settings - Fork 26
CBMC proofs for mld_poly_permute_bitrev_to_custom #770
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
Draft
willieyz
wants to merge
14
commits into
main
Choose a base branch
from
cbmc-native2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,324
−29
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds CBMC proofs for the native function `mld_ntt_native`,
called `poly_ntt_native`
The following changes are included:
- Add `dummy_backend.h` as a mock backend for `poly_ntt_native`.
- Apply the same harness file and construct function contract
reference from `poly_ntt`.
- Use the following function contracts:
- `mld_ntt_native`
- `mld_poly_ntt_c`
- Introduce a new CBMC contract pattern `array_unchanged` in `cbmc.h`,
which is used to verify the fallback behavior inside `mld_ntt_native`.
Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for the native function `mld_intt_native`,
called `poly_invntt_tomont_native`
- This following changes are include:
- Apply the same harness file and construct function contract,
reference from `poly_invntt_tomnot`.
- Use the following function contracts:
- `mld_intt_native`
- `mld_poly_invntt_tomont_c`
- Add MLD_INTT_BOUND in api.h
- Add `MLD_USE_NATIVE_INTT` in dummy_backend.h
Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for the native function `mld_rej_uniform_native`,
called `rej_uniform_native`
- This following changes are include:
- Apply the same harness file and construct function contract reference
from `rej_uniform`.
- Use the following function contracts:
- `mld_rej_uniform_native`
- `mld_rej_uniform_c`
- Add `MLD_USE_NATIVE_REJ_UNIFORM` in dummy_backend.h
Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for following the native function:
`mld_rej_uniform_eta2_native` and `mld_rej_uniform_eta4_native`,
called `rej_eta_native`.
- This following changes are include:
- Apply the same harness file and construct function contract reference
from rej_eta.
- Use the following function contracts:
- mld_rej_eta_c
- mld_rej_uniform_eta2_native
- mld_rej_uniform_eta4_native
- Add `MLD_USE_NATIVE_REJ_UNIFORM_ETA2`,
`MLD_USE_NATIVE_REJ_UNIFORM_ETA4` in dummy_backend.h
Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for following the native function:
`mld_poly_decompose_32_native`, `mld_poly_decompose_88_native`.
called `poly_decompose_native`.
- This following changes are include:
- Apply the same harness file and construct function contract reference
from `poly_decompose`.
- Use the following function contracts:
- mld_poly_decompose_c
- mld_poly_decompose_32_native
- mld_poly_decompose_88_native
- Add `MLD_USE_NATIVE_POLY_DECOMPOSE_32`,
`MLD_USE_NATIVE_POLY_DECOMPOSE_88` in dummy_backend.h
Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for the native function
`mld_poly_caddq_native`, called `poly_caddq_native`
- This following changes are include:
- Apply the same harness file and construct function contract
reference from `poly_caddq`.
- Use the following function contracts:
- `mld_poly_caddq_c`
- `mld_poly_caddq_native`
- Add `MLD_USE_NATIVE_POLY_CADDQ` in dummy_backend.h
Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for following the native function: `mld_poly_use_hint_32_native`, `mld_poly_use_hint_88_native`. called `poly_use_hint_native`. - This following changes are include: - Apply the same harness file and construct function contract reference from `poly_use_hint`. - Use the following function contracts: - mld_poly_use_hint_c - mld_poly_use_hint_32_native - mld_poly_use_hint_88_native - Add `MLD_USE_NATIVE_POLY_USE_HINT_32`, `MLD_USE_NATIVE_POLY_USE_HINT_88` in dummy_backend.h Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for following the native function: `mld_poly_chknorm_native`, called `poly_chknorm_native`. - This following changes are include: - Apply the same harness file and construct function contract reference from `poly_chknorm_native`. - Use the following function contracts: - `mld_poly_chknorm_c` - `mld_poly_chknorm_native` - Add `MLD_USE_NATIVE_POLY_CHKNORM` in dummy_backend.h Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for following the native function: `mld_polyz_unpack_17_native` and `mld_polyz_unpack_19_native`. called `polyz_unpack_native`. - This following changes are include: - Apply the same harness file and construct function contract reference from `polyz_unpack`. - Use the following function contracts: - `mld_polyz_unpack_c` - `mld_polyz_unpack_17_native` - `mld_polyz_unpack_17_native` - Add `MLD_USE_NATIVE_POLYZ_UNPACK_17`, `MLD_USE_NATIVE_POLYZ_UNPACK_19` in dummy_backend.h Signed-off-by: willieyz <willie.zhao@chelpis.com>
…omery_native)
- This commit adds CBMC proofs for the native function
`mld_poly_pointwise_montgomery_native`,
called `poly_pointwise_montgomery_native`
- This following changes are include:
- Apply the same harness file and construct function contract,
reference from `poly_pointwise_montgomery`.
- Use the following function contracts:
- `mld_poly_pointwise_montgomery_native`
- `mld_poly_pointwise_montgomery_c`
- Add `MLD_USE_NATIVE_POINTWISE_MONTGOMERY` in dummy_backend.h
Signed-off-by: willieyz <willie.zhao@chelpis.com>
…ntgomery_native)
- This commit adds CBMC proofs for following the native function:
`mld_polyvecl_pointwise_acc_montgomery_l4_native`,
`mld_polyvecl_pointwise_acc_montgomery_l5_native` and
`mld_polyvecl_pointwise_acc_montgomery_l7_native`
called `polyvecl_pointwise_acc_montgomery_native`.
- This following changes are include:
- Apply the same harness file and construct function contract reference
from `polyvecl_pointwise_acc_montgomery`.
- Use the following function contracts:
- `mld_polyvecl_pointwise_acc_montgomery_l4_native`
- `mld_polyvecl_pointwise_acc_montgomery_l5_native`
- `mld_polyvecl_pointwise_acc_montgomery_l7_native`
- Add `MLD_USE_NATIVE_POLYVECL_POINTWISE_ACC_MONTGOMERY_L4`,
`MLD_USE_NATIVE_POLYVECL_POINTWISE_ACC_MONTGOMERY_L5`,
`MLD_USE_NATIVE_POLYVECL_POINTWISE_ACC_MONTGOMERY_L7`
in dummy_backend.h
Signed-off-by: willieyz <willie.zhao@chelpis.com>
- This commit adds CBMC proofs for following the native function: `mld_keccak_f1600_x1_native`, called `keccakf1600_permute_native`. - This following changes are include: - Apply the same harness file and construct function contract reference from `keccakf1600_permute`. - Use the following function contracts: - `mld_keccak_f1600_x1_native` - Add `MLD_USE_FIPS202_X1_NATIVE` in dummy_backend_fips202_x1.h Signed-off-by: willieyz <willie.zhao@chelpis.com>
…tive) - This commit adds CBMC proofs for following the native function: `mld_keccak_f1600_x4_native`, called `keccakf1600x4_permute_native`. - This following changes are include: - Apply the same harness file and construct function contract reference from `keccakf1600x4_permute`. - Use the following function contracts: - `mld_keccak_f1600_x4_native` - Add `MLD_USE_FIPS202_X4_NATIVE` in dummy_backend_fips202_x4.h Signed-off-by: willieyz <willie.zhao@chelpis.com>
…o_custom_native)
- This commit adds CBMC proofs for the native function `mld_poly_permute_bitrev_to_custom`,
called `polymat_permute_bitrev_to_custom_native`
- This following changes are include:
- Apply the same harness file and construct function contract,
reference from `polymat_permute_bitrev_to_custom`.
- Use the following function contracts:
- `mld_poly_permute_bitrev_to_custom`
- Add `MLD_USE_NATIVE_NTT_CUSTOM_ORDER` in dummy_backend.h
- Also, for makeing this CBMC proof work, this commit refactor
`mld_polymat_permute_bitrev_to_custom` from double loop to single loop.
Co-authored-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Signed-off-by: willieyz <willie.zhao@chelpis.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: CBMC: Add proofs atop of native functions #350
Based on: CBMC: Add proofs for native backend functions #768
The CBMC proof for
mld_poly_permute_bitrev_to_customincluded here causes the ML-DSA-44 proof to blow up. We are investigating and addressing this issue in this pull request.Error log
Update(Dec 8): Thanks for help from @mkannwischer and @rod-chapman , now had an issue report: Proof/SMT explosion for simple nested loop over 2D array diffblue/cbmc#8796