Skip to content

Shuffling / hiding against side channels

Prereqs: Side-channel threat model · Masking shares · helpful: KEM accelerator anatomy
Next: Masking shares (contrast) · ASA / HPC fuzzing · Crypto-agile SoC · Track: PQC hardware
Tracks: pqc-hardware · lattice-lwe

Learning goals. After this page you can:

  • Contrast shuffling/hiding with masking in one table
  • Sketch Fisher–Yates-style order randomization on a tiny list
  • Open the curated Kyber HW shuffling extract with correct expectations

The one idea

Masking randomizes values by splitting secrets into shares.
Hiding / shuffling randomizes when sensitive operations happen — the order of loop iterations, memory accesses, or butterfly steps — so a fixed-time power model lines up less cleanly with the secret [1].

Masking Shuffling / hiding [1]
Randomizes Share values Operation order / addresses
Typical cost Share arithmetic + conversions RNG + permutation control + some latency
Kyber example Masked Compress / compare gadgets Shuffle decrypt leakage points (PWM, reduction, post-INTT sub, …)

Many real designs combine both; this card isolates shuffling so the contrast sticks.

Toy — shuffle a length-4 loop

Sensitive iterations \(0,1,2,3\) (think four coefficient slots).
A Fisher–Yates shuffle draws a random permutation \(\pi\) and processes slot \(\pi(i)\) instead of \(i\).

Example permutation \(\pi = (2,0,3,1)\) means the hardware touches indices in order \(2\to 0\to 3\to 1\).
An attacker who assumes “cycle \(t\) always means index \(t\)” is now wrong [1].

Hardware-friendly wrinkle

Naive shuffles can create address conflicts on dual-port memories or fixed pipelines.
[1] describes a hardware-friendly Fisher–Yates variant with an intermediate address permutation so the first/last shuffled addresses do not collide in their Kyber FPGA datapath.

Mid-page self-check

Does shuffling change the Module-LWE hardness assumption?

Answer No. Like masking, it hardens the **implementation** against physical leakage; it does not replace the mathematical assumption.

What the Kyber leaf protects

Built on an open-source Kyber FPGA, [1] adds compact on-chip RNG + address controllers around decrypt leakage points (pointwise multiply, modular reduction, post-INTT subtraction, INTT butterflies).
Security eval uses CPA / TVLA on Artix-7; area overhead is modest relative to unprotected ATP in that paper’s tables — always re-read numbers from the extract and apply area–time honesty.

Common confusions

  • Shuffling ≠ masking (see table).
  • Shuffling ≠ constant-time alone (order still varies; timing channels need their own story).
  • Passing TVLA at \(N\) traces ≠ “unbreakable forever.”
  • Fault attacks (hash-based fault card) are a different physical threat.

Check yourself

  1. What does shuffling randomize?
Answer The order (and related addresses) of sensitive operations.
  1. Why might a HW shuffle need an “intermediate permutation”?
Answer To avoid memory / port address conflicts in a Fisher–Yates schedule [[1]](#ref-1).
  1. Name the curated extract.
Answer `papers/tcas-ii-pqc/a-hardware-friendly-shuffling-countermeasure-against-side-channel-attacks-for-kyber/paper.md`

Deep schedules (NTT / rejection) — same idea, thicker controllers

Once the toy shuffle is clear, curated leaves go deeper:

Leaf theme What gets permuted Extract
NTT network / coefficient-index shuffle Nested NTT loops collapsed to a single-level address schedule; CIR + network randomization on an FPGA PE [2] TCAD low-cost NTT shuffling
SUCRE (ML-DSA) Shuffle-and-unmask for rejection sampling under masking — permute then unmask for \(\infty\)-norm checks without heavy A2B [3] TCHES SUCRE

These are still order / schedule tools (sometimes combined with masking), not CIM memory fusion (CIM-NTT).

Next steps

References

[1] D. Xu, K. Wang, and J. Tian, “A hardware-friendly shuffling countermeasure against side-channel attacks for Kyber,” IEEE Trans. Circuits Syst. II, vol. 72, no. 3, pp. 504–508, Mar. 2025, doi: 10.1109/TCSII.2025.3528751.

[2] Z. Chen, Y. Ma, and J. Jing, “Low-cost shuffling countermeasures against side-channel attacks for NTT-based post-quantum cryptography,” IEEE Trans. Comput.-Aided Design Integr. Circuits Syst., vol. 42, no. 1, pp. 322–326, Jan. 2023, doi: 10.1109/TCAD.2022.3174142.

[3] S. Belaïd et al., “ML-DSA masking sweetened with SUCRE: Shuffle-and-unmask countermeasure for rejection sampling,” IACR Trans. Cryptogr. Hardw. Embed. Syst., vol. 2026, no. 1, pp. 618–659, 2026, doi: 10.46586/tches.v2026.i1.618-659.