Simple Power Analysis of Polynomial Multiplication in HQC
Single-trace SPA on HQC's Karatsuba base-case multiplication leaks private-key bits via a cache-timing countermeasure's table scan; 99.69% success on ChipWhisperer-Lite; proposes fixes.
Schemes: HQC, PQClean HQC Additional implementation, liboqs HQC
Findings (quotes checked against the source text)
-
A single-trace simple power analysis recovers a 64-bit limb of the HQC private key per multiplication call, because the cache-timing countermeasure scans the whole lookup table, leaking the index.
To recover the value stored in a, we exploit the countermeasure designed to defend against cache timing attacks.
-
The attack succeeded in 99.69% of 10,000 attempts on a ChipWhisperer-Lite with an STM32F303 Cortex-M4 target, and all failures came from the first four bits.
The overall success rate of the attack was 99.69%, with 31 unsuccessful attempts.
-
Removing the lookup table or the cache countermeasure defeats this specific attack and speeds up the multiplication, but other side-channel attacks remain possible, so masking is still needed.
Although these functions may still be vulnerable to other power analysis attacks (or, in the case of base_mul3, to cache timing attacks), they can be secured using the masking countermeasure introduced in section 7.1
-
Boolean masking of the private key blocks this single-trace attack, but an attacker may still attack the two masked multiplications and recover the key.
It is important to note that, while this masking technique is effective, an attacker may still be able to carry out successful attacks on the two performed multiplications and potentially recover the masked value of a and the mask value.
Numbers (as extracted, not quote-checked)
- Success rate of single-trace SPA over 10,000 attempts: 99.69%
- base_mul2 (no lookup table) speedup vs base_mul: approximately 2.3x
- base_mul3 (no cache countermeasure) speedup vs base_mul: approximately 6.9x
- Key-recovery granularity per trace: 64-bit limb of the private key
For builders
If a PQ KEM ever goes into a chain's wallet or node code, audit its polynomial multiplication for table-scan cache countermeasures, since those leak secret indices to power traces.
Limits
Tested only on one reference implementation on a ChipWhisperer-Lite Cortex-M4 at -Os; attack needs physical power access; countermeasures not evaluated for leakage beyond the stated tests.
Topics: implementation-sidechannel kem benchmarks wallets-keys