Skip to content

AArch64 Brainpool-P384: sign with the fixed-base comb - #4512

Merged
reaperhulk merged 1 commit into
mainfrom
codex/arm64-brainpool384-comb
Nov 7, 2026
Merged

reaperhulk merged 1 commit into
mainfrom
codex/arm64-brainpool384-comb

Conversation

@reaperhulk

@reaperhulk reaperhulk commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Brainpool-P384 signing on AArch64 currently computes the nonce point with the general scalar multiplier. Use the existing 7-bit fixed-base tables and complete general-curve comb instead: 55 additions per nonce candidate. This ports the organization of x86-64 #4425 using the AArch64 comb already used for Brainpool-P256.

The existing shared table certificate is reused. The arithmetic, ABI, constant-time behavior and RFC 6979 composition are proved; no changes to the TCB, specs, public API, per-key storage or 8 KiB workspace. The new table adds 330 KiB of shared read-only data. Verification, ECDH and public-key derivation retain their existing implementations.

M1 Max, macOS 27.2, Rust 1.99.0 / LLVM 23.1.1, OpenSSL 4.0.3, normal CPU detection. Production comparison against main da38ca4f448b8005809e90c433f168491f907a3a, implementation 335bd82bbc4e972a57ec7b9a16c29e0664378ed4:

SHA-384 signing Main This PR OpenSSL
64-byte message 423.13 µs 43.09 µs 574.74 µs
1 KiB 845.75 µs 85.55 µs 575.55 µs
16 KiB 432.71 µs 52.68 µs 585.93 µs
Prehashed, 48 bytes 423.14 µs 42.99 µs 572.46 µs

The repository harness ran three interleaved rounds and three fresh binary copies, with 25 samples, 0.3 s warm-up and 1 s measurement per case, reporting the fastest per-round median and fastest copy. Copy spread was 0.0–0.1%. OpenSSL ran once for reference. The 1 KiB fixed message takes another deterministic nonce attempt on both VG revisions; the optimization preserves the retry policy. These are steady-state API timings, including hashing where applicable.

bench_compare.py now includes these signing groups in its fresh-copy handling because they read a large comb table. Measurement artifacts remain outside the repository.

Scoped native N2 comparison passed, with three interleaved rounds and three fresh binary copies:

SHA-384 signing N2 main N2 this PR N2 OpenSSL
64-byte message 618.84 µs 62.26 µs 858.73 µs
1 KiB 1.24 ms 123.69 µs 859.38 µs
16 KiB 630.77 µs 74.20 µs 870.73 µs
Prehashed, 48 bytes 618.52 µs 62.08 µs 852.85 µs

The N2 reference is OpenSSL 3.5.5 (the runner system library), distinct from the local M1 OpenSSL 4.0.3. N2 copy spread was 0.0–0.2%; the harness reports the fastest copy/round, and OpenSSL ran once for reference. See the linked run for exact runner/toolchain/reference-library metadata.

Validation on the rebased head:

  • Full lake build (28,606 jobs), full emission and Emit.lean --check; all artifact audits pass. Refreshed the CI cache at rebase.
  • Public-import audit and every Static checks audit pass; CI-tool unit suite: 660 tests in 38 modules pass with current Python/Bash/GNU tools.
  • Formatting and Clippy with warnings denied pass.
  • 244 Rust unit, 141 CAVP and 299 integration tests pass, including published vectors and Wycheproof. Six Brainpool-P384 integration tests also pass with VG_CPU_FEATURES=none.

@reaperhulk
reaperhulk enabled auto-merge November 7, 2026 18:06
@reaperhulk
reaperhulk added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit f63a8d0 Nov 7, 2026
26 checks passed
@reaperhulk
reaperhulk deleted the codex/arm64-brainpool384-comb branch November 7, 2026 18:41
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.

1 participant