Verify shrtz - #2424
Open
klinashka wants to merge 5 commits into
Open
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
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.
This PR verifies
beeu_shrtz. The function takes as input the following parameters:p_a: 256-bit unsigned integer.p_x: 320-bit unsigned integer.p_m: 256-bit unsigned integer, representing the modulus.inv_m: 64-bit unsigned integer, s.t.p_m * inv_m = -1 (mod 2^64)The function updates
p_aandp_xas follows:p_a.p_xs.t.p_x_post = p_x_pre * 2^(-s) (mod M), wheresis the number of bits removed fromp_a.Additionally, we perform the following modifications in the PR.
u320_muladdto include bounds on the carry word. The proof does not change.u320_shr.u256_shr. The specification closely resembles the one foru320_shr, without the additional carry that is taken as input inu320_shr. The proof is identical to theu320_shrcounterpart.