Botan 3.6.1
Crypto and TLS for C&
poly1305.h
Go to the documentation of this file.
1/*
2* Poly1305
3* (C) 2014 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_MAC_POLY1305_H_
9#define BOTAN_MAC_POLY1305_H_
10
11#include <botan/mac.h>
12#include <botan/internal/alignment_buffer.h>
13#include <memory>
14
15namespace Botan {
16
17/**
18* DJB's Poly1305
19* Important note: each key can only be used once
20*/
22 public:
23 std::string name() const override { return "Poly1305"; }
24
25 std::unique_ptr<MessageAuthenticationCode> new_object() const override { return std::make_unique<Poly1305>(); }
26
27 void clear() override;
28
29 size_t output_length() const override { return 16; }
30
32
33 bool fresh_key_required_per_message() const override { return true; }
34
35 bool has_keying_material() const override;
36
37 private:
38 void add_data(std::span<const uint8_t>) override;
39 void final_result(std::span<uint8_t>) override;
40 void key_schedule(std::span<const uint8_t>) override;
41
44};
45
46} // namespace Botan
47
48#endif
Alignment buffer helper.
void clear() override
Definition poly1305.cpp:165
std::string name() const override
Definition poly1305.h:23
Key_Length_Specification key_spec() const override
Definition poly1305.h:31
size_t output_length() const override
Definition poly1305.h:29
bool has_keying_material() const override
Definition poly1305.cpp:170
std::unique_ptr< MessageAuthenticationCode > new_object() const override
Definition poly1305.h:25
bool fresh_key_required_per_message() const override
Definition poly1305.h:33
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61