Botan 3.6.1
Crypto and TLS for C&
|
#include <ml_kem_impl.h>
Public Member Functions | |
size_t | encapsulated_key_length () const override |
void | kem_encrypt (std::span< uint8_t > out_encapsulated_key, std::span< uint8_t > out_shared_key, RandomNumberGenerator &rng, size_t desired_shared_key_len, std::span< const uint8_t > salt) final |
ML_KEM_Encryptor (std::shared_ptr< const Kyber_PublicKeyInternal > key, std::string_view kdf) | |
void | raw_kem_encrypt (std::span< uint8_t > out_encapsulated_key, std::span< uint8_t > out_shared_key, RandomNumberGenerator &rng) final |
size_t | raw_kem_shared_key_length () const override |
size_t | shared_key_length (size_t desired_shared_key_len) const final |
Protected Member Functions | |
void | encapsulate (StrongSpan< KyberCompressedCiphertext > out_encapsulated_key, StrongSpan< KyberSharedSecret > out_shared_key, RandomNumberGenerator &rng) override |
const KyberConstants & | mode () const override |
const KyberPolyMat & | precomputed_matrix_At () const |
Definition at line 24 of file ml_kem_impl.h.
|
inline |
Definition at line 26 of file ml_kem_impl.h.
|
overrideprotectedvirtual |
NIST FIPS 203, Algorithm 17 (ML-KEM.Encaps_internal), and 20 (ML-KEM.Encaps)
Generation of the random value is inlined with its usage. The public matrix A^T as well as H(pk) are precomputed and readily available.
Implements Botan::Kyber_KEM_Encryptor_Base.
Definition at line 25 of file ml_kem_impl.cpp.
References Botan::copy_mem(), Botan::Kyber_KEM_Operation_Base::precomputed_matrix_At(), Botan::RandomNumberGenerator::random_vec(), Botan::CT::scoped_poison(), Botan::KyberConstants::SEED_BYTES, and Botan::CT::unpoison_all().
|
inlineoverridevirtualinherited |
Implements Botan::PK_Ops::KEM_Encryption.
Definition at line 37 of file kyber_encaps_base.h.
References Botan::KyberConstants::ciphertext_bytes(), and Botan::Kyber_KEM_Encryptor_Base::mode().
|
finalvirtualinherited |
Implements Botan::PK_Ops::KEM_Encryption.
Definition at line 184 of file pk_ops.cpp.
References BOTAN_ARG_CHECK, BOTAN_ASSERT_EQUAL, and BOTAN_ASSERT_NOMSG.
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_KEM_Encryptor_Base.
Definition at line 34 of file ml_kem_impl.h.
|
inlineprotectedinherited |
Definition at line 23 of file kyber_encaps_base.h.
Referenced by Botan::Kyber_KEM_Decryptor::decapsulate(), Botan::ML_KEM_Decryptor::decapsulate(), Botan::Kyber_KEM_Encryptor::encapsulate(), and encapsulate().
|
inlinefinalvirtualinherited |
Implements Botan::PK_Ops::KEM_Encryption_with_KDF.
Definition at line 39 of file kyber_encaps_base.h.
References Botan::Kyber_KEM_Encryptor_Base::encapsulate().
|
inlineoverridevirtualinherited |
Implements Botan::PK_Ops::KEM_Encryption_with_KDF.
Definition at line 35 of file kyber_encaps_base.h.
References Botan::Kyber_KEM_Encryptor_Base::mode(), and Botan::KyberConstants::shared_key_bytes().
|
finalvirtualinherited |
Implements Botan::PK_Ops::KEM_Encryption.
Definition at line 176 of file pk_ops.cpp.