|
Botan 3.9.0
Crypto and TLS for C&
|
#include <kyber_constants.h>
Public Types | |
| enum | KyberDu : uint8_t { _10 = 10 , _11 = 11 } |
| enum | KyberDv : uint8_t { _4 = 4 , _5 = 5 } |
| enum | KyberEta : uint8_t { _2 = 2 , _3 = 3 } |
| enum | KyberStrength : uint16_t { _128 = 128 , _192 = 192 , _256 = 256 } |
| using | T = int16_t |
| base data type for most calculations | |
Public Member Functions | |
| size_t | canonical_parameter_set_identifier () const |
| KyberConstants (const KyberConstants &other) | |
| KyberConstants (KyberConstants &&other)=default | |
| KyberConstants (KyberMode mode) | |
| KyberMode | mode () const |
| KyberConstants & | operator= (const KyberConstants &other)=delete |
| KyberConstants & | operator= (KyberConstants &&other)=default |
| Kyber_Symmetric_Primitives & | symmetric_primitives () const |
| ~KyberConstants () | |
Foundational constants | |
| uint8_t | k () const |
| KyberEta | eta1 () const |
| constexpr KyberEta | eta2 () const |
| KyberDu | d_u () const |
| KyberDv | d_v () const |
| KyberStrength | estimated_strength () const |
Sizes of encoded data structures | |
| size_t | polynomial_vector_bytes () const |
| byte length of an encoded polynomial vector | |
| size_t | polynomial_vector_compressed_bytes () const |
| byte length of an encoded compressed polynomial vector | |
| size_t | polynomial_compressed_bytes () const |
| byte length of an encoded compressed polynomial | |
| size_t | ciphertext_bytes () const |
| byte length of an encoded ciphertext | |
| constexpr size_t | shared_key_bytes () const |
| byte length of the shared key | |
| size_t | public_key_bytes () const |
| byte length of an encoded public key | |
| size_t | expanded_private_key_bytes () const |
| byte length of a private key with expanded encoding as defined | |
| size_t | seed_private_key_bytes () const |
| byte length of an private key encoded as the seed: d || z | |
Static Public Attributes | |
| static constexpr T | F = 3303 |
| as specified in FIPS 203 (see Algorithm 10 (NTT^-1), f = 128^-1 mod Q) | |
| static constexpr T | N = 256 |
| number of coefficients in a polynomial | |
| static constexpr size_t | NTT_Degree = 128 |
| degree of the NTT polynomials | |
| static constexpr size_t | PUBLIC_KEY_HASH_BYTES = 32 |
| static constexpr T | Q = 3329 |
| modulus | |
| static constexpr T | ROOT_OF_UNITY = 17 |
| the primitive 256-th root of unity modulo Q (see FIPS 203 Section 4.3) | |
| static constexpr uint16_t | SAMPLE_NTT_POLY_FROM_XOF_BOUND = 280 * 3 |
| sampling limit for SampleNTT (in bytes), see FIPS 204, Apx B | |
| static constexpr size_t | SEED_BYTES = 32 |
| static constexpr size_t | SHARED_KEY_BYTES = 32 |
Definition at line 22 of file kyber_constants.h.
| using Botan::KyberConstants::T = int16_t |
base data type for most calculations
Definition at line 25 of file kyber_constants.h.
| enum Botan::KyberConstants::KyberDu : uint8_t |
| enum Botan::KyberConstants::KyberDv : uint8_t |
| enum Botan::KyberConstants::KyberEta : uint8_t |
| enum Botan::KyberConstants::KyberStrength : uint16_t |
| Botan::KyberConstants::KyberConstants | ( | KyberMode | mode | ) |
Definition at line 34 of file kyber_constants.cpp.
References Botan::bitlen(), BOTAN_HAS_KYBER, BOTAN_HAS_KYBER_90S, BOTAN_HAS_ML_KEM, d_u(), d_v(), k(), mode(), N, public_key_bytes(), PUBLIC_KEY_HASH_BYTES, Q, and SEED_BYTES.
Referenced by KyberConstants(), KyberConstants(), operator=(), and operator=().
|
default |
|
inline |
Definition at line 64 of file kyber_constants.h.
References KyberConstants().
|
default |
References KyberConstants().
|
inline |
|
inline |
byte length of an encoded ciphertext
Definition at line 105 of file kyber_constants.h.
References polynomial_compressed_bytes(), and polynomial_vector_compressed_bytes().
Referenced by Botan::Kyber_KEM_Decryptor_Base::encapsulated_key_length(), and Botan::Kyber_KEM_Encryptor_Base::encapsulated_key_length().
|
inline |
|
inline |
|
inline |
Definition at line 88 of file kyber_constants.h.
|
inline |
Definition at line 80 of file kyber_constants.h.
|
inlineconstexpr |
|
inline |
byte length of a private key with expanded encoding as defined
Definition at line 115 of file kyber_constants.h.
|
inline |
Definition at line 78 of file kyber_constants.h.
Referenced by canonical_parameter_set_identifier(), Botan::Kyber_Algos::decode_polynomial_vector(), KyberConstants(), Botan::Kyber_Algos::sample_matrix(), and Botan::ML_KEM_Symmetric_Primitives::seed_expansion_domain_separator().
|
inline |
Definition at line 70 of file kyber_constants.h.
Referenced by KyberConstants(), Botan::Kyber_KEM_Decryptor::mode(), Botan::Kyber_KEM_Encryptor::mode(), Botan::ML_KEM_Decryptor::mode(), and Botan::ML_KEM_Encryptor::mode().
|
delete |
References KyberConstants().
|
default |
References KyberConstants().
|
inline |
byte length of an encoded compressed polynomial
Definition at line 102 of file kyber_constants.h.
Referenced by ciphertext_bytes(), Botan::Kyber_Algos::compress_ciphertext(), and Botan::Kyber_Algos::decompress_ciphertext().
|
inline |
byte length of an encoded polynomial vector
Definition at line 96 of file kyber_constants.h.
Referenced by Botan::Expanded_Keypair_Codec::decode_keypair(), Botan::Kyber_Algos::encode_polynomial_vector(), and public_key_bytes().
|
inline |
byte length of an encoded compressed polynomial vector
Definition at line 99 of file kyber_constants.h.
Referenced by ciphertext_bytes(), Botan::Kyber_Algos::compress_ciphertext(), and Botan::Kyber_Algos::decompress_ciphertext().
|
inline |
byte length of an encoded public key
Definition at line 111 of file kyber_constants.h.
References polynomial_vector_bytes(), and SEED_BYTES.
Referenced by Botan::Expanded_Keypair_Codec::decode_keypair(), and KyberConstants().
|
inline |
byte length of an private key encoded as the seed: d || z
Definition at line 118 of file kyber_constants.h.
|
inlineconstexpr |
byte length of the shared key
Definition at line 108 of file kyber_constants.h.
References SHARED_KEY_BYTES.
Referenced by Botan::Kyber_KEM_Decryptor_Base::raw_kem_shared_key_length(), and Botan::Kyber_KEM_Encryptor_Base::raw_kem_shared_key_length().
|
inline |
Definition at line 122 of file kyber_constants.h.
Referenced by Botan::Kyber_Algos::expand_keypair(), and Botan::Kyber_Algos::sample_matrix().
|
staticconstexpr |
as specified in FIPS 203 (see Algorithm 10 (NTT^-1), f = 128^-1 mod Q)
Definition at line 34 of file kyber_constants.h.
|
staticconstexpr |
number of coefficients in a polynomial
Definition at line 28 of file kyber_constants.h.
Referenced by canonical_parameter_set_identifier(), KyberConstants(), and Botan::Kyber_Algos::polynomial_from_message().
|
staticconstexpr |
degree of the NTT polynomials
Definition at line 40 of file kyber_constants.h.
|
staticconstexpr |
Definition at line 44 of file kyber_constants.h.
Referenced by Botan::Expanded_Keypair_Codec::decode_keypair(), and KyberConstants().
|
staticconstexpr |
modulus
Definition at line 31 of file kyber_constants.h.
Referenced by Botan::Kyber_Algos::compress(), Botan::Kyber_Algos::decompress(), and KyberConstants().
|
staticconstexpr |
the primitive 256-th root of unity modulo Q (see FIPS 203 Section 4.3)
Definition at line 37 of file kyber_constants.h.
|
staticconstexpr |
sampling limit for SampleNTT (in bytes), see FIPS 204, Apx B
Definition at line 48 of file kyber_constants.h.
|
staticconstexpr |
Definition at line 43 of file kyber_constants.h.
Referenced by Botan::Kyber_KEM_Decryptor::decapsulate(), Botan::Expanded_Keypair_Codec::decode_keypair(), Botan::Seed_Expanding_Keypair_Codec::decode_keypair(), Botan::Kyber_KEM_Encryptor::encapsulate(), Botan::ML_KEM_Encryptor::encapsulate(), Botan::Kyber_PrivateKey::Kyber_PrivateKey(), KyberConstants(), public_key_bytes(), and Botan::Kyber_Algos::sample_matrix().
|
staticconstexpr |
Definition at line 45 of file kyber_constants.h.
Referenced by shared_key_bytes().