Repository navigation
clazel-p384: group law, scalar product and verify, proven against the contract (3.5h, PR3), tier 0 - #25
Merged
Conversation
The statements of the executable group law, scalar product, key decoding, digest reduction and verify, over the vocabulary of spec.rs. No code yet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…spec Affine SEC 1 2.2.1 ec_add in the spec's case order, uncompressed key decoding, MSB-first double-and-add against spec::scalar_mul, derive_e with the reduction mod n, and verify meeting verify_ensures, all over the six fiat axioms and no new one. Adds Fe::dup (a copy with the same which/val). Tier stays 0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Eight valid and six invalid vectors of ecdsa_secp384r1_sha384_test.json (d17cc89f), plus damaged r, s, digests and keys. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
PR3 of P-384 ECDSA verification (3.5h). It adds the group law, the scalar product and
verify, proven againstcontract.rsover PR2's six axioms. It is stacked on #23, and the crate stays at tier 0.Commits
cb00c2d(contracts):src/point_contract.rs, committed before the code. It statesec_add,scalar_mul,decode_public_keyandderive_e(mod n) againstspec.rs.verifykeeps PR1'sverify_requires/verify_ensuresunchanged.f2b4401(code):point.rs: the SEC 1 §2.2.1 affine group law in the spec's case order, plus key decoding and validation.scalar.rs: MSB-first double-and-add. Its invariant is that, after each prefix of bits, the result equalsspec::scalar_mulof that prefix. No associativity is used.convert.rs: reduction of an octet prefix mod m.lemmas.rs: among others, the spec's bit-stringderive_eequalsos2ipof the first min(|h|, 48) octets.verify.rs: proven to give exactlyspec::ecdsa_verify(p384(), …)on every input.f6a97f1(tests):tests/verify.rs.ecdsa_secp384r1_sha384_test.jsonatd17cc89f: valid tcIds 1, 2, 5, 7, 295, 296, 297 and 300 are accepted; invalid tcIds 102, 109, 151, 171, 195 and 204 are rejected.Checked
133 verified, 0 errors, from a clean cache, re-run independently of the agent. No rlimit is raised.axioms.rs: byte-identical to the reviewed file (SHA-256e9ee88f1…a4e3). The 18 documented axioms are unchanged.spec.rsandfield/contract.rsare untouched.contract.rschanged only in a doc comment.cargo testpasses 7 field tests and 9 verify tests, in both debug and release.cargo xtask check: passes.cargo xtask mutate clazel-p384: 26 of 26 mutations killed with certificates.Not done
CI has not run yet.
🤖 Generated with Claude Code