Repository navigation
PPC64LE ECDSA P-256: verification's [u]G by the comb and [v]Q by windows - #4770
Merged
Merged
Conversation
vg_ecdsa_p256_verify on PPC64LE computes [u]G by the signed seven-bit comb of P-256's public keys, from the same table, VG_P256_COMB, now a constant of the verification too, and [v]Q by ECDH's four-bit windows (b in Montgomery's form at EM), then their sum by the complete addition, in place of the joint double-and-add. Proof: Cfg.pointsWith/verifyWith compose the verification from a computation of [u]G + [v]Q, and verifyWith_ok proves it from any that meets PtsOk (verify_ok is its instance with points_ok). combPts_ok proves P-256's by comb_ok and Window.mul_ok. The hash wrapper's proof (Verify/PPC64LE/Hash.lean) takes the verification's tables of constants, as ARM's does (verifyHash_verified_cons). Constant time: taint_decide with the table's address public (taintSym). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHNk9SreF92JBY2H8M
This was referenced Nov 8, 2026
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), following #4747.
vg_ecdsa_p256_verifyon PPC64LE now computes[u]G + [v]Qin three steps:[u]G: the signed seven-bit comb of P-256's public keys (PPC64LE P-256: public keys by the signed seven-bit comb #4729). The comb reads the same table,VG_P256_COMB, which is now a constant of the verification too. There is one table per curve, and it is public here.[v]Q: the four-bit windows of ECDH (Impl/Ecdsa/PPC64LE/Window.lean), withbin Montgomery's form atEM, a slot the verification has finished with.save,sum).This replaces #4747's joint double-and-add for P-256. The other curves follow once their combs merge.
Proofs
Cfg.pointsWith,backWithandverifyWithbuild the verification from any computation of[u]G + [v]Q.verifyWith_ok(Main.lean) proves the verification from any such computation that meetsPtsOk, givens.syms = s₀.syms, obtained byWP.mono_symsafter the stages before.verify_ok, for the other curves, is now its instance withpoints_ok.P256Comb.lean,combPts_ok: the bits ofu, thenbtoEM, thencomb_ok(Proof/P256/PPC64LE/Comb.lean's configuration), thensave_ok, the bits ofv,Window.mul_okandsum_ok. Every slot fact is adecideon P-256's concrete layout.Verify/PPC64LE/Hash.leantakes the verification's tables of constantsK, as ARM's does:hashR I KandcoreR I K, withstripConsts/ConstsOkand the tables' addresses inpub;coreR_nil,coreR_cons,hashed_verified_consandverifyHash_verified_consare new, the last byVerified.stackScratchLCandnarrowK_pre;verifyHash_verifiedwithK = [].Verified.lean(P-256):vPC) and its implication ofverifyContract … (abi.withConsts p256CombConsts);taint_decidewithtaintSym [VG_P256_COMB], which makes the table's address public;vSatandverifyHash_sat.No TCB or Spec changes. The registration is unchanged textually; its contract now carries the table (
consts_of).Generated crate. Only PPC64LE's
ecdsa_p256changes:vg_ecdsa_p256_verifynow readsVG_P256_COMB.Testing
cargo test --target powerpc64le-unknown-linux-gnu --release p256and… ecdsapass: Wycheproof, CAVP and RFC 6979.main(PPC64LE: inverses by sliding windows of p − 2 and n − 2 #4762 included):lake build(all modules) passes;Emit.leanleaves the crates as committed.check_lean_public_imports.py(edited modules) pass;cargo fmt --checkandclippy -D warningspass.Benchmarks
Run 42532702800:
arches=powerpc64,modules=ecdsa_p256, the verify groups, base85135eea(this PR's base, #4762 included).ecdsa_p256_sha256_verify/64ecdsa_p256_sha256_verify/1024ecdsa_p256_sha256_verify/16384ecdsa_p256_sha384_verify/64ecdsa_p256_sha384_verify/1024ecdsa_p256_sha384_verify/16384🤖 Generated with Claude Code
https://claude.ai/code/session_01TKUFHHNk9SreF92JBY2H8M