8#ifndef BOTAN_MESSAGE_AUTH_CODE_BASE_H_
9#define BOTAN_MESSAGE_AUTH_CODE_BASE_H_
11#include <botan/buf_comp.h>
12#include <botan/sym_algo.h>
33 static std::unique_ptr<MessageAuthenticationCode>
34 create(std::string_view algo_spec,
35 std::string_view provider =
"");
44 static std::unique_ptr<MessageAuthenticationCode>
45 create_or_throw(std::string_view algo_spec,
46 std::string_view provider =
"");
51 static std::vector<std::string> providers(std::string_view algo_spec);
68 void start(std::span<const uint8_t> nonce)
70 start_msg(nonce.data(), nonce.size());
78 void start(
const uint8_t nonce[],
size_t nonce_len)
80 start_msg(nonce, nonce_len);
88 return start_msg(
nullptr, 0);
99 return verify_mac_result(in, length);
109 return verify_mac_result(in.data(), in.size());
115 virtual std::unique_ptr<MessageAuthenticationCode>
new_object()
const = 0;
122 return this->new_object().release();
129 virtual std::string
provider()
const {
return "base"; }
146 virtual void start_msg(
const uint8_t nonce[],
size_t nonce_len);
151 virtual bool verify_mac_result(
const uint8_t in[],
size_t length);
bool verify_mac(std::span< const uint8_t > in)
virtual bool fresh_key_required_per_message() const
virtual std::unique_ptr< MessageAuthenticationCode > new_object() const =0
virtual std::string provider() const
virtual ~MessageAuthenticationCode()=default
bool verify_mac(const uint8_t in[], size_t length)
void start(std::span< const uint8_t > nonce)
MessageAuthenticationCode * clone() const
void start(const uint8_t nonce[], size_t nonce_len)
#define BOTAN_PUBLIC_API(maj, min)
MessageAuthenticationCode MAC