Slicing Bits and Cutting Costs in CDT Sampling: High-Order Masking of FrodoKEM's Gaussian Sampler, Revisited
Optimizes higher-order masked CDT Gaussian sampling for FrodoKEM via bitslicing, ripple-carry comparators and ANF multiplexers, yielding faster pure-C masked code on Cortex-M4.
Schemes: FrodoKEM, CDT sampler, Kogge-Stone adder, ripple carry adder
Findings (quotes checked against the source text)
-
Bitslicing with a ripple carry adder for comparisons is proved optimal, and bitslicing plus ANF multiplexers make the masked CDT sampler faster.
This includes bitslicing (with which, importantly, the ripple carry adder has been proved optimal for comparisons), as well as techniques such as the use of algebraic normal form in masked multiplexers.
-
On Cortex-M4 at masking order 1, the pure-C implementation outperforms Eid et al. assembly by about 2x and Gérard-Guerreau by 7 to 9x.
our companion implementation in pure C outperforms the hand-crafted assembly of Eid et al. (resp. Gérard-Guerreau) by a factor of around 2 (resp. 7 to 9) at masking order 1.
-
The speedup over Eid et al.'s higher-order code grows with masking order, from 5x at order 2 to 9x at order 8.
we outperform the higher-order code of Eid et al. (in C with assembly for expensive gadgets) by a factor ranging from 5 at masking order 2 to 9 as masking order 8.
Numbers (as extracted, not quote-checked)
- Speedup vs Eid et al. (order 1): around 2x
- Speedup vs Gérard-Guerreau (order 1): 7 to 9x
- Speedup vs Eid et al. (order 2): 5x
- Speedup vs Eid et al. (order 8): 9x
For builders
If you need side-channel-masked Gaussian sampling for a lattice KEM, the bitsliced ripple-carry CDT approach is the current efficiency reference, but it is irrelevant to chain-level signature or migration design.
Limits
Results are for an STM32F4 Cortex-M4 target only; the paper is about FrodoKEM sampling, not signatures, hashes, or blockchain integration.
Topics: implementation-sidechannel kem benchmarks