Formal verification for the ECSM affine selector - #925
Open
nicole-graus wants to merge 2 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.
Motivation
#879 publishes
yR, which makes two things observable that weren't: the input point's parity, andyR's representation. Both are closed by new checks in that PR. This adds an independent model and a soundness gate so those checks are verified rather than argued.Additive only — 28 files under
docs/verification/ecsm-affine/, no repo source touched.Description
k256, no repo code), anchored by 9 independent checks including a cross-check against the PyPIecdsapackage.IS_AFFINEselector and itsEcallpinning,OverflowKind::YrLtP, theyGread /yRwrite, and the address-limb bounds.ecsm::compute_witness{,_with_y}before any UNSAT is trusted, and 19 premises the gate assumes about the Rust are read from source and mutation-tested.Seven distinct attacks are exhibited constructively. Every new check in #879 has a control showing it is load-bearing.
Two results worth reading:
YrLtPband really is populated — there is a secp256k1 point withy = 1, soyR + pis 32-byte representable. The forgery is carried through the ECDAS relation and its carry window, not just asserted at the value level.(xG, k), both satisfying all 423 in-table constraints, samexR, differentyR. Reproduced 9× fromcrypto/ecsmitself.How to test