Botan 3.13.0
Crypto and TLS for C&
blake2bmac.cpp
Go to the documentation of this file.
1/*
2* BLAKE2b MAC
3* (C) 1999-2007,2014 Jack Lloyd
4* (C) 2020 Tom Crowley
5*
6* Botan is released under the Simplified BSD License (see license.txt)
7*/
8
9#include <botan/internal/blake2bmac.h>
10
11#include <botan/exceptn.h>
12
13namespace Botan {
14
15void BLAKE2bMAC::start_msg(std::span<const uint8_t> nonce) {
16 if(!nonce.empty()) {
17 throw Invalid_IV_Length(name(), nonce.size());
18 }
20 m_blake.state_init();
21}
22
23/*
24* Clear memory of sensitive data
25*/
27 m_blake.clear();
28}
29
30/*
31* Return a new_object of this object
32*/
33std::unique_ptr<MessageAuthenticationCode> BLAKE2bMAC::new_object() const {
34 return std::make_unique<BLAKE2bMAC>(m_blake.output_length() * 8);
35}
36
37/*
38* BLAKE2bMAC Constructor
39*/
40BLAKE2bMAC::BLAKE2bMAC(size_t output_bits) : m_blake(output_bits) {}
41
42} // namespace Botan
void clear() override
std::unique_ptr< MessageAuthenticationCode > new_object() const override
std::string name() const override
Definition blake2bmac.h:24
BLAKE2bMAC(size_t output_bits=512)
void assert_key_material_set() const
Definition sym_algo.h:180