Generation of Fast Finite Field Arithmetic for Cortex-M4 with ECDH and SQIsign Applications
Presents m4-modarith, a generator of C with inline assembly for fast finite-field arithmetic on Cortex-M4, used to speed up SQIsign verification and RFC 7748 ECDH.
Schemes: SQIsign, Curve25519, RFC 7748, m4-modarith
Findings (quotes checked against the source text)
-
A generator produces Cortex-M4 modular multiplication code competitive with hand-optimized assembly, even beating some for Curve25519.
Our generated modular multiplications obtains fast performances, competitive with hand-optimized assembly implementations published in the literature, even outperforming some of them for Curve25519.
-
Generated code enabled SQIsign level 1 verification to drop from 123 to 54 Mcycles, a 2.3x speedup on Cortex-M4.
improving level 1 verification from 123 Mcycles to only 54 Mcycles, a $2.3\times$ speedup.
-
A new multiplication strategy matches operand caching memory access complexity while supporting larger cache sizes.
First, we introduce a novel multiplication strategy that matches the memory access complexity of the operand caching method while being applicable to a larger cache size for Cortex-M4 implementations.
-
A generalized pseudo-Mersenne reduction is formally proven correct and applicable to most cryptographic primes.
Second, we generalize an efficient pseudo-Mersenne reduction strategy, and formally prove its correctness and applicability for most primes of cryptographic interest.
-
Portable RFC 7748 implementations gain up to 2.2x speed from the generator.
we use our generator to improve performance of portable implementations of RFC~7748 by up to $2.2\times$.
Numbers (as extracted, not quote-checked)
- SQIsign level 1 verification on Cortex-M4 (before): 123 Mcycles
- SQIsign level 1 verification on Cortex-M4 (after): 54 Mcycles
- SQIsign verification speedup: 2.3x
- RFC 7748 portable speedup: up to 2.2x
For builders
Useful if you target Cortex-M4 embedded signers or verifiers: generated field arithmetic can keep pace with hand assembly, which helps when PQ parameters change often.
Limits
Based on the abstract only; full text was not read. Results are Cortex-M4 specific and SQIsign is an isogeny scheme, not a direct chain-signature candidate.