Verifying gcm_init_v8 -- a proof strategy#247
Open
pennyannn wants to merge 28 commits intoleanprover:mainfrom
Open
Verifying gcm_init_v8 -- a proof strategy#247pennyannn wants to merge 28 commits intoleanprover:mainfrom
pennyannn wants to merge 28 commits intoleanprover:mainfrom
Conversation
15d46c1 to
beeb487
Compare
beeb487 to
e855c82
Compare
596d12a to
df846b7
Compare
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.
Description:
Currently, LNSym could not handle
gcm_init_v8fully expanded out and solved bybv_decide. Simply expand out the definitions (even with pmult uninterpreted) will result in stack overflow from Lean.In this PR, instead of brute-force expansion, we conduct the proof in controlled steps. We first simulate for 17 steps to get the expression for H0 and verify that the value stored in v20 (H0) is equivalent to the spec, we insert a hypothesis (h_H0) into the precedents. Then we simulate for another 22 steps to get H1, H2 and H3, and likewise insert hypothesis (h_H1, h_H2, and h_H3) that represents their equivalence into the hypotheses. When conducting the proof in the second step, we only expand expression until it reaches the value stored in v20 (H0), as a result, controlling the size of the term to be small. We do this for the rest of the elements in the Htable.
This proof depends on a key result
gcm_polyval_asm_gcm_polyval_equivwhich states the equivalence between the gcm polyval operation implemented in the assembly is equivalent to the gcm polyval operation in the specification. This is a non-trivial proof and currently could not be proved. One possibility is to try the RME decision procedure implemented in the SAW proofs [1][2].Testing:
What tests have been run? Did
make allsucceed for your changes? Wasconformance testing successful on an Aarch64 machine?
License:
By submitting this pull request, I confirm that my contribution is
made under the terms of the Apache 2.0 license.