Threebears-Papabearephem-R2
Mike Hamburg's round-2 I-LWE KEM with BabyBear, MamaBear and PapaBear CCA and CPA forms
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 Threebears-Papabearephem-R2
Threebears-Papabearephem-R2 is one of 6 Three Bears Round 2 variants in the NextSSL registry, a key encapsulation mechanism. 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 Round 2 is the second-round Three Bears key encapsulation family by Mike Hamburg, based on Integer Learning With Errors. It includes CCA and CPA forms of BabyBear, MamaBear and PapaBear, plus ephemeral forms. NextSSL carries six round-2 variants as unverified archival entries.
The round-2 Three Bears specification refined the round-1 design by Mike Hamburg and added CCA-secure and CPA-secure forms at each of the three parameter levels. The underlying hardness assumption is Integer Learning With Errors, which avoids the number-theoretic transform and uses simple integer arithmetic.
NextSSL carries the BabyBear, MamaBear and PapaBear round-2 ephemeral variants, with their public keys of 804, 1194 and 1584 bytes respectively for the 624, 936 and 1248 parameter sets. The CCA variants carry larger secret keys than the CPA variants, which store the secret key in a different form. All use 32-byte shared secrets.
The archive tier is unverified. Three Bears was not standardised, and ML-KEM is the comparable standard choice.
History
2017–2017Three Bears Round 2 published by Mike Hamburg
How it works
- A seed generates an integer public vector and a small secret, and the public key is the masked product.
- Encapsulation encrypts a random message under the public key using integer arithmetic.
- CCA forms re-encrypt on decapsulation and return a pseudorandom key if the check fails.
Security notes
Unverified in NextSSL. CPA forms lack chosen-ciphertext protection and should not be used as a KEM. Ephemeral forms must not be reused.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| pk | 1,584 | Public key |
| sk | 40 | Secret key |
| ct | 1,697 | 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", "threebears-papabearephem-r2", None, outs=2)
ct, ss = root.call("kem_encaps", "threebears-papabearephem-r2", None, pk, outs=2)
assert ss == root.call("kem_decaps", "threebears-papabearephem-r2", None, sk, ct)[0]
nextssl_root_kem_keygen("threebears-papabearephem-r2", NULL, pk, sk);
nextssl_root_kem_encaps("threebears-papabearephem-r2", NULL, pk, ct, ss);
nextssl_root_kem_decaps("threebears-papabearephem-r2", 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, "threebears-papabearephem-r2", &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 Three Bears Round 2 variants
5Similar names
Looking for something else?More key encapsulation
All 110Frequently asked questions
What is Threebears-Papabearephem-R2?
Threebears-Papabearephem-R2 is a KEM in the Three Bears Round 2 family. Three Bears Round 2 is the second-round Three Bears key encapsulation family by Mike Hamburg, based on Integer Learning With Errors.
What are the Threebears-Papabearephem-R2 sizes?
In NextSSL, Threebears-Papabearephem-R2 uses: public key 1,584 bytes, ciphertext 1,697 bytes, shared secret 32 bytes.
Is Threebears-Papabearephem-R2 post-quantum?
Yes. Threebears-Papabearephem-R2 is a post-quantum kem: it is designed to resist attacks by large quantum computers. Its tier in NextSSL is unverified.
Who designed Threebears-Papabearephem-R2 and when?
Threebears-Papabearephem-R2 belongs to the Three Bears Round 2 family, first published in 2017 by Mike Hamburg.
Is Threebears-Papabearephem-R2 safe to use?
Threebears-Papabearephem-R2 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 Three Bears Round 2 variants are there?
NextSSL also registers threebears-babybear-r2, threebears-babybearephem-r2, threebears-mamabear-r2, threebears-mamabearephem-r2, threebears-papabear-r2 in the Three Bears Round 2 family.
Related families
NIST's primary post-quantum key encapsulation mechanism, standardised in FIPS 203
Saber Round 2The round-2 Saber KEM at the category 3 level, a Module-LWR scheme with a 992-byte public key
Three Bears Round 1Mike Hamburg's round-1 I-LWE KEM family with BabyBear, MamaBear and PapaBear parameter sets
BabyBear 624 CCAThe CCA-secure round-2 Three Bears BabyBear parameter set, with an 804-byte public key
MamaBear 936 CCAThe CCA-secure round-2 Three Bears MamaBear parameter set, with a 1194-byte public key