HOL-Light: Add HOL Light proof for aarch64 polyz_unpack_{17,19}#971
Open
mkannwischer wants to merge 5 commits intomainfrom
Open
HOL-Light: Add HOL Light proof for aarch64 polyz_unpack_{17,19}#971mkannwischer wants to merge 5 commits intomainfrom
polyz_unpack_{17,19}#971mkannwischer wants to merge 5 commits intomainfrom
Conversation
Add a HOL Light functional correctness proof for the aarch64 ML-DSA function poly_chknorm, which checks whether any polynomial coefficient has absolute value >= a given bound. This commit includes: - Functional correctness proof showing the assembly computes `bitval(?i. i < 256 /\ abs(ival(x i)) >= ival bound)` - autogen support for generating aarch64 HOL Light assembly - Update of s2n-bignum Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
This also fixes the contract of poly_chknorm_native - it was incorrectly modelled as only returning -1 or 0, never 1. This was actually a proof gap - CBMC was not happy with 0U - ret. This commit changes it to use mld_ct_cmask_nonzero_u32 - which has exactly the behavior we want here. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
- Rewrite expressions during symbolic execution to keep system states readable - Keep quantified propositions folded to the point where case-by-case analysis is needed - Hoist all helper lemmas out of the main proof for better readability Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
polyz_unpack_17polyz_unpack_{17,19}
Add functional correctness proofs for polyz_unpack_17 and polyz_unpack_19. Closely following the decompress proofs from mlkem-native: pq-code-package/mlkem-native#1543 Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Add CBMC contracts for native AArch64 polyz_unpack_17 and polyz_unpack_19 following corresponding HOL-Light specs. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
9981590 to
855dcd4
Compare
Contributor
CBMC Results (ML-DSA-65)Full Results (178 proofs)
|
Contributor
CBMC Results (ML-DSA-44)Full Results (178 proofs)
|
Contributor
CBMC Results (ML-DSA-87)Full Results (178 proofs)
|
| num_of_wordlist (MAP zunpack17 l) /\ | ||
| (!i. i < 256 ==> | ||
| --(&(2 EXP 17) - &1) <= ival(EL i (MAP zunpack17 l)) /\ | ||
| ival(EL i (MAP zunpack17 l)) <= &(2 EXP 17))) |
Contributor
There was a problem hiding this comment.
Slight divergence from other proofs: This is a consequence of the
read(memory :> bytes(r,1024)) s =
num_of_wordlist (MAP zunpack17 l) /\
post-condition and could be derived as a corollary in the SUBROUTINE spec. This would leave XXX_CORRECT confined to the core argument, which I'd prefer.
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
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.
polyz_unpack#921TODO