|
Botan 3.11.0
Crypto and TLS for C&
|
#include <ml_kem_impl.h>
Public Member Functions | |
| size_t | encapsulated_key_length () const override |
| void | kem_decrypt (std::span< uint8_t > out_shared_key, std::span< const uint8_t > encapsulated_key, size_t desired_shared_key_len, std::span< const uint8_t > salt) final |
| ML_KEM_Decryptor (std::shared_ptr< const Kyber_PrivateKeyInternal > private_key, std::shared_ptr< const Kyber_PublicKeyInternal > public_key, std::string_view kdf) | |
| void | raw_kem_decrypt (std::span< uint8_t > out_shared_key, std::span< const uint8_t > encapsulated_key) 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 | decapsulate (StrongSpan< KyberSharedSecret > out_shared_key, StrongSpan< const KyberCompressedCiphertext > encapsulated_key) override |
| const KyberConstants & | mode () const |
| const KyberPolyMat & | precomputed_matrix_At () const |
Definition at line 39 of file ml_kem_impl.h.
|
inline |
Definition at line 41 of file ml_kem_impl.h.
References Botan::Kyber_KEM_Decryptor_Base::Kyber_KEM_Decryptor_Base().
|
overrideprotectedvirtual |
NIST FIPS 203, Algorithm 18 (ML-KEM.Decaps_internal) and 21 (ML-KEM.Decaps)
The public and private keys are readily available as member variables and don't need to be decoded. The checks stated in FIPS 203, Section 7.3 are performed before decoding the keys and the ciphertext.
Implements Botan::Kyber_KEM_Decryptor_Base.
Definition at line 47 of file ml_kem_impl.cpp.
References BOTAN_ASSERT_NOMSG, Botan::CT::conditional_copy_mem(), Botan::StrongSpan< T >::data(), Botan::Kyber_Symmetric_Primitives::G(), Botan::CT::is_equal(), Botan::Kyber_KEM_Operation_Base::mode(), Botan::Kyber_KEM_Operation_Base::precomputed_matrix_At(), Botan::CT::scoped_poison(), Botan::StrongSpan< T >::size(), Botan::KyberConstants::symmetric_primitives(), and Botan::CT::unpoison().
|
inlineoverridevirtualinherited |
Implements Botan::PK_Ops::KEM_Decryption.
Definition at line 65 of file kyber_encaps_base.h.
References Botan::KyberConstants::ciphertext_bytes(), and Botan::Kyber_KEM_Operation_Base::mode().
|
finalvirtualinherited |
Implements Botan::PK_Ops::KEM_Decryption.
Definition at line 247 of file pk_ops.cpp.
References BOTAN_ARG_CHECK, BOTAN_ASSERT_EQUAL, raw_kem_decrypt(), and raw_kem_shared_key_length().
|
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(), Botan::ML_KEM_Encryptor::encapsulate(), Botan::Kyber_KEM_Decryptor_Base::encapsulated_key_length(), Botan::Kyber_KEM_Encryptor_Base::encapsulated_key_length(), Kyber_KEM_Operation_Base(), Botan::Kyber_KEM_Decryptor_Base::raw_kem_shared_key_length(), and Botan::Kyber_KEM_Encryptor_Base::raw_kem_shared_key_length().
|
inlineprotectedinherited |
Definition at line 25 of file kyber_encaps_base.h.
Referenced by Botan::Kyber_KEM_Decryptor::decapsulate(), Botan::ML_KEM_Decryptor::decapsulate(), Botan::Kyber_KEM_Encryptor::encapsulate(), and Botan::ML_KEM_Encryptor::encapsulate().
|
inlinefinalvirtualinherited |
Implements Botan::PK_Ops::KEM_Decryption_with_KDF.
Definition at line 67 of file kyber_encaps_base.h.
References decapsulate().
|
inlineoverridevirtualinherited |
Implements Botan::PK_Ops::KEM_Decryption_with_KDF.
Definition at line 63 of file kyber_encaps_base.h.
References Botan::Kyber_KEM_Operation_Base::mode(), and Botan::KyberConstants::shared_key_bytes().
|
finalvirtualinherited |
Implements Botan::PK_Ops::KEM_Decryption.
Definition at line 239 of file pk_ops.cpp.
References raw_kem_shared_key_length().