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>
32 static std::unique_ptr<MessageAuthenticationCode>
33 create(
const std::string& algo_spec,
34 const std::string& provider =
"");
43 static std::unique_ptr<MessageAuthenticationCode>
44 create_or_throw(
const std::string& algo_spec,
45 const std::string& provider =
"");
50 static std::vector<std::string> providers(
const std::string& algo_spec);
67 virtual void start_msg(
const uint8_t nonce[],
size_t nonce_len);
74 template<
typename Alloc>
75 void start(
const std::vector<uint8_t, Alloc>& nonce)
77 start_msg(nonce.data(), nonce.size());
85 void start(
const uint8_t nonce[],
size_t nonce_len)
87 start_msg(nonce, nonce_len);
95 return start_msg(
nullptr, 0);
104 virtual bool verify_mac(
const uint8_t in[],
size_t length);
113 return verify_mac(in.data(), in.size());
123 return verify_mac(in.data(), in.size());
135 virtual std::string
provider()
const {
return "base"; }
virtual bool verify_mac(const std::vector< uint8_t > &in)
virtual std::string provider() const
virtual ~MessageAuthenticationCode()=default
virtual bool verify_mac(const secure_vector< uint8_t > &in)
void start(const std::vector< uint8_t, Alloc > &nonce)
void start(const uint8_t nonce[], size_t nonce_len)
virtual MessageAuthenticationCode * clone() const =0
#define BOTAN_PUBLIC_API(maj, min)
MessageAuthenticationCode MAC
std::vector< T, secure_allocator< T > > secure_vector