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>
31 static std::unique_ptr<MessageAuthenticationCode>
32 create(
const std::string& algo_spec,
33 const std::string& provider =
"");
42 static std::unique_ptr<MessageAuthenticationCode>
43 create_or_throw(
const std::string& algo_spec,
44 const std::string& provider =
"");
49 static std::vector<std::string> providers(
const std::string& algo_spec);
66 virtual void start_msg(
const uint8_t nonce[],
size_t nonce_len)
78 template<
typename Alloc>
79 void start(
const std::vector<uint8_t, Alloc>& nonce)
81 start_msg(nonce.data(), nonce.size());
89 void start(
const uint8_t nonce[],
size_t nonce_len)
91 start_msg(nonce, nonce_len);
99 return start_msg(
nullptr, 0);
108 virtual bool verify_mac(
const uint8_t in[],
size_t length);
117 return verify_mac(in.data(), in.size());
127 return verify_mac(in.data(), in.size());
139 virtual std::string
provider()
const {
return "base"; }
MessageAuthenticationCode MAC
virtual std::string provider() const
std::vector< T, secure_allocator< T >> secure_vector
virtual void start_msg(const uint8_t nonce[], size_t nonce_len)
virtual bool verify_mac(const std::vector< uint8_t > &in)
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)