Threebears936r2cca
Integer Module-LWE KEM using a large Mersenne-like prime, a NIST Round 2 candidate
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 Threebears936r2cca
Threebears936r2cca is a key encapsulation mechanism from the Three Bears family. It uses a 1,194-byte public key, a 40-byte secret key, a 1,307-byte ciphertext and a 32-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
Three Bears is a lattice-style key encapsulation mechanism that replaces polynomial rings with arithmetic modulo a single large generalised Mersenne prime. It reached the second round of the NIST process and offers both ephemeral (CPA) and CCA-secure variants.
Most lattice KEMs work with vectors of polynomials. Three Bears instead uses vectors of large integers modulo N = 2^3120 - 2^1560 - 1, a prime chosen for fast reduction. Its security assumption, Integer Module Learning With Errors, is the integer analogue of Module-LWE. The design aims for simplicity and compact code, using cSHAKE for expansion and error correction to keep decryption failures rare.
The three parameter families are BabyBear, MamaBear and PapaBear, with module dimension 2, 3 and 4. Each integer modulo N is encoded as 312 ten-bit digits, so the variant names give the total number of digits per module vector: 624, 936 and 1248. Each family exists in an ephemeral CPA-secure form, intended for one-time keys, and a CCA-secure form obtained with a Fujisaki-Okamoto transform. Three Bears was not advanced to the third round. It remains of interest as an unusual point in the design space of LWE-based schemes.
History
2016–2025NIST calls for post-quantum KEMs and signatures
NIST Post-Quantum Cryptography standardisationThree Bears published by Mike Hamburg
69 complete round-1 submissions published
NIST Post-Quantum Cryptography standardisation26 candidates advance to round 2
NIST Post-Quantum Cryptography standardisationRound 3 finalists and alternates announced
NIST Post-Quantum Cryptography standardisationKyber, Dilithium, Falcon and SPHINCS+ selected; round 4 opens
NIST Post-Quantum Cryptography standardisationFIPS 203 (ML-KEM), FIPS 204 (ML-DSA) and FIPS 205 (SLH-DSA) published
NIST Post-Quantum Cryptography standardisationHQC selected as a second KEM
NIST Post-Quantum Cryptography standardisation
How it works
- KeyGen samples small secret integers and publishes a noisy product with a public matrix over Z_N.
- Encapsulation creates a fresh noisy product and hides a key-encoding with forward error correction.
- Decapsulation removes the noise using the secret and decodes the key.
- CCA variants re-encrypt and compare; CPA variants skip this check and must use fresh keys.
Security notes
No practical attack is known, but the scheme received limited cryptanalysis after Round 2 and is not standardised. The CPA variants are only safe with ephemeral keys; never reuse a CPA key pair across sessions.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| pk | 1,194 | Public key |
| sk | 40 | Secret key |
| ct | 1,307 | Ciphertext |
| ss | 32 | 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", "threebears936r2cca", None, outs=2)
ct, ss = root.call("kem_encaps", "threebears936r2cca", None, pk, outs=2)
assert ss == root.call("kem_decaps", "threebears936r2cca", None, sk, ct)[0]
nextssl_root_kem_keygen("threebears936r2cca", NULL, pk, sk);
nextssl_root_kem_encaps("threebears936r2cca", NULL, pk, ct, ss);
nextssl_root_kem_decaps("threebears936r2cca", 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, "threebears936r2cca", &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.
Similar names
Looking for something else?More key encapsulation
All 110Frequently asked questions
What is Threebears936r2cca?
Threebears936r2cca is a KEM in the Three Bears family. Three Bears is a lattice-style key encapsulation mechanism that replaces polynomial rings with arithmetic modulo a single large generalised Mersenne prime.
What are the Threebears936r2cca sizes?
In NextSSL, Threebears936r2cca uses: public key 1,194 bytes, ciphertext 1,307 bytes, shared secret 32 bytes.
Is Threebears936r2cca post-quantum?
Yes. Threebears936r2cca is a post-quantum kem: it is designed to resist attacks by large quantum computers. Its tier in NextSSL is unverified.
Who designed Threebears936r2cca and when?
Threebears936r2cca belongs to the Three Bears family, first published in 2017 by Mike Hamburg. Its origin: NIST PQC Round 2 candidate.
Is Threebears936r2cca safe to use?
Threebears936r2cca 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).