Botan 3.4.0
Crypto and TLS for C&
kyber_symmetric_primitives.h
Go to the documentation of this file.
1/*
2 * Symmetric primitives for Kyber (modern)
3 * (C) 2022 Jack Lloyd
4 * (C) 2022 Hannes Rantzsch, René Meusel, neXenio GmbH
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 */
8
9#ifndef BOTAN_KYBER_SYMMETRIC_PRIMITIVES_H_
10#define BOTAN_KYBER_SYMMETRIC_PRIMITIVES_H_
11
12#include <botan/hash.h>
13#include <botan/secmem.h>
14
15#include <memory>
16#include <span>
17#include <tuple>
18#include <vector>
19
20namespace Botan {
21
22class XOF;
23
24/**
25 * Adapter class that uses polymorphy to distinguish
26 * Kyber "modern" from Kyber "90s" modes.
27 */
29 public:
30 virtual ~Kyber_Symmetric_Primitives() = default;
31
32 virtual std::unique_ptr<HashFunction> G() const = 0;
33 virtual std::unique_ptr<HashFunction> H() const = 0;
34 virtual std::unique_ptr<HashFunction> KDF() const = 0;
35
36 virtual Botan::XOF& XOF(std::span<const uint8_t> seed, std::tuple<uint8_t, uint8_t> matrix_position) const = 0;
37
38 virtual secure_vector<uint8_t> PRF(std::span<const uint8_t> seed, uint8_t nonce, size_t outlen) const = 0;
39};
40
41} // namespace Botan
42
43#endif
virtual ~Kyber_Symmetric_Primitives()=default
virtual secure_vector< uint8_t > PRF(std::span< const uint8_t > seed, uint8_t nonce, size_t outlen) const =0
virtual Botan::XOF & XOF(std::span< const uint8_t > seed, std::tuple< uint8_t, uint8_t > matrix_position) const =0
virtual std::unique_ptr< HashFunction > KDF() const =0
virtual std::unique_ptr< HashFunction > H() const =0
virtual std::unique_ptr< HashFunction > G() const =0
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61