10#ifndef BOTAN_KYBER_MODERN_H_
11#define BOTAN_KYBER_MODERN_H_
13#include <botan/hash.h>
16#include <botan/internal/kyber_symmetric_primitives.h>
17#include <botan/internal/loadstor.h>
28 m_shake256_256(
HashFunction::create_or_throw(
"SHAKE-256(256)")),
29 m_shake128(
Botan::
XOF::create_or_throw(
"SHAKE-128")),
30 m_shake256(
Botan::
XOF::create_or_throw(
"SHAKE-256")) {}
47 m_shake256->update(seed);
52 Botan::XOF&
get_XOF(std::span<const uint8_t> seed, std::tuple<uint8_t, uint8_t> matrix_position)
const override {
54 m_shake128->update(seed);
55 m_shake128->update(
store_be(
make_uint16(std::get<0>(matrix_position), std::get<1>(matrix_position))));
60 std::unique_ptr<HashFunction> m_sha3_512;
61 std::unique_ptr<HashFunction> m_sha3_256;
62 std::unique_ptr<HashFunction> m_shake256_256;
63 std::unique_ptr<Botan::XOF> m_shake128;
64 std::unique_ptr<Botan::XOF> m_shake256;
HashFunction & get_KDF() const override
HashFunction & get_G() const override
Botan::XOF & get_PRF(std::span< const uint8_t > seed, const uint8_t nonce) const override
HashFunction & get_H() const override
Kyber_Modern_Symmetric_Primitives()
Botan::XOF & get_XOF(std::span< const uint8_t > seed, std::tuple< uint8_t, uint8_t > matrix_position) const override
std::optional< std::array< uint8_t, 1 > > seed_expansion_domain_separator(const KyberConstants &) const override
HashFunction & get_J() const override
int(* final)(unsigned char *, CTX *)
constexpr auto store_be(ParamTs &&... params)
constexpr uint16_t make_uint16(uint8_t i0, uint8_t i1)