HQC-192
Hamming Quasi-Cyclic: a code-based KEM chosen by NIST as a backup to ML-KEM
Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About HQC-192
HQC-192 is one of 3 HQC variants in the NextSSL registry, a key encapsulation mechanism. It uses a 4,522-byte public key, a 4,586-byte secret key, an 8,978-byte ciphertext and a 64-byte shared secret. It is designed to resist attacks by large quantum computers. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
HQC is a key encapsulation mechanism whose security rests on decoding random quasi-cyclic codes rather than on lattices. NIST selected it in 2025 for standardisation as a second, structurally different KEM to complement ML-KEM.
HQC works in the ring F2[X]/(X^n - 1) with n prime, so public keys and ciphertexts consist of a few long binary polynomials. The public key is a noisy syndrome built from two sparse secret polynomials. Encryption encodes the message with a public error-correcting code, a concatenation of a Reed-Muller and a Reed-Solomon code, and masks it with fresh sparse noise. The decryptor removes most of the mask with its secret key and corrects the remaining errors with the public code.
Unlike McEliece, the error-correcting code in HQC is public and carries no secret structure; security comes from the hardness of the quasi-cyclic syndrome decoding problem. An IND-CCA2 KEM is obtained with a Fujisaki-Okamoto style transform. Because the decoder has a small but non-zero failure rate, parameters are chosen to keep the decryption failure probability below 2^-128 or lower. The scheme is also simple to implement in hardware.
Three parameter sets are present: HQC-128, HQC-192 and HQC-256, targeting NIST categories 1, 3 and 5. Public keys are roughly 2.2 KB to 7.2 KB and ciphertexts about 4.4 KB to 14.4 KB, larger than ML-KEM but far smaller than Classic McEliece. NIST has announced it will publish a separate standard based on HQC, intended as a backup rather than a replacement for ML-KEM.
History
2016–2025NIST calls for post-quantum KEMs and signatures
NIST Post-Quantum Cryptography standardisationHQC submitted to NIST PQC
26 candidates advance to round 2
NIST Post-Quantum Cryptography standardisationRound 3 finalists and alternates announced
NIST Post-Quantum Cryptography standardisationAdvances to round 4
FIPS 203 (ML-KEM), FIPS 204 (ML-DSA) and FIPS 205 (SLH-DSA) published
NIST Post-Quantum Cryptography standardisationSelected by NIST as a second, code-based KEM
How it works
- KeyGen samples sparse secrets x and y and publishes h and s = x + h*y.
- Encaps encodes a random message with the concatenated Reed-Muller/Reed-Solomon code and masks it using s and fresh sparse noise.
- Decaps uses y to strip most of the mask and decodes the remaining errors.
- The message is re-encrypted and checked, and the shared key is hashed from it.
Security notes
No structural attack is known, but several timing side channels in earlier HQC implementations (in sampling and decoding) have been published and fixed in later revisions. The final NIST standard may differ in detail from the specification wired into NextSSL, so outputs may not match the eventual FIPS text.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| pk | 4,522 | Public key |
| sk | 4,586 | Secret key |
| ct | 8,978 | Ciphertext |
| ss | 64 | Shared secret |
| seed | 0 | Seed |
| coins | 0 | Encapsulation randomness |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'unverified' is reachable from the root API only
pk, sk = root.call("kem_keygen", "hqc-192", None, outs=2)
ct, ss = root.call("kem_encaps", "hqc-192", None, pk, outs=2)
assert ss == root.call("kem_decaps", "hqc-192", None, sk, ct)[0]
nextssl_root_kem_keygen("hqc-192", NULL, pk, sk);
nextssl_root_kem_encaps("hqc-192", NULL, pk, ct, ss);
nextssl_root_kem_decaps("hqc-192", NULL, sk, ct, ss);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_kem_in(reg::all(), Policy::Any, "hqc-192", &Params::new())?;
let (pk, sk) = alg.keygen(&mut *rng)?;
let (ct, ss) = alg.encaps(&pk, &mut *rng)?;
assert_eq!(ss, alg.decaps(&sk, &ct)?);
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other HQC variants
2More key encapsulation
All 110Frequently asked questions
What is HQC-192?
HQC-192 is a KEM in the HQC family. HQC is a key encapsulation mechanism whose security rests on decoding random quasi-cyclic codes rather than on lattices.
What are the HQC-192 sizes?
In NextSSL, HQC-192 uses: public key 4,522 bytes, ciphertext 8,978 bytes, shared secret 64 bytes.
Is HQC-192 post-quantum?
Yes. HQC-192 is a post-quantum kem: it is designed to resist attacks by large quantum computers. Its tier in NextSSL is unverified.
Who designed HQC-192 and when?
HQC-192 belongs to the HQC family, first published in 2017 by Carlos Aguilar Melchor, Nicolas Aragon, Slim Bettaieb, Loïc Bidoux, Olivier Blazy, Jean-Christophe Deneuville, Philippe Gaborit, Edoardo Persichetti, Gilles Zémor, et al.. Its origin: NIST PQC Round 4, selected for standardisation in 2025.
Is HQC-192 safe to use?
HQC-192 is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other HQC variants are there?
NextSSL also registers hqc-128, hqc-256 in the HQC family.