Repository navigation
PPC64LE brainpoolP256r1, P384r1 ECDSA: verification's [u]G by the comb - #4795
Merged
Merged
Conversation
[u]G by the signed seven-bit comb of #4785 (its table, VG_BRAINPOOL<C>R1_COMB, an artifact constant) and [v]Q by the four-bit windows for any a, as P-256's verification (#4770), in place of the joint ladder. The internal point doublings only the joint ladder called are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHNk9SreF92JBY2H8M
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.
Part of the PPC64LE audit, #4141 (ECDSA verification). This follows #4785, which gave these curves' public keys and signatures the comb, and #4770, which did this for P-256.
vg_ecdsa_brainpoolp{256,384}r1_verifyon PPC64LE now compute[u]G + [v]Qthe way P-256's verification does (Cfg.pointsWith), instead of the joint ladder (Cfg.points,joint):[u]G: the signed seven-bit comb of PPC64LE brainpoolP256r1, P384r1: public keys and signatures by the comb #4785. Its table is the same artifact constant the key and signature code already use,VG_BRAINPOOLP{256,384}R1_COMB.[v]Q: ECDH's four-bit windows for anya(Impl/Ecdsa/PPC64LE/WindowA.lean), with3bread fromB3P.pointsWithstill writesbin Montgomery's form toEM, which P-256's windows read and these curves' do not. That costs a few instructions per verification. Removing the write would mean changing P-256's proof as well, so I left it.Proofs
Proof/Ecdsa/Verify/PPC64LE/BrainpoolP{256,384}r1/Verified.lean:combPts_okfollows P-256's (P256Comb.lean). Its window step isWindow.BrainpoolP{256,384}r1.mul_ok, whose constants are the layout's own:F.b3p, with nosetConst.verify_ppcusesverifyWith_ok.verify_ctusestaintSymon the table's symbol.verifyHash_verifiedusesHash.verifyHash_verified_cons, all as P-256's.The combined proof is in the
Verifiedmodule that uses it, rather than in a module of its own. brainpoolP384r1'scombPts_oktakesset_option exponentiation.threshold 512 in, as #4785'scomb_generator_okdoes.No TCB, Spec or registration changes.
Generated crate. Only PPC64LE changes: the two verifications, and the removal of
vg_brainpoolp{256,384}r1_point_double, internal functions that only the joint ladder called.Testing
cargo test --target powerpc64le-unknown-linux-gnu --release brainpoolpasses: Wycheproof's brainpool ECDSA vectors and RFC 7027.lake build(every module) andEmit.leanpass on this tree, which ismainplus this commit.check_lean_public_imports.pypass.cargo fmt --checkandclippy -D warningspass.Benchmarks
The run is pending, scoped to
arches=powerpc64and the two curves' verify groups, with baseb3fcb1b1(main). I'll link it here.Generated by Claude Code