Botan 3.14.1
Crypto and TLS for C&
Botan::Kyber_PrivateKeyInternal Class Referencefinal

#include <kyber_keys.h>

Public Member Functions

void _const_time_poison () const
void _const_time_unpoison () const
KyberMessage indcpa_decrypt (StrongSpan< const KyberCompressedCiphertext > ct) const
 Kyber_PrivateKeyInternal ()=delete
 Kyber_PrivateKeyInternal (KyberConstants mode, KyberPolyVecNTT s, KyberPrivateKeySeed seed)
const KyberConstants & mode () const
const KyberPolyVecNTT & s () const
const KyberPrivateKeySeed & seed () const
const KyberImplicitRejectionValue & z () const

Detailed Description

Definition at line 105 of file kyber_keys.h.

Constructor & Destructor Documentation

◆ Kyber_PrivateKeyInternal() [1/2]

Botan::Kyber_PrivateKeyInternal::Kyber_PrivateKeyInternal ( KyberConstants mode,
KyberPolyVecNTT s,
KyberPrivateKeySeed seed )
inline

Definition at line 107 of file kyber_keys.h.

107 :
108 m_mode(std::move(mode)), m_s(std::move(s)), m_seed(std::move(seed)) {}
const KyberConstants & mode() const
Definition kyber_keys.h:118
const KyberPrivateKeySeed & seed() const
Definition kyber_keys.h:114
const KyberPolyVecNTT & s() const
Definition kyber_keys.h:112

References mode(), s(), and seed().

◆ Kyber_PrivateKeyInternal() [2/2]

Botan::Kyber_PrivateKeyInternal::Kyber_PrivateKeyInternal ( )
delete

Member Function Documentation

◆ _const_time_poison()

void Botan::Kyber_PrivateKeyInternal::_const_time_poison ( ) const
inline

Definition at line 122 of file kyber_keys.h.

122{ CT::poison_all(m_s, m_seed.d, m_seed.z); }
constexpr void poison_all(const Ts &... ts)
Definition ct_utils.h:201

References Botan::CT::poison_all().

◆ _const_time_unpoison()

void Botan::Kyber_PrivateKeyInternal::_const_time_unpoison ( ) const
inline

Definition at line 124 of file kyber_keys.h.

124{ CT::unpoison_all(m_s, m_seed.d, m_seed.z); }
constexpr void unpoison_all(const Ts &... ts)
Definition ct_utils.h:207

References Botan::CT::unpoison_all().

◆ indcpa_decrypt()

KyberMessage Botan::Kyber_PrivateKeyInternal::indcpa_decrypt ( StrongSpan< const KyberCompressedCiphertext > ct) const

NIST FIPS 203, Algorithm 15 (K-PKE.Decrypt)

s^T is already decoded and available as a member variable. This allows to reuse the structure for multiple decryptions.

Definition at line 325 of file kyber_keys.cpp.

325 {
326 auto [u, v] = Kyber_Algos::decompress_ciphertext(ct, m_mode);
327 v -= inverse_ntt(m_s * ntt(std::move(u)));
328 v.reduce();
330}
BOTAN_FN_ISA_AVX2 void inverse_ntt(std::span< int16_t, 256 > p)
BOTAN_FN_ISA_AVX2 void ntt(std::span< int16_t, 256 > p)
KyberMessage polynomial_to_message(const KyberPoly &p)
std::pair< KyberPolyVec, KyberPoly > decompress_ciphertext(StrongSpan< const KyberCompressedCiphertext > ct, const KyberConstants &mode)

References Botan::Kyber_Algos::decompress_ciphertext(), and Botan::Kyber_Algos::polynomial_to_message().

◆ mode()

const KyberConstants & Botan::Kyber_PrivateKeyInternal::mode ( ) const
inline

Definition at line 118 of file kyber_keys.h.

118{ return m_mode; }

Referenced by Kyber_PrivateKeyInternal().

◆ s()

const KyberPolyVecNTT & Botan::Kyber_PrivateKeyInternal::s ( ) const
inline

Definition at line 112 of file kyber_keys.h.

112{ return m_s; }

Referenced by Kyber_PrivateKeyInternal().

◆ seed()

const KyberPrivateKeySeed & Botan::Kyber_PrivateKeyInternal::seed ( ) const
inline

Definition at line 114 of file kyber_keys.h.

114{ return m_seed; }

Referenced by Kyber_PrivateKeyInternal().

◆ z()

const KyberImplicitRejectionValue & Botan::Kyber_PrivateKeyInternal::z ( ) const
inline

Definition at line 116 of file kyber_keys.h.

116{ return m_seed.z; }

The documentation for this class was generated from the following files: