Skip to content

PPC64LE P-256: RFC 6979 signatures by the signed seven-bit comb - #4688

Closed
alex wants to merge 2 commits into
claude/ppc64le-nist-curvesfrom
claude/ppc64le-p256-comb-sign
Closed

alex wants to merge 2 commits into
claude/ppc64le-nist-curvesfrom
claude/ppc64le-p256-comb-sign

Conversation

@alex

@alex alex commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Part of #4141 (PPC64LE audit, finding 1). Stacked on #4675, so it stays a draft until that merges.

What changes

vg_ecdsa_p256_sign_k, the core of vg_ecdsa_p256_sign (RFC 6979), now computes [k]G with #4675's comb instead of the Montgomery ladder: signP256Comb = p256.signWith mulGeneratorP256.

  • The RFC 6979 wrapper takes a core with tables of constants (Core.cs), as x86-64's already does:
    • The contract (rfcPPC … cs) and the layout (Lay.cs, TBLs) carry the tables' regions.
    • The core's call supplies them (CoreTables, corePre, coreCall).
    • Two runs' layouts agree whenever the tables' addresses do (csSyms).
    • The contract with the tables, specK T cs vs, is satisfiable with the table in memory (sat_one).
    • The other curves pass cs := [], and their proofs are otherwise unchanged.
  • Proof/Ecdsa/PPC64LE/P256Comb.lean: the signature by the comb meets signContract with the table as a constant (Abi.withConsts). Correctness comes from signWith_ok with comb_generator_ok. Constant time uses taint_decide with taintSym, which makes the table's address public.
  • Registration: the RFC 6979 registration, like x86-64's, requires that VG_P256_COMB is not one of the HMAC table's function names.
  • Removed: the ladder-based P-256 signature (signP256), its literal and its Verified, which nothing else uses. combSatMem moves to Proof/P256/PPC64LE/Comb.lean, where the public key and the signature share it.

No TCB or Spec change.

Testing

  • lake build and Emit.lean pass. The only crate change is internal/vg_ecdsa_p256_sign_k in crates/verified-garbage-asm-powerpc64le.
  • The Static checks and check_lean_public_imports.py pass, and so does cargo fmt --check.
  • Locally, under qemu-ppc64le, the P-256 and ECDSA tests pass (76 tests), including RFC 6979's P-256 vectors and Wycheproof.

Benchmark

Benchmarks run 42515542591, scoped to arches=powerpc64, modules=ecdsa_p256, groups=ecdsa_p256_sha256_sign, with base 2d9b293 (#4675's head):

Benchmark Base Head Change
ecdsa_p256_sha256_sign/64 916.27 µs 161.46 µs 82.4% faster
ecdsa_p256_sha256_sign/1024 916.32 µs 164.86 µs 82.0% faster
ecdsa_p256_sha256_sign/16384 970.04 µs 217.91 µs 77.5% faster

🤖 Generated with Claude Code

https://claude.ai/code/session_01TKUFHJ728Kwktcff5BR2sx

PPC64LE's RFC 6979 wrapper now takes a core with tables of constants
(`Core.cs`), as x86-64's does: the contract and layout carry the tables'
regions, `core`'s call gives them (`CoreTables`), the two runs' layouts
agree on the tables' addresses (`csSyms`), and the contract with the
tables (`specK T cs vs`) is satisfiable with the table in memory
(`sat_one`).

`vg_ecdsa_p256_sign_k` is now `p256.signWith mulGeneratorP256`, the
comb as the generator of the signature's stages (`signWith_ok`), and
P-256's RFC 6979 signature calls it with the comb's table. The ladder's
signature, its literal and its `Verified` are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHJ728Kwktcff5BR2sx
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

This pull request has conflicts with claude/ppc64le-nist-curves, found after ef28190 landed on main: rebase it to resolve them. Before rebasing, see CLAUDE.md on checking how much Lean main changed, and on restacking a stacked pull request.

Posted by .github/workflows/conflicts.yml, once per push to a conflicting pull request.

alex commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Replaced by #4732: the same change, restacked onto #4729 (which replaced #4675).


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants