12#ifndef BOTAN_KYBER_INTERNAL_KEYS_H_
13#define BOTAN_KYBER_INTERNAL_KEYS_H_
15#include <botan/internal/ct_utils.h>
16#include <botan/internal/kyber_algos.h>
17#include <botan/internal/kyber_constants.h>
18#include <botan/internal/kyber_types.h>
84 m_mode(std::move(
mode)), m_s(std::move(
s)), m_seed(std::move(
seed)) {}
Codec for expanded private keys (as specified in FIPS 203)
secure_vector< uint8_t > encode_keypair(KyberInternalKeypair private_key) const override
KyberInternalKeypair decode_keypair(std::span< const uint8_t > buffer, KyberConstants mode) const override
virtual secure_vector< uint8_t > encode_keypair(KyberInternalKeypair keypair) const =0
virtual KyberInternalKeypair decode_keypair(std::span< const uint8_t > private_key, KyberConstants mode) const =0
virtual ~Kyber_Keypair_Codec()=default
KyberMessage indcpa_decrypt(StrongSpan< const KyberCompressedCiphertext > ct) const
const KyberConstants & mode() const
void _const_time_poison() const
const KyberPrivateKeySeed & seed() const
Kyber_PrivateKeyInternal(KyberConstants mode, KyberPolyVecNTT s, KyberPrivateKeySeed seed)
const KyberPolyVecNTT & s() const
Kyber_PrivateKeyInternal()=delete
const KyberImplicitRejectionValue & z() const
void _const_time_unpoison() const
Kyber_PublicKeyInternal(KyberConstants mode, KyberSerializedPublicKey public_key)
const KyberHashedPublicKey & H_public_key_bits_raw() const
const KyberPolyVecNTT & t() const
KyberCompressedCiphertext indcpa_encrypt(const KyberMessage &m, const KyberEncryptionRandomness &r, const KyberPolyMat &At) const
const KyberSeedRho & rho() const
void indcpa_encrypt(StrongSpan< KyberCompressedCiphertext > out_ct, StrongSpan< const KyberMessage > m, StrongSpan< const KyberEncryptionRandomness > r, const KyberPolyMat &At) const
const KyberConstants & mode() const
const KyberSerializedPublicKey & public_key_bits_raw() const
Kyber_PublicKeyInternal()=delete
Codec for private keys as 64-byte seeds: d || z.
KyberInternalKeypair decode_keypair(std::span< const uint8_t > buffer, KyberConstants mode) const override
secure_vector< uint8_t > encode_keypair(KyberInternalKeypair keypair) const override
constexpr void unpoison_all(Ts &&... ts)
constexpr void poison_all(Ts &&... ts)
Strong< secure_vector< uint8_t >, struct KyberImplicitRejectionValue_ > KyberImplicitRejectionValue
Secret random value (called Z in the spec), used for implicit rejection in the decapsulation.
Strong< secure_vector< uint8_t >, struct KyberEncryptionRandomness_ > KyberEncryptionRandomness
Random value used to generate the Kyber ciphertext.
Strong< secure_vector< uint8_t >, struct KyberMessage_ > KyberMessage
Random message value to be encrypted by the CPA-secure Kyber encryption scheme.
Botan::CRYSTALS::PolynomialVector< KyberPolyTraits, Botan::CRYSTALS::Domain::NTT > KyberPolyVecNTT
Strong< std::vector< uint8_t >, struct KyberSeedRho_ > KyberSeedRho
Public seed value to generate the Kyber matrix A.
std::pair< std::shared_ptr< Kyber_PublicKeyInternal >, std::shared_ptr< Kyber_PrivateKeyInternal > > KyberInternalKeypair
std::vector< T, secure_allocator< T > > secure_vector
Strong< std::vector< uint8_t >, struct KyberCompressedCiphertext_ > KyberCompressedCiphertext
Compressed and serialized ciphertext value.
Botan::CRYSTALS::PolynomialMatrix< KyberPolyTraits > KyberPolyMat
Strong< std::vector< uint8_t >, struct KyberHashedPublicKey_ > KyberHashedPublicKey
Hash value of the serialized public key.
Strong< std::vector< uint8_t >, struct KyberSerializedPublicKey_ > KyberSerializedPublicKey
Public key in serialized form (t || rho)