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

Proofs of poly_frommsg #358

Merged
merged 3 commits into from
Nov 7, 2024
Merged

Proofs of poly_frommsg #358

merged 3 commits into from
Nov 7, 2024

Conversation

rod-chapman
Copy link
Contributor

@rod-chapman rod-chapman commented Nov 6, 2024

Adds proof of poly_frommsg() function. In particular:

  1. Strengthen post-condition of cmov_int16() to use OBJECT_UPTO rather than OBJECT_WHOLE to allow a caller to modify one element of a larger array.
  2. Add contracts to specification and body of poly_frommsg()
  3. Add CBMC proof artefacts for this function.

mlkem/poly.c Outdated Show resolved Hide resolved
mlkem/poly.c Outdated Show resolved Hide resolved
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, but can you trim down on unneeded invariants and assertions please?

rod-chapman and others added 3 commits November 7, 2024 07:28
1. Strengthen post-condition of cmov_int16() to use OBJECT_UPTO rather than OBJECT_WHOLE
   to allow a caller to modify one element of a larger array.
2. Add contracts to specification and body of poly_frommsg()
3. Add CBMC proof artefacts for this function.

Signed-off-by: Rod Chapman <[email protected]>
Signed-off-by: Hanno Becker <[email protected]>
This seems faster than bitwuzla.

Signed-off-by: Hanno Becker <[email protected]>
@hanno-becker hanno-becker merged commit 9350cd9 into main Nov 7, 2024
33 checks passed
@hanno-becker hanno-becker deleted the cbmc_poly_frommsg branch November 7, 2024 08:08
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.

CBMC: State + prove spec for poly_frommsg()
2 participants