9#ifndef BOTAN_KYBER_KEY_ENCAPSULATION_BASE_H_
10#define BOTAN_KYBER_KEY_ENCAPSULATION_BASE_H_
12#include <botan/internal/kyber_constants.h>
13#include <botan/internal/kyber_keys.h>
14#include <botan/internal/pk_ops_impl.h>
21 m_At(Kyber_Algos::sample_matrix(pk.
rho(), true , pk.mode())) {}
40 std::span<uint8_t> out_shared_key,
65 void raw_kem_decrypt(std::span<uint8_t> out_shared_key, std::span<const uint8_t> encapsulated_key)
final {
constexpr size_t shared_key_bytes() const
byte length of the shared key
size_t ciphertext_bytes() const
byte length of an encoded ciphertext
size_t raw_kem_shared_key_length() const override
virtual const KyberConstants & mode() const =0
size_t encapsulated_key_length() const override
void raw_kem_decrypt(std::span< uint8_t > out_shared_key, std::span< const uint8_t > encapsulated_key) final
Kyber_KEM_Decryptor_Base(std::string_view kdf, const Kyber_PublicKeyInternal &pk)
virtual void decapsulate(StrongSpan< KyberSharedSecret > out_shared_key, StrongSpan< const KyberCompressedCiphertext > encapsulated_key)=0
virtual void encapsulate(StrongSpan< KyberCompressedCiphertext > out_encapsulated_key, StrongSpan< KyberSharedSecret > out_shared_key, RandomNumberGenerator &rng)=0
void raw_kem_encrypt(std::span< uint8_t > out_encapsulated_key, std::span< uint8_t > out_shared_key, RandomNumberGenerator &rng) final
size_t encapsulated_key_length() const override
virtual const KyberConstants & mode() const =0
size_t raw_kem_shared_key_length() const override
Kyber_KEM_Encryptor_Base(std::string_view kdf, const Kyber_PublicKeyInternal &pk)
Kyber_KEM_Operation_Base(const Kyber_PublicKeyInternal &pk)
const KyberPolyMat & precomputed_matrix_At() const
KEM_Decryption_with_KDF(std::string_view kdf)
KEM_Encryption_with_KDF(std::string_view kdf)