PQC Implementation Security & Side-Channel Resistance
Identify and mitigate timing, cache, power/EM, and fault-injection side channels across ML-KEM, ML-DSA, and SLH-DSA, and scope verifiable TVLA, FIPS 140-3, and EUCC evaluation evidence.
Why this matters: Mathematically sound lattice and hash-based algorithms still lose secret keys in production when variable-time division, rejection-sampling branches, explicit FO decapsulation errors, or unmasked Keccak/NTT paths leak timing, power, or EM side channels.
Start here: Inspect vulnerable vs. constant-time ML-KEM and ML-DSA code patterns in the Timing Leak Inspector to see how division timing, rejection-sampling branches, and early-exit memcmp expose secret keys.
Educational Scope & Production Verification
This module uses simplified C code patterns, walkthrough traces, and illustrative order-of-magnitude cost profiles to teach side-channel and fault-injection defense decisions. Completing exercises here does not certify your cryptographic library, firmware, or hardware module — apply disassembly checks, timing harnesses, TVLA lab testing, and accredited FIPS 140-3 / EUCC evaluations to your real production builds.
1. Constant-Time Pitfalls in ML-KEM & ML-DSA
Passing known-answer tests verifies mathematical correctness of (FIPS 203) and (FIPS 204), but says nothing about whether execution time or cache behavior depends on secret keys. Lattice schemes introduce distinct microarchitectural failure modes compared to RSA and ECC:
KyberSlash Division Timing (t / q)
Dividing secret-dependent intermediate values by q = 3329 in Compress_d or Decompress_d compiles to variable-latency hardware DIV/SDIV instructions on many x86, ARM, and RISC-V cores. Replace divisions with constant-time Barrett or Montgomery multiply-shift reductions and enforce disassembly gates in CI.
ML-DSA Rejection-Sampling Branches
In FIPS 204 signing, the retry count is public, but early-exit loops checking ||z||_∞, ||r0||_∞, or ||ct0||_∞ leak which coefficient failed and bias recovery of masking vector y and secret vectors s1/s2. Scan full vectors branchlessly and aggregate a single failure mask.
Secret-Dependent Memory Indexing
Lookup tables indexed by secret noise or message bits expose cache-line access patterns to co-resident Prime+Probe or Flush+Reload attackers. Use bitsliced or arithmetic formulas (e.g., Hamming-weight subtraction for CBD sampling) or full-table constant-time scans.
What to Look for in Production Verification Tooling
Look for automated binary disassembly checks banning secret-path division/branch instructions per target ISA, statistical timing harnesses (such as dudect), and dynamic taint checkers (Timecop / ctgrind). Limitation: A constant-time pass on one compiler version or CPU architecture does not carry over automatically when flags, compilers, or target ISAs change.
2. Fujisaki-Okamoto (FO) Transform & Implicit Rejection
Core lattice encryption (K-PKE) is only IND-CPA secure: an active attacker who can submit crafted ciphertexts and learn whether decryption succeeded can recover the long-term secret key. wraps K-PKE in the Fujisaki-Okamoto (FO) transform with implicit rejection to achieve IND-CCA2 security.
How FIPS 203 ML-KEM.Decaps Protects Secret Keys
- Decrypts ciphertext
cto candidate messagem′and derives(K′, r′) = G(m′ || h). - Always computes the pseudorandom fallback key
K̄ = J(z || c)from the secret rejection seedzstored inside the decapsulation key. - Re-encrypts
m′toc′and compares all bytes ofcandc′in constant time (never early-exitmemcmp). - Uses a branchless conditional move (
cmov) to returnK′on match orK̄on mismatch — with identical timing, identical memory pattern, and no error code.
Why Explicit Errors Create Key-Recovery Oracles
Returning ERR_INVALID_CIPHERTEXT, skipping J(z || c) on valid inputs, or letting a wrapper API log a decapsulation mismatch exposes a plaintext-checking oracle. Similarly, failing to zeroize m′ and r′ leaves sensitive intermediates in stack or heap memory.
Production check: Verify ACVP ML-KEM implicit-rejection vectors and run valid-vs-tampered timing differential tests across both the cryptographic library and the calling protocol wrapper (TLS, HPKE, or KMS API).
3. Hardware Masking & Fault-Injection Countermeasures
On HSMs, smart cards, secure elements, and embedded MCUs where adversaries can capture power consumption or electromagnetic (EM) traces — or inject voltage/clock glitches and laser pulses — constant-time software alone is insufficient. Defense-in-depth combines masking, shuffling, and fault detection.
Linear vs. Non-Linear Masking Costs
The Number Theoretic Transform (NTT) is linear over Z_q, so splitting polynomials into d + 1 arithmetic shares scales roughly linearly. The real cost bottleneck lies in non-linear operations: Arithmetic-to-Boolean (A2B/B2A) conversions for ML-KEM compression and ML-DSA norm checks, plus the non-linear Chi (χ) step in Keccak / SHAKE (FIPS 202), which consumes substantial fresh randomness from an approved DRBG.
Fault Injection on FIPS 204 & FIPS 205
Passive masking does not prevent active faults. Glitching an ML-DSA rejection check or corrupting a (FIPS 205) WOTS+ hash chain during signing can leak secret key material from a single faulty signature. Redundant verification (verifying the signature before releasing it) and random operation shuffling mitigate single-fault and horizontal single-trace attacks at a modest fraction of signing cost.
4. Evaluation Evidence: TVLA, FIPS 140-3 & EUCC
Evaluating a PQC product requires distinguishing between leakage screening, module validation, and attack-potential certification:
TVLA (Welch’s t-Test, |t| > 4.5)
Test Vector Leakage Assessment compares fixed vs. random input trace sets; exceeding |t| > 4.5 signals statistically significant leakage. Key caveat: TVLA detects leakage — it does not prove key-recovery exploitability by itself, and passing first-order univariate TVLA does not rule out higher-order, multivariate, or single-trace template attacks.
FIPS 140-3 Non-Invasive Mitigation
Following the September 2026 transition of FIPS 140-2 to Historical status, new acquisitions rely on (ISO/IEC 19790), with non-invasive attack mitigation test methods referenced in ISO/IEC 17825, NIST SP 800-140F, and FIPS 140-3 IG PQC. Verify active CMVP certificate scope and Security Policy coverage of PQC primitives.
EUCC AVA_VAN.4 & AVA_VAN.5
Under the EU Cybersecurity Certification Scheme (EUCC, Commission Implementing Regulation (EU) 2024/482), high-assurance hardware modules undergo independent penetration and side-channel/fault vulnerability analysis at AVA_VAN.4 or AVA_VAN.5, bound strictly to the evaluated Target of Evaluation (TOE) firmware and silicon revision.
A vendor claim of “side-channel resistant PQC” without trace counts, TVLA/attack reports, active FIPS 140-3 CMVP certificate IDs, or EUCC TOE version bindings must be recorded as Unverified / Evidence Gap — never as low risk.
Check off all sections and mark this reading done.
Related modules
- Cloud-Native & SaaS PQC MigrationSame migration phase · Shares ML-KEM, ML-DSA, SLH-DSA
- Energy, Utilities & Grid PQCSame migration phase · Shares ML-KEM, ML-DSA, SLH-DSA
- Certification Engineer Quantum ImpactShares ML-KEM, ML-DSA, SLH-DSA
- ACVP Lab Workflow: From Vector Set to EvidenceSame track · Hardware Infrastructure · Shares ML-KEM, ML-DSA, SLH-DSA
Next step
Produce the artifact: Deployment PlaybookThis module belongs to phase 5 (Pilots & Migration); Deployment Playbook produces a deliverable of that phase in the Command Center.
Production Tool Capabilities & Verification ChecklistDevelopers, Certification & Validation Engineers, and Cryptography Researchers
Capabilities to require in your production tools:
- Audit ML-KEM, ML-DSA, and SLH-DSA implementations for constant-time execution across modular arithmetic (Barrett/Montgomery reduction), NTT, rejection sampling, and Fujisaki-Okamoto implicit rejection.
- Evaluate masking order, fresh-randomness budgets, and fault-injection countermeasures (re-execution, redundancy checks, glitch-resistant comparisons) for embedded and hardware-backed PQC modules.
- Scope non-specific TVLA (t-test threshold |t| > 4.5), FIPS 140-3 IG physical/non-invasive security requirements, and EUCC/Common Criteria AVA_VAN side-channel evaluation evidence.
How to evaluate in your environment
Run dudect or ctgrind/Valgrind constant-time checks on compiled target binaries (inspecting compiler-generated assembly for secret-dependent branches or division), and review accredited lab TVLA trace reports and FIPS 140-3/EUCC evaluation summaries.
Production evidence to collect
Target-architecture disassembly and constant-time verification reports, FO implicit-rejection negative test results, accredited lab TVLA/side-channel test reports, and linked FIPS 140-3 or EUCC Security Policy/Certification Report.
Completing this Hub module and its browser-based sample exercises teaches the technical and governance decision criteria for your role; it does not test, validate, or certify your deployed production systems.
Record evidence for your environment
Identify the tested build and configuration. Use reference IDs for observations. For a proposed exclusion, record the system boundary or rule and why it excludes this build.
Evidence missing. 0 of 3 requirements have a reference or scope rationale.
Learning module content can be inaccurate. Please double-check its information. Report inaccuracies in PQC Today GitHub Discussions.