Key encapsulation

Threebears1248r2cca

Integer Module-LWE KEM using a large Mersenne-like prime, a NIST Round 2 candidate

unverified Root API only Post-quantum
Unverified tier.

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 Threebears1248r2cca

Threebears1248r2cca is a key encapsulation mechanism from the Three Bears family. It uses a 1,584-byte public key, a 40-byte secret key, a 1,697-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–2025
  1. NIST calls for post-quantum KEMs and signatures

    NIST Post-Quantum Cryptography standardisation
  2. Three Bears published by Mike Hamburg

  3. 69 complete round-1 submissions published

    NIST Post-Quantum Cryptography standardisation
  4. 26 candidates advance to round 2

    NIST Post-Quantum Cryptography standardisation
  5. Round 3 finalists and alternates announced

    NIST Post-Quantum Cryptography standardisation
  6. Kyber, Dilithium, Falcon and SPHINCS+ selected; round 4 opens

    NIST Post-Quantum Cryptography standardisation
  7. FIPS 203 (ML-KEM), FIPS 204 (ML-DSA) and FIPS 205 (SLH-DSA) published

    NIST Post-Quantum Cryptography standardisation
  8. HQC selected as a second KEM

    NIST Post-Quantum Cryptography standardisation

How it works

  1. KeyGen samples small secret integers and publishes a noisy product with a public matrix over Z_N.
  2. Encapsulation creates a fresh noisy product and hides a key-encoding with forward error correction.
  3. Decapsulation removes the noise using the secret and decodes the key.
  4. 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

Research into integer-based LWE constructionsBenchmarking against polynomial-ring KEMsHistorical NIST Round 2 comparison

Sizes

FieldBytesMeaning
pk1,584Public key
sk40Secret key
ct1,697Ciphertext
ss32Shared secret
seed0Seed
coins0Encapsulation 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", "threebears1248r2cca", None, outs=2)
ct, ss = root.call("kem_encaps", "threebears1248r2cca", None, pk, outs=2)
assert ss == root.call("kem_decaps", "threebears1248r2cca", None, sk, ct)[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Frequently asked questions

What is Threebears1248r2cca?

Threebears1248r2cca 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 Threebears1248r2cca sizes?

In NextSSL, Threebears1248r2cca uses: public key 1,584 bytes, ciphertext 1,697 bytes, shared secret 32 bytes.

Is Threebears1248r2cca post-quantum?

Yes. Threebears1248r2cca is a post-quantum kem: it is designed to resist attacks by large quantum computers. Its tier in NextSSL is unverified.

Who designed Threebears1248r2cca and when?

Threebears1248r2cca belongs to the Three Bears family, first published in 2017 by Mike Hamburg. Its origin: NIST PQC Round 2 candidate.

Is Threebears1248r2cca safe to use?

Threebears1248r2cca 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).