36 case KyberMode::Kyber512_R3:
37 case KyberMode::Kyber512_90s:
38 case KyberMode::ML_KEM_512:
39 m_nist_strength = KyberStrength::_128;
41 m_eta1 = KyberEta::_3;
46 case KyberMode::Kyber768_R3:
47 case KyberMode::Kyber768_90s:
48 case KyberMode::ML_KEM_768:
49 m_nist_strength = KyberStrength::_192;
51 m_eta1 = KyberEta::_2;
56 case KyberMode::Kyber1024_R3:
57 case KyberMode::Kyber1024_90s:
58 case KyberMode::ML_KEM_1024:
59 m_nist_strength = KyberStrength::_256;
61 m_eta1 = KyberEta::_2;
67 BOTAN_ASSERT_UNREACHABLE();
72 m_symmetric_primitives = std::make_unique<Kyber_90s_Symmetric_Primitives>();
73 m_keypair_codec = std::make_unique<Kyber_Expanded_Keypair_Codec>();
79 m_symmetric_primitives = std::make_unique<Kyber_Modern_Symmetric_Primitives>();
80 m_keypair_codec = std::make_unique<Kyber_Expanded_Keypair_Codec>();
86 m_symmetric_primitives = std::make_unique<ML_KEM_Symmetric_Primitives>();
87 m_keypair_codec = std::make_unique<ML_KEM_Expanding_Keypair_Codec>();
91 static_assert(
N % 8 == 0);
92 m_polynomial_vector_bytes = (
bitlen(
Q) * (
N / 8)) *
k();
93 m_polynomial_vector_compressed_bytes =
d_u() *
k() * (
N / 8);
94 m_polynomial_compressed_bytes =
d_v() * (
N / 8);
95 m_private_key_bytes =
static_cast<uint32_t
>([
this] {
104 if(!m_symmetric_primitives) {
105 throw Not_Implemented(
"requested Kyber mode is not enabled in this build");