Selected X25519 SIMD128 qualification — 2026-10-26

The existing bulk X25519 API now selects the direct-output field kernels and fixed u32 subtraction carries. For 100 independent raw key/peer pairs, selected global inversion costs 73,686,374 whole-call instructions, versus 202,678,692 for its matched scalar control: 63.64% fewer instructions, a 2.75× cost ratio. For one raw local key and 100 peers, it costs 73,685,757, versus 189,479,149 for the fastest scalar control: 61.11% fewer, a 2.57× ratio.

No kernel selector is needed. agree_independent, agree_one_local, caller-owned buffers/scratch and the meaningful Inversion::{PerFour, Global} choices remain. Obsolete compiled arithmetic variants and the four temporary case IDs are removed. The earlier 12-case experiment is retained as a source patch/artifact, not as compatibility code. Shared Ed25519 field files are unchanged.

Actual selected-API calls

All eight original cases passed three physical fresh-message samples at N=100, size 32, valid/distinct inputs. Every sample has identical whole/body/page counts and every output is checked against the scalar fixture answer. Counts below cover all 100 operations. Raw scalar import/clamping, context/scratch construction and owned secret/scratch wiping/drop occur inside the operation. Whole-call counts include Wire fixture-request wrappers, checking, reply, runtime and actual page charges. Body includes driver/probes/checksum writes and faults between probes. Page fees are included, never subtracted.

Raw inputs, expected answers and caller output allocation are staged in setup. This does not measure delivery/decoding of 100 raw key pairs as Wire bytes, nor does it reuse a secret object or prepared DH workspace from an earlier call.

Topology Implementation Whole call Body Page fees
Independent keys Scalar 202,678,692 202,252,552 480,000
Independent keys Scalar/global inverse 205,151,383 204,725,243 480,000
Independent keys Selected SIMD/per-four inverse 80,560,898 80,134,758 400,000
Independent keys Selected SIMD/global inverse 73,686,374 73,260,234 480,000
One local key Scalar 202,660,749 202,234,715 480,000
One local key Scalar/global inverse 189,479,149 189,053,115 480,000
One local key Selected SIMD/per-four inverse 80,560,281 80,134,247 400,000
One local key Selected SIMD/global inverse 73,685,757 73,259,723 480,000

Edge and range validation

All 24 requested selected-inversion edge rows passed: both key topologies, both inversion modes, N=1/5/500, invalid and mixed peer patterns, one actual sample each. Invalid peers are noncontributory zero coordinates; each rejected output has false validity and zero bytes. Other lanes still complete. Every output/verdict is checked. The two inversions retain equal checksums in all 12 matched topology/batch/pattern groups.

The frozen 12-case optimization experiment additionally passed 216 installed rows at N=1/2/3/5/100/500 with valid/invalid/mixed patterns. Native validation covers RFC7748 Alice/Bob and scalar vectors, iterations 1/1000, p..p+18 and ignored high bits, twist/low-order coordinates, clamp aliases/raw zero secrets, mixed-zero lanes, full random 100/500 outputs and 408 frozen OpenSSL 3.4.3 C answers. The selected-source native suite (18 tests) and original eight-case fixture matrix passed after cleanup.

The independent source/math review found no introduced defect within its scope. Its closed invariant R_i=radix_i−1+65,536 bounds every reachable operation; the largest checked u64 intermediate is 2,248,848,820,973,077,548 (<2^61) and largest u32 scale 2,552,627,162 (<2^32). The full <3.5-radix subtraction envelope has no underflow, additions <2^31, top carry≤19 and c19≤361. Selected arithmetic is source-equivalent to the reviewed experimental bodies.

Compiled selected code

Both parent/child source hashes match the frozen selected files. All 11 inspected raw function bodies match installed bytes through the artifact's SHA-256 origin map. Field multiply uses 100 low+100 high unsigned widening extmul instructions; square uses 55+55. Both bodies are branch-free. The selected ladder uses 48 fixed u32x4 shifts for subtraction carries and has only two conditional backedges, for public decoding and the fixed 255-bit loop. No secret-dependent branch or address was found in the targeted source/bytecode review; this is not a formal or external constant-time proof.

There are zero memory.copy instructions within the bit loop. The remaining two copy sites are outside it. The ladder frame is 2,256 bytes, versus 2,736 in the original SIMD ladder. Raw scalar groups remain guarded and borrowed into the ladder; caller inputs stay caller-owned. Explicit wiping covers owned state, not every possible compiler register/spill or expression temporary.

The prior qualified winner profile (same selected arithmetic, before API cleanup) has zero observer delta and a complete reconciled instruction/page/origin ledger. Dynamic charges are 122,795 versus 5,218,795 in the earlier ladder profile; the five 160-byte per-step copies are absent. Its bounded physical-stack capture is explicitly partial. The latest R6 calls are independently measured and unprofiled; no old profile ledger is presented as their exact ledger.

Immutable evidence

  • Root artifact: crypto/bench/artifacts/r6-selected-x25519-20261026.
  • Installed SHA-256: b07c3c4cb6636be658514db38889f53018e15638f6f232876534a5761667671a.
  • Raw debug Wasm: 4689e4055bd04e411b360ba5abd8a193c054fff50706cc609f6d63472bdc9ce3.
  • Selected parent source: 4ef81b089c09508fdbe9e25eddfaf101532353b4ed3f50dd859d84c4efc9283e.
  • Selected child source: 4631af52da044f179dca826312f67b003186507791a07d38f4d232f8119aa4db.
  • Independent review FREEZE.json: def8e61e2da017ab5ae138fb425ec51e7b3aa6f89319c898fff77aad3a6a8c0c.

Machine-readable selected report, primary results, edge results, frozen experiment profile. All runs own their servers and shut down normally. Source archives, module/source hashes, complete traces and disassembly are retained. The earlier qualified baseline and primary-source research remain historical evidence. No SDK/runtime/instruction change is involved.