Repository navigation
Conversation
…the addition inlined As P-521's (TCombI): brainpoolP512r1's eight-word coordinates do not fit the point functions'. The tables are the other targets' (Impl/BrainpoolP512r1/CombTable7.lean): 74 windows of seven bits over the ladder's table of all 512 bits of the scalar. The ladder-based public key and signature, with their literals and Verified, are deleted, and the RFC 6979 registration requires VG_BRAINPOOLP512R1_COMB not to be one of the HMAC table's names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHFbSpgWBYWAsEnfUks
Regenerated with the full emitter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHFbSpgWBYWAsEnfUks
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 #4141 (the PPC64LE audit). Stacked on #4736, so it stays a draft until #4736 merges.
On PPC64LE, brainpoolP512r1's
[d]G(public keys) and[k]G(RFC 6979 signatures) used the Montgomery ladder. They now use the signed seven-bit comb with the addition inlined, #4736'sTCombI. brainpoolP512r1's eight-word coordinates don't fit the point functions' six, as P-521's nine don't. brainpoolP256r1 and P384r1 are in #4743.What changes
The per-curve files are #4736's P-521 files, with the curve's names and these sizes:
coordinates: 8 words;
windows: 74 (7 · 74 ≥ 512);
scalar bits: 512;
table: 75,776 words;
scalar, key and signature: 64, 129 and 128 bytes.
Impl/Ecdsa/BrainpoolP512r1/PPC64LEComb.lean: the comb's configuration on the signature's layout, with the other targets' tables (Impl/BrainpoolP512r1/CombTable7.lean). AlsopublicKeyBrainpoolP512r1CombandsignBrainpoolP512r1Comb.Proof/BrainpoolP512r1/PPC64LE/Comb.lean:LayoutI,ConfigI, the table's words andcomb_generator_ok(bycombI_ok).Proof/BrainpoolP512r1/Comb7Shape.lean(new, target-independent): the tables' length and rows, asProof/P521/Comb7Shape.lean.Proof/EcKey|Ecdsa/PPC64LE/BrainpoolP512r1/Comb{,Lit}.lean: correctness, constant time (taint_decide, with the table's address public) andVerified, with the table as a constant.RFC 6979: the core passes the comb's table, and the registration requires
VG_BRAINPOOLP512R1_COMBnot to be one of the HMAC table's names.Removed: the ladder-based public key and signature, with their literals and
Verified(andImpl/EcKey/BrainpoolP512r1/PPC64LE.lean). Nothing else used them.No TCB, Spec or Rust change. The crate changes are only in
crates/verified-garbage-asm-powerpc64le:ec_brainpoolp512r1,internal/vg_ecdsa_brainpoolp512r1_sign_k, and the newconsts/vg_brainpoolp512r1_comb.rs.Table size
The table adds 606,208 bytes of constants to the ppc64le crate, 75,776 words of 8 bytes. The other targets already ship the same size:
vg_brainpoolp512r1_combvg_brainpoolp512r1_comb7vg_brainpoolp512r1_comb(this PR)vg_p521_comb(#4736), as on x86-64 and AArch64The rows are the same tables,
Impl/BrainpoolP512r1/CombTable7.lean, in each target's Montgomery form. So this is in line with the precedent and adds nothing new in kind.Testing
lake buildandEmit.leanpass, on PPC64LE P-521: public keys and RFC 6979 signatures by the signed seven-bit comb #4736 restacked locally ontomain. The emitter's output for brainpoolP512r1 is committed and is the same on PPC64LE P-521: public keys and RFC 6979 signatures by the signed seven-bit comb #4736's base.Benchmark
Scoped run: Benchmarks run 42527666626, with
arches=powerpc64, the curve's public-key and SHA-512 signing groups, and base9206b9ee(#4736's head).ec_brainpoolp512r1_public_key/129ecdsa_brainpoolp512r1_sha512_sign/64ecdsa_brainpoolp512r1_sha512_sign/1024ecdsa_brainpoolp512r1_sha512_sign/16384The job ran 8 copies of each binary for the signing groups and kept the fastest. The base's copies spread 123%, and its 64-byte time (8.09 ms) is about twice its 1024-byte time. The head's copies spread 0.8–2.5% at 64 and 1024 bytes, and 70.7% at 16 KiB. Every group is faster by 82% or more.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TKUFHFbSpgWBYWAsEnfUks