|
Botan 3.14.1
Crypto and TLS for C&
|
#include <kyber_90s.h>
Public Member Functions | |
| std::pair< KyberSharedSecret, KyberEncryptionRandomness > | G (StrongSpan< const KyberMessage > msg, StrongSpan< const KyberHashedPublicKey > pubkey_hash) const |
| std::pair< KyberSeedRho, KyberSeedSigma > | G (StrongSpan< const KyberSeedRandomness > seed, const KyberConstants &mode) const |
| KyberHashedCiphertext | H (StrongSpan< const KyberCompressedCiphertext > r) const |
| KyberMessage | H (StrongSpan< const KyberMessage > m) const |
| KyberHashedPublicKey | H (StrongSpan< const KyberSerializedPublicKey > pk) const |
| KyberSharedSecret | J (StrongSpan< const KyberImplicitRejectionValue > rejection_value, StrongSpan< const KyberCompressedCiphertext > ciphertext) const |
| void | KDF (StrongSpan< KyberSharedSecret > out, StrongSpan< const KyberSharedSecret > shared_secret, StrongSpan< const KyberHashedCiphertext > hashed_ciphertext) const |
| KyberSamplingRandomness | PRF (KyberSigmaOrEncryptionRandomness seed, const uint8_t nonce, const size_t outlen) const |
| void | PRF_batch (std::span< const StrongSpan< KyberSamplingRandomness > > outputs, std::span< const uint8_t > seed, uint8_t first_nonce) const |
| void | setup_PRF (std::unique_ptr< Botan::XOF > &xof, std::span< const uint8_t > seed, uint8_t nonce) const |
| Setup a seeded PRF XOF for polynomial sampling. | |
| void | setup_XOF (std::unique_ptr< Botan::XOF > &xof, StrongSpan< const KyberSeedRho > seed, std::tuple< uint8_t, uint8_t > matrix_position) const |
| Setup an XOF object for matrix sampling. | |
| virtual void | XOF_batch (std::span< std::span< uint8_t > > outputs, StrongSpan< const KyberSeedRho > seed, std::span< const std::tuple< uint8_t, uint8_t > > positions) const |
Protected Member Functions | |
| std::unique_ptr< HashFunction > | create_G () const override |
| std::unique_ptr< HashFunction > | create_H () const override |
| std::unique_ptr< HashFunction > | create_J () const override |
| std::unique_ptr< HashFunction > | create_KDF () const override |
| std::unique_ptr< Botan::XOF > | create_PRF (std::span< const uint8_t > seed, const uint8_t nonce) const override |
| std::unique_ptr< Botan::XOF > | create_XOF (std::span< const uint8_t > seed, std::tuple< uint8_t, uint8_t > mpos) const override |
| void | init_PRF (Botan::XOF &xof, std::span< const uint8_t > seed, const uint8_t nonce) const override |
| void | init_XOF (Botan::XOF &xof, std::span< const uint8_t > seed, std::tuple< uint8_t, uint8_t > mpos) const override |
| std::optional< std::array< uint8_t, 1 > > | seed_expansion_domain_separator (const KyberConstants &) const override |
Static Protected Member Functions | |
| static void | shake_XOF_batch (std::span< std::span< uint8_t > > outputs, StrongSpan< const KyberSeedRho > seed, std::span< const std::tuple< uint8_t, uint8_t > > positions) |
Definition at line 23 of file kyber_90s.h.
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 30 of file kyber_90s.h.
References Botan::HashFunction::create_or_throw().
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 32 of file kyber_90s.h.
References Botan::HashFunction::create_or_throw().
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 34 of file kyber_90s.h.
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 38 of file kyber_90s.h.
References Botan::HashFunction::create_or_throw().
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 40 of file kyber_90s.h.
References init_PRF().
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 51 of file kyber_90s.h.
References init_XOF().
|
inlineinherited |
Definition at line 55 of file kyber_symmetric_primitives.h.
|
inlineinherited |
Definition at line 46 of file kyber_symmetric_primitives.h.
References seed_expansion_domain_separator().
Referenced by Botan::Kyber_KEM_Decryptor::decapsulate(), Botan::ML_KEM_Decryptor::decapsulate(), and Botan::Kyber_Algos::expand_keypair().
|
inlineinherited |
Definition at line 38 of file kyber_symmetric_primitives.h.
References create_H().
|
inlineinherited |
Definition at line 35 of file kyber_symmetric_primitives.h.
References create_H().
|
inlineinherited |
Definition at line 42 of file kyber_symmetric_primitives.h.
References create_H().
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 46 of file kyber_90s.h.
References Botan::XOF::clear().
Referenced by create_PRF().
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 58 of file kyber_90s.h.
References Botan::XOF::clear().
Referenced by create_XOF().
|
inlineinherited |
Definition at line 60 of file kyber_symmetric_primitives.h.
References create_J().
|
inlineinherited |
Definition at line 69 of file kyber_symmetric_primitives.h.
References create_KDF().
|
inlineinherited |
Definition at line 78 of file kyber_symmetric_primitives.h.
References create_PRF().
|
inlineinherited |
Batched variant of setup_PRF + output using consecutive nonces. All outputs are equally sized.
Each PRF output fits in a single Keccak block, so a multi-buffer hash engine (whose setup is bound to the per-operation seed) cannot amortize its creation cost here and scalar XOFs are used.
Definition at line 125 of file kyber_symmetric_primitives.h.
References BOTAN_DEBUG_ASSERT, and setup_PRF().
|
inlineoverrideprotectedvirtual |
Implements Botan::Kyber_Symmetric_Primitives.
Definition at line 25 of file kyber_90s.h.
|
inlineinherited |
Setup a seeded PRF XOF for polynomial sampling.
Definition at line 97 of file kyber_symmetric_primitives.h.
References create_PRF(), and init_PRF().
Referenced by PRF_batch().
|
inlineinherited |
Setup an XOF object for matrix sampling.
Definition at line 86 of file kyber_symmetric_primitives.h.
References create_XOF(), and init_XOF().
Referenced by XOF_batch().
|
inlinestaticprotectedinherited |
Batch implementations for the SHAKE-based instantiations (used by the ML-KEM and Kyber round 3 specializations)
Definition at line 156 of file kyber_symmetric_primitives.h.
References BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, Botan::Hash_Engine::create_or_throw(), and Botan::fmt().
Referenced by Botan::Kyber_Modern_Symmetric_Primitives::XOF_batch(), and Botan::ML_KEM_Symmetric_Primitives::XOF_batch().
|
inlinevirtualinherited |
Batched variant of setup_XOF + output: outputs[i] receives the leading XOF output for positions[i]. All outputs are equally sized.
Reimplemented in Botan::Kyber_Modern_Symmetric_Primitives, and Botan::ML_KEM_Symmetric_Primitives.
Definition at line 107 of file kyber_symmetric_primitives.h.
References BOTAN_ASSERT_NOMSG, BOTAN_DEBUG_ASSERT, and setup_XOF().