QNSP

Key Encapsulation

HQC

Hamming Quasi-Cyclic Key Encapsulation Mechanism

non-FIPScode-based3 parameter setsQNSP tier: strict+provider: liboqsalso called: Hamming Quasi-Cyclic
Code-based KEM selected by NIST in March 2025 as a fifth-round alternate KEM standard, providing an independent cryptographic assumption (coding theory, not lattices) as defence-in-depth against ML-KEM cryptanalysis.

Mechanism

How it works

HQC builds on the hardness of decoding random linear codes over F2. Public keys and ciphertexts are vectors in a quasi-cyclic code; encapsulation produces a noisy codeword that only the secret key can decode. Selected by NIST specifically as an independent assumption-economy fallback to ML-KEM (lattice-based).

Parameter Sets

3 variants shipped

Each variant trades security category against key, ciphertext, or signature size. QNSP exposes all variants via the @cuilabs/liboqs-native binding; tenant crypto-policy determines which are allowed.

VariantNIST LevelPublic KeySecret KeyCiphertextNote
HQC-128L12,249 B2,289 B4,481 B
HQC-192L34,522 B4,562 B9,026 B
HQC-256L57,245 B7,285 B14,469 B

NIST ACVP

Conformance evidence

QNSP runs the official NIST ACVP test vectors against every shipped algorithm. Live evidence + SHA-3-256 tamper digest at /verify/conformance.

@noble/post-quantum
non-addressable
Pure-JavaScript reference; cross-verification secondary on Maximum + Government tiers.
@cuilabs/liboqs-native
non-addressable
Native-C primary production engine. Runs across every QNSP backend service.
NIST ACVP vectors for HQC are not yet published.
View live ACVP evidence →

Use Cases

When to use it

  • Defence-in-depth: pair HQC with ML-KEM where the cost of a lattice-cryptanalysis break would be catastrophic
  • Maximum / Government tier policy that mandates dual-family coverage

Trade-offs

What you give up, what you get

  • Significantly larger keys and ciphertexts than ML-KEM
  • Independent cryptographic assumption from ML-KEM (defence-in-depth)
  • Slower than ML-KEM by a meaningful margin in practice

References

Primary sources