Repository navigation
PPC64LE P-521 ECDH: [d]P by three-bit windows - #4722
Merged
Merged
Conversation
alex
force-pushed
the
claude/ppc64le-ecdh-p384
branch
from
November 8, 2026 20:40
53a2d68 to
db2861d
Compare
alex
force-pushed
the
claude/ppc64le-ecdh-p521
branch
from
November 8, 2026 20:40
c9b8c61 to
5f78b1f
Compare
alex
force-pushed
the
claude/ppc64le-ecdh-p384
branch
from
November 8, 2026 21:46
db2861d to
576c776
Compare
alex
force-pushed
the
claude/ppc64le-ecdh-p521
branch
from
November 8, 2026 21:46
5f78b1f to
ebdef40
Compare
alex
force-pushed
the
claude/ppc64le-ecdh-p521
branch
from
November 8, 2026 22:01
ebdef40 to
bf9c73c
Compare
alex
marked this pull request as ready for review
November 8, 2026 22:01
alex
enabled auto-merge
November 8, 2026 22:07
This was referenced Nov 8, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 8, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 8, 2026
|
This pull request has conflicts with Posted by |
P-521's sixteen entries of four-bit windows do not fit the working space past the tables of bits, so its windows take three bits (Impl/Ecdsa/PPC64LE/Window3.lean): a table of [e]P for e < 8, then for each of the 176 windows three Jacobian doublings and one complete addition of the entry selected by a constant-time scan. The proof is P-256's (Proof/Ecdsa/PPC64LE/P256/Window.lean) on P-521's field and nine-word layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHH4GefHP3pmPRSL4N4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHH4GefHP3pmPRSL4N4
alex
force-pushed
the
claude/ppc64le-ecdh-p521
branch
from
November 8, 2026 22:48
bf9c73c to
5f5d77c
Compare
ec_p521.rs declares the internal p521 field functions since #4762; ecdh_p521.rs refers to them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHH4GefHP3pmPRSL4N4
alex
enabled auto-merge
November 8, 2026 23:00
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 8, 2026
Member
Author
|
The merge queue's failure (run 42533231916) is not this PR's. The failing job is the x86-64 Generated by Claude Code |
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 (PPC64LE audit, finding 1). Follows #4719 (P-384), #4715 (P-224) and #4712 (P-256).
vg_ecdh_p521computed[d]Pwith the Montgomery ladder of complete additions (4.83 ms on POWER9, 12× OpenSSL). P-521's coordinates are nine words. A four-bit window's sixteen entries (16 × 216 bytes) do not fit the working space past the tables of bits (5824–8192), so P-521 uses three-bit windows instead.Impl/Ecdsa/PPC64LE/Window3.lean: the three-bit variant of PPC64LE P-256 ECDH: [d]P by four-bit windows #4712's windows, reusing its table additions, copies, masks and entry scan.[e]Pfore < 8takes 1728 bytes, from 5824 to 7552.R = 8 R(three Jacobian doublings), reads three bits of the table of bits, scans the eight entries under masks, and does one complete addition.r3plus a constant.Proof/Ecdsa/PPC64LE/P521/Window.lean:mul_ok, which provesR = [k]Pfor everyk < 2^528. It is P-256's proof on P-521's field and nine-word layout, with the three-bit window step (wstepwith 8,nib3_eq).Proof/Ecdh/PPC64LE/P521/Verified.lean:win_mulPowOkand theVerifiedtheorem throughexchangeWith_ok. As in PPC64LE: inverses by sliding windows of p − 2 and n − 2 #4762 for the other curves,Z^(p-2)is taken by the addition chain (chainPow_ok). Constant time is checked bytaint_decideon the new literal.Signed four-bit windows (eight entries, Booth digits) would save about 10% more. They need the recoding and negation proofs, so they are left for later.
No TCB or Spec change.
Testing
EmitOne.lean EcdhP521.PPC64LEpasses after the rebase onto PPC64LE: inverses by sliding windows of p − 2 and n − 2 #4762. The only crate change isecdh_p521.rsand its assembly.check_lean_public_imports.pypass.Benchmark
POWER9, run 42521138146 (before the rebase onto #4762's chain), scoped to
arches=powerpc64,modules=ecdh_p521:ecdh_p521/66🤖 Generated with Claude Code
https://claude.ai/code/session_01TKUFHH4GefHP3pmPRSL4N4