Repository navigation
clazel-p384: Wycheproof, NIST CAVP and ring differential conformance (3.5h, PR5), tier 0 - #27
Merged
Merged
Conversation
… xtask converters
Wycheproof ecdsa_secp384r1_sha{256,384,512}_test.json at d17cc89f (DER
signatures) and NIST CAVP 186-4 SigVer.rsp, each with SOURCE.md and a
licence file, converted by `cargo xtask testdata` into Rust tables whose
digests are computed by the converter. SOURCE.md may name an archive's
SHA-256 instead of a git commit. New tooling dependency sha1 0.10.6; sha2
0.10.9 is now also used by xtask. docs/DEPENDENCIES.md rows updated for the
differential engine that the next commit adds.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tests/conformance_ecdsa.rs runs Wycheproof (1,518 tests, DER signatures read by clazel-der) and NIST CAVP SigVer P-384 (75 cases); the differential signs 2,000 random messages with ring 0.17.14 and compares 14,000 verdicts of verify and ring. The dev profile builds clazel-p384 with opt-level 3 so a full run takes minutes, not an hour; the workspace manifest change makes verify --changed and CI check every crate. Still tier 0: no independent transcription, mutations of the code or Kani. 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.
PR5 of P-384 ECDSA verification (3.5h). It adds the conformance suites and a differential against an independent engine for
clazel-p384::verify.src/is unchanged apart from a doc comment inlib.rs,axioms.rsis still the reviewed file (e9ee88f1…a4e3), and the crate stays at tier 0.Commits
32ad88c: vendors the test vectors byte for byte. Each directory has aSOURCE.md(URL, commit or zip SHA-256, size, file SHA-256) and its licence. Also adds an xtask converter for each suite.ecdsa_secp384r1_sha{256,384,512}_test.jsonatd17cc89f, the commitclazel-pkcs1already pins. Apache-2.0. The P1363 files are not vendored.SigVer.rsp, from186-4ecdsatestvectors.zip(zip SHA-256fe47cc92…4752). Public domain. The converter keeps the five P-384 sections.xtask/src/testdata.rsnow letsSOURCE.mdgive the zip'sSHA-256:in place of aCommit:, with a unit test, since NIST has no commit to pin.d570ce2:tests/conformance_ecdsa.rsandtests/differential_ring.rs, the dev-dependencies, and[profile.dev.package.clazel-p384] opt-level = 3in the workspace manifest (design Q5). Overflow checks stay on.Results
Every case agrees with
verify. There are no expected failures, and no Wycheproof case at this commit isacceptable.clazel-p384has no DER layer of its own. The test reads each WycheproofEcdsa-Sig-Valuewith ourclazel-der(non-negative, at most 48 magnitude octets, nothing trailing). It refuses 705 malformed encodings, none of them avalidcase, and they still count intotal.ringdifferential: 2,000 signatures, each tried 7 ways (valid; a bit flipped in r, s, the message or the key; another key; edge values of r and s). Both engines accept 2,000 and refuse 12,000. Signatures differ between runs, because ring's random source can't be seeded; a failure prints the case in hex.Dependencies
sha1 0.10.6, classtooling, used by xtask's converter. xtask also now usessha2, which was already listed.clazel-p384dev-dependencies:clazel-der,sha2 =0.10.9andring =0.17.14.ringwas already inCargo.lock. The "why" text of its rows and its dependencies' rows is updated, with classes unchanged.Checks done
cargo xtask checkpasses, including the allowlist, pins and generated test data.cargo test -p xtaskpasses.conformance_ecdsaindependently of the agent: all four lines above, in 29 s.SIGNATURESat the top of the file sets its size.The workspace-manifest change makes CI select every crate on this PR.
Not done
CI has not run yet.
🤖 Generated with Claude Code