Skip to content

PPC64LE P-224 ECDH: [d]P by four-bit windows - #4715

Merged
alex merged 1 commit into
mainfrom
claude/ppc64le-ecdh-p224
Nov 8, 2026
Merged

alex merged 1 commit into
mainfrom
claude/ppc64le-ecdh-p224

Conversation

@alex

@alex alex commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Part of #4141 (PPC64LE audit, finding 1). Follows #4712.

vg_ecdh_p224 computed [d]P with the Montgomery ladder (759 µs on POWER9, 5.4× OpenSSL). It now uses #4712's four-bit windows, Impl/Ecdsa/PPC64LE/Window.lean, unchanged. P-224's coordinates are four words and its a is -3, the same as P-256's, so the layout and the formulas are the same.

  • Proof/Ecdsa/PPC64LE/P224/Window.lean: mul_ok on P-224's field. It is P-256's proof with the curve and the field swapped, and it reuses P-256's curve-independent lemmas (ofN_ok, wstep, the nibble's arithmetic, the masks). RISC-V likewise has one window proof per curve.
  • Proof/Ecdh/PPC64LE/P224/Verified.lean: win_mulPowOk and the Verified theorem through exchangeWith_ok. Constant time is checked by taint_decide on the new literal.

No TCB or Spec change.

Testing

  • The full lake build, Emit.lean and --check pass. The only crate change is ecdh_p224.rs and its assembly.
  • The static checks and check_lean_public_imports.py pass.
  • The ppc64le tests run in CI; this container has no qemu.

Benchmark

Benchmarks run 42519884818, with arches=powerpc64, modules=ecdh_p224 and base b7c10de, on POWER9:

Benchmark Base Head
ecdh_p224/28 1.26 ms (median; noisy, 95% CI 0.77–1.49 ms) 408.39 µs (CI 408.1–409.1 µs)

The base side of this run was noisy. The audit's run measured the base at 759 µs, so the change is about 46% faster against that figure. P-256's ECDH, with the same layout, went from 873.6 µs to 412.6 µs in #4712's run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TKUFHH4GefHP3pmPRSL4N4

@github-actions github-actions Bot added the untrusted-only This changes exclusively implementations and proofs, and thus is entirely formally verified. label Nov 8, 2026
Base automatically changed from claude/ppc64le-ec-verify to main November 8, 2026 20:31
The windows of P-256's ECDH (Impl/Ecdsa/PPC64LE/Window.lean) on P-224, whose
coordinates are also four words and whose a is also -3: the proof of
Proof/Ecdsa/PPC64LE/P256/Window.lean on P-224's field, reusing its
curve-independent lemmas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHH4GefHP3pmPRSL4N4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

untrusted-only This changes exclusively implementations and proofs, and thus is entirely formally verified.

Development

Successfully merging this pull request may close these issues.

2 participants