Botan 3.10.0
Crypto and TLS for C&
ascon_xof128.h
Go to the documentation of this file.
1/*
2 * Ascon-XOF128 (NIST SP.800-232 Section 5.2)
3 *
4 * (C) 2025 Jack Lloyd
5 * 2025 René Meusel
6 *
7 * Botan is released under the Simplified BSD License (see license.txt)
8 */
9
10#ifndef BOTAN_ASCON_XOF128_H_
11#define BOTAN_ASCON_XOF128_H_
12
13#include <botan/xof.h>
14#include <botan/internal/ascon_perm.h>
15
16namespace Botan {
17
18/**
19* Ascon-XOF128 (NIST SP.800-232 Section 5.2)
20*/
21class Ascon_XOF128 final : public XOF {
22 public:
24
25 std::string name() const override { return "Ascon-XOF128"; }
26
27 std::string provider() const override { return m_ascon_p.provider(); }
28
29 size_t block_size() const override { return m_ascon_p.byte_rate(); }
30
31 bool accepts_input() const override { return !m_output_generated; }
32
33 std::unique_ptr<XOF> copy_state() const override;
34 std::unique_ptr<XOF> new_object() const override;
35
36 private:
37 void add_data(std::span<const uint8_t> input) override;
38 void generate_bytes(std::span<uint8_t> output) override;
39 void reset() override;
40
41 private:
42 Ascon_p m_ascon_p;
43 bool m_output_generated = false;
44};
45
46} // namespace Botan
47
48#endif
std::string name() const override
size_t block_size() const override
std::string provider() const override
std::unique_ptr< XOF > copy_state() const override
bool accepts_input() const override
std::unique_ptr< XOF > new_object() const override
std::array< uint8_t, count > output()
Definition xof.h:163