Add per-arch ADX X25519 scalar-mult kernels and generate the fe51 tier - #182
Merged
Conversation
Optimise X25519 scalar multiplication with new per-arch field kernels, selected once per scalar-mult through the CurveField facade/backend and folded into the ClpX25519 driver behind a single tier-dispatch point. Kernels (all generator-emitted, oracle- and differential-validated): - x86-64: radix-2^64 (saturated, 4-limb) fused Montgomery ladder step using MULX + dual ADCX/ADOX, db-encoded, gated on BMI2+ADX. ~3.16x over the prior scalar path (~0.82x of OpenSSL on Kaby Lake). - aarch64: radix-2^64 comba fused ladder step (mul/umulh + adds/adcs, plain mnemonics), gated on AArch64 asm availability; qemu-validated. - i386: radix-2^32 (saturated, 8-limb) Comba kernel using 32-bit MULX, emitted by a distinct no-REX 32-bit encoder. 1.37x over the plain-mul fallback (native-measured, ship-gated); plain-mul kept as the pre-ADX fallback. fe51 tier: bring the previously hand-written x86-64 and aarch64 fe51 (radix-2^51) mul/sqr kernels under the generator, retiring them with byte-identical machine code (i386 fe51 was already generated). Rename the mislabelled *_Fe64_* includes and selectors to their true representation: X25519 -> _Fe51_ (radix-2^51), X448 -> _Fe56_ (radix-2^56). The genuine radix-2^64 / radix-2^32 kernels are the SAT64* / ADX32* families.
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.
Optimise X25519 scalar multiplication with new per-arch field kernels, selected once per scalar-mult through the CurveField facade/backend and folded into the ClpX25519 driver behind a single tier-dispatch point.
Kernels (all generator-emitted, oracle- and differential-validated):
fe51 tier: bring the previously hand-written x86-64 and aarch64 fe51 (radix-2^51) mul/sqr kernels under the generator, retiring them with byte-identical machine code (i386 fe51 was already generated).
Rename the mislabelled Fe64 includes and selectors to their true representation: X25519 -> Fe51 (radix-2^51), X448 -> Fe56 (radix-2^56). The genuine radix-2^64 / radix-2^32 kernels are the SAT64* / ADX32* families.