Botan  2.4.0
Crypto and TLS for C++11
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Botan::SipHash Class Referencefinal

#include <siphash.h>

Inheritance diagram for Botan::SipHash:
Botan::MessageAuthenticationCode Botan::Buffered_Computation Botan::SymmetricAlgorithm

Public Member Functions

void clear () override
 
MessageAuthenticationCodeclone () const override
 
void final (uint8_t out[])
 
secure_vector< uint8_t > final ()
 
template<typename Alloc >
void final (std::vector< uint8_t, Alloc > &out)
 
std::vector< uint8_t > final_stdvec ()
 
Key_Length_Specification key_spec () const override
 
size_t maximum_keylength () const
 
size_t minimum_keylength () const
 
std::string name () const override
 
size_t output_length () const override
 
secure_vector< uint8_t > process (const uint8_t in[], size_t length)
 
secure_vector< uint8_t > process (const secure_vector< uint8_t > &in)
 
secure_vector< uint8_t > process (const std::vector< uint8_t > &in)
 
secure_vector< uint8_t > process (const std::string &in)
 
virtual std::string provider () const
 
void set_key (const SymmetricKey &key)
 
template<typename Alloc >
void set_key (const std::vector< uint8_t, Alloc > &key)
 
void set_key (const uint8_t key[], size_t length)
 
 SipHash (size_t c=2, size_t d=4)
 
template<typename Alloc >
void start (const std::vector< uint8_t, Alloc > &nonce)
 
void start (const uint8_t nonce[], size_t nonce_len)
 
void start ()
 
virtual void start_msg (const uint8_t nonce[], size_t nonce_len)
 
void update (const uint8_t in[], size_t length)
 
void update (const secure_vector< uint8_t > &in)
 
void update (const std::vector< uint8_t > &in)
 
void update (const std::string &str)
 
void update (uint8_t in)
 
template<typename T >
void update_be (const T in)
 
bool valid_keylength (size_t length) const
 
virtual bool verify_mac (const uint8_t in[], size_t length)
 
virtual bool verify_mac (const std::vector< uint8_t > &in)
 
virtual bool verify_mac (const secure_vector< uint8_t > &in)
 

Static Public Member Functions

static std::unique_ptr< MessageAuthenticationCodecreate (const std::string &algo_spec, const std::string &provider="")
 
static std::unique_ptr< MessageAuthenticationCodecreate_or_throw (const std::string &algo_spec, const std::string &provider="")
 
static std::vector< std::string > providers (const std::string &algo_spec)
 

Protected Member Functions

void verify_key_set (bool cond) const
 

Detailed Description

Definition at line 15 of file siphash.h.

Constructor & Destructor Documentation

◆ SipHash()

Botan::SipHash::SipHash ( size_t  c = 2,
size_t  d = 4 
)
inline

Definition at line 18 of file siphash.h.

Referenced by clone().

18 : m_C(c), m_D(d) {}

Member Function Documentation

◆ clear()

void Botan::SipHash::clear ( )
overridevirtual

Reset the state.

Implements Botan::SymmetricAlgorithm.

Definition at line 116 of file siphash.cpp.

References Botan::zap().

117  {
118  zap(m_V);
119  m_mbuf = 0;
120  m_mbuf_pos = 0;
121  m_words = 0;
122  }
void zap(std::vector< T, Alloc > &vec)
Definition: secmem.h:191

◆ clone()

MessageAuthenticationCode * Botan::SipHash::clone ( ) const
overridevirtual

Get a new object representing the same algorithm as *this

Implements Botan::MessageAuthenticationCode.

Definition at line 129 of file siphash.cpp.

References SipHash().

130  {
131  return new SipHash(m_C, m_D);
132  }
SipHash(size_t c=2, size_t d=4)
Definition: siphash.h:18

◆ create()

std::unique_ptr< MessageAuthenticationCode > Botan::MessageAuthenticationCode::create ( const std::string &  algo_spec,
const std::string &  provider = "" 
)
staticinherited

Create an instance based on a name If provider is empty then best available is chosen.

Parameters
algo_specalgorithm name
providerprovider implementation to use
Returns
a null pointer if the algo/provider combination cannot be found

Definition at line 45 of file mac.cpp.

References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_as_integer(), Botan::SCAN_Name::arg_count(), BOTAN_UNUSED, Botan::HashFunction::create(), and Botan::BlockCipher::create().

Referenced by botan_mac_init(), Botan::PBKDF::create(), Botan::KDF::create(), Botan::MessageAuthenticationCode::create_or_throw(), Botan::TLS::Session::decrypt(), Botan::TLS::Session::encrypt(), Botan::get_mac(), Botan::TLS::Hello_Verify_Request::Hello_Verify_Request(), Botan::hkdf_expand_label(), and Botan::make_message_auth().

47  {
48  const SCAN_Name req(algo_spec);
49 
50 #if defined(BOTAN_HAS_GMAC)
51  if(req.algo_name() == "GMAC" && req.arg_count() == 1)
52  {
53  if(provider.empty() || provider == "base")
54  {
55  if(auto bc = BlockCipher::create(req.arg(0)))
56  return std::unique_ptr<MessageAuthenticationCode>(new GMAC(bc.release()));
57  }
58  }
59 #endif
60 
61 #if defined(BOTAN_HAS_HMAC)
62  if(req.algo_name() == "HMAC" && req.arg_count() == 1)
63  {
64  // TODO OpenSSL
65  if(provider.empty() || provider == "base")
66  {
67  if(auto h = HashFunction::create(req.arg(0)))
68  return std::unique_ptr<MessageAuthenticationCode>(new HMAC(h.release()));
69  }
70  }
71 #endif
72 
73 #if defined(BOTAN_HAS_POLY1305)
74  if(req.algo_name() == "Poly1305" && req.arg_count() == 0)
75  {
76  if(provider.empty() || provider == "base")
77  return std::unique_ptr<MessageAuthenticationCode>(new Poly1305);
78  }
79 #endif
80 
81 #if defined(BOTAN_HAS_SIPHASH)
82  if(req.algo_name() == "SipHash")
83  {
84  if(provider.empty() || provider == "base")
85  {
86  return std::unique_ptr<MessageAuthenticationCode>(
87  new SipHash(req.arg_as_integer(0, 2), req.arg_as_integer(1, 4)));
88  }
89  }
90 #endif
91 
92 #if defined(BOTAN_HAS_CMAC)
93  if((req.algo_name() == "CMAC" || req.algo_name() == "OMAC") && req.arg_count() == 1)
94  {
95  // TODO: OpenSSL CMAC
96  if(provider.empty() || provider == "base")
97  {
98  if(auto bc = BlockCipher::create(req.arg(0)))
99  return std::unique_ptr<MessageAuthenticationCode>(new CMAC(bc.release()));
100  }
101  }
102 #endif
103 
104 
105 #if defined(BOTAN_HAS_CBC_MAC)
106  if(req.algo_name() == "CBC-MAC" && req.arg_count() == 1)
107  {
108  if(provider.empty() || provider == "base")
109  {
110  if(auto bc = BlockCipher::create(req.arg(0)))
111  return std::unique_ptr<MessageAuthenticationCode>(new CBC_MAC(bc.release()));
112  }
113  }
114 #endif
115 
116 #if defined(BOTAN_HAS_ANSI_X919_MAC)
117  if(req.algo_name() == "X9.19-MAC")
118  {
119  if(provider.empty() || provider == "base")
120  {
121  return std::unique_ptr<MessageAuthenticationCode>(new ANSI_X919_MAC);
122  }
123  }
124 #endif
125 
126  BOTAN_UNUSED(req);
128 
129  return nullptr;
130  }
virtual std::string provider() const
Definition: mac.h:140
static std::unique_ptr< HashFunction > create(const std::string &algo_spec, const std::string &provider="")
Definition: hash.cpp:106
#define BOTAN_UNUSED(...)
Definition: assert.h:106
static std::unique_ptr< BlockCipher > create(const std::string &algo_spec, const std::string &provider="")

◆ create_or_throw()

std::unique_ptr< MessageAuthenticationCode > Botan::MessageAuthenticationCode::create_or_throw ( const std::string &  algo_spec,
const std::string &  provider = "" 
)
staticinherited

Definition at line 140 of file mac.cpp.

References Botan::MessageAuthenticationCode::create().

Referenced by Botan::AutoSeeded_RNG::AutoSeeded_RNG(), Botan::ChaCha_RNG::ChaCha_RNG(), Botan::ECIES_System_Params::create_mac(), Botan::CryptoBox::decrypt_bin(), Botan::CryptoBox::encrypt(), Botan::Encrypted_PSK_Database::Encrypted_PSK_Database(), Botan::HOTP::HOTP(), and Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::TLS_CBC_HMAC_AEAD_Mode().

142  {
143  if(auto mac = MessageAuthenticationCode::create(algo, provider))
144  {
145  return mac;
146  }
147  throw Lookup_Error("MAC", algo, provider);
148  }
static std::unique_ptr< MessageAuthenticationCode > create(const std::string &algo_spec, const std::string &provider="")
Definition: mac.cpp:45
virtual std::string provider() const
Definition: mac.h:140

◆ final() [1/3]

void Botan::Buffered_Computation::final ( uint8_t  out[])
inlineinherited

Complete the computation and retrieve the final result.

Parameters
outThe byte array to be filled with the result. Must be of length output_length()

Definition at line 89 of file buf_comp.h.

Referenced by botan_hash_final(), botan_mac_final(), Botan::ed25519_gen_keypair(), Botan::ed25519_sign(), Botan::ed25519_verify(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption::finish(), Botan::mgf1_mask(), Botan::pbkdf2(), Botan::sm2_compute_za(), and Botan::TLS_PRF::TLS_PRF().

89 { final_result(out); }

◆ final() [2/3]

secure_vector<uint8_t> Botan::Buffered_Computation::final ( )
inlineinherited

Complete the computation and retrieve the final result.

Returns
secure_vector holding the result

Definition at line 96 of file buf_comp.h.

97  {
98  secure_vector<uint8_t> output(output_length());
99  final_result(output.data());
100  return output;
101  }
virtual size_t output_length() const =0

◆ final() [3/3]

template<typename Alloc >
void Botan::Buffered_Computation::final ( std::vector< uint8_t, Alloc > &  out)
inlineinherited

Definition at line 111 of file buf_comp.h.

112  {
113  out.resize(output_length());
114  final_result(out.data());
115  }
virtual size_t output_length() const =0

◆ final_stdvec()

std::vector<uint8_t> Botan::Buffered_Computation::final_stdvec ( )
inlineinherited

Definition at line 103 of file buf_comp.h.

104  {
105  std::vector<uint8_t> output(output_length());
106  final_result(output.data());
107  return output;
108  }
virtual size_t output_length() const =0

◆ key_spec()

Key_Length_Specification Botan::SipHash::key_spec ( ) const
inlineoverridevirtual
Returns
object describing limits on key size

Implements Botan::SymmetricAlgorithm.

Definition at line 27 of file siphash.h.

28  {
29  return Key_Length_Specification(16);
30  }

◆ maximum_keylength()

size_t Botan::SymmetricAlgorithm::maximum_keylength ( ) const
inlineinherited
Returns
minimum allowed key length

Definition at line 39 of file sym_algo.h.

40  {
41  return key_spec().maximum_keylength();
42  }
size_t maximum_keylength() const
Definition: key_spec.h:69
virtual Key_Length_Specification key_spec() const =0

◆ minimum_keylength()

size_t Botan::SymmetricAlgorithm::minimum_keylength ( ) const
inlineinherited
Returns
maximum allowed key length

Definition at line 47 of file sym_algo.h.

48  {
49  return key_spec().minimum_keylength();
50  }
virtual Key_Length_Specification key_spec() const =0
size_t minimum_keylength() const
Definition: key_spec.h:61

◆ name()

std::string Botan::SipHash::name ( ) const
overridevirtual
Returns
the algorithm name

Implements Botan::SymmetricAlgorithm.

Definition at line 124 of file siphash.cpp.

References Botan::ASN1::to_string().

125  {
126  return "SipHash(" + std::to_string(m_C) + "," + std::to_string(m_D) + ")";
127  }
std::string to_string(const BER_Object &obj)
Definition: asn1_obj.cpp:108

◆ output_length()

size_t Botan::SipHash::output_length ( ) const
inlineoverridevirtual
Returns
length of the output of this function in bytes

Implements Botan::Buffered_Computation.

Definition at line 25 of file siphash.h.

25 { return 8; }

◆ process() [1/4]

secure_vector<uint8_t> Botan::Buffered_Computation::process ( const uint8_t  in[],
size_t  length 
)
inlineinherited

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters
inthe input to process as a byte array
lengththe length of the byte array
Returns
the result of the call to final()

Definition at line 124 of file buf_comp.h.

Referenced by Botan::TLS_PRF::TLS_PRF().

125  {
126  add_data(in, length);
127  return final();
128  }

◆ process() [2/4]

secure_vector<uint8_t> Botan::Buffered_Computation::process ( const secure_vector< uint8_t > &  in)
inlineinherited

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters
inthe input to process
Returns
the result of the call to final()

Definition at line 136 of file buf_comp.h.

137  {
138  add_data(in.data(), in.size());
139  return final();
140  }

◆ process() [3/4]

secure_vector<uint8_t> Botan::Buffered_Computation::process ( const std::vector< uint8_t > &  in)
inlineinherited

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters
inthe input to process
Returns
the result of the call to final()

Definition at line 148 of file buf_comp.h.

149  {
150  add_data(in.data(), in.size());
151  return final();
152  }

◆ process() [4/4]

secure_vector<uint8_t> Botan::Buffered_Computation::process ( const std::string &  in)
inlineinherited

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters
inthe input to process as a string
Returns
the result of the call to final()

Definition at line 160 of file buf_comp.h.

161  {
162  update(in);
163  return final();
164  }
void update(const uint8_t in[], size_t length)
Definition: buf_comp.h:34

◆ provider()

virtual std::string Botan::MessageAuthenticationCode::provider ( ) const
inlinevirtualinherited
Returns
provider information about this implementation. Default is "base", might also return "sse2", "avx2", "openssl", or some other arbitrary string.

Definition at line 140 of file mac.h.

140 { return "base"; }

◆ providers()

std::vector< std::string > Botan::MessageAuthenticationCode::providers ( const std::string &  algo_spec)
staticinherited
Returns
list of available providers for this algorithm, empty if not available

Definition at line 133 of file mac.cpp.

Referenced by Botan::get_mac_providers().

134  {
135  return probe_providers_of<MessageAuthenticationCode>(algo_spec, {"base", "openssl"});
136  }

◆ set_key() [1/3]

void Botan::SymmetricAlgorithm::set_key ( const SymmetricKey key)
inlineinherited

Set the symmetric key of this object.

Parameters
keythe SymmetricKey to be set.

Definition at line 66 of file sym_algo.h.

References Botan::OctetString::begin(), and Botan::OctetString::length().

Referenced by Botan::aont_package(), Botan::aont_unpackage(), botan_block_cipher_set_key(), botan_mac_set_key(), Botan::GOST_34_11::copy_state(), Botan::DESX::decrypt_n(), Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::key_spec(), Botan::pbkdf2(), and Botan::TLS_PRF::TLS_PRF().

67  {
68  set_key(key.begin(), key.length());
69  }
void set_key(const SymmetricKey &key)
Definition: sym_algo.h:66

◆ set_key() [2/3]

template<typename Alloc >
void Botan::SymmetricAlgorithm::set_key ( const std::vector< uint8_t, Alloc > &  key)
inlineinherited

Definition at line 72 of file sym_algo.h.

73  {
74  set_key(key.data(), key.size());
75  }
void set_key(const SymmetricKey &key)
Definition: sym_algo.h:66

◆ set_key() [3/3]

void Botan::SymmetricAlgorithm::set_key ( const uint8_t  key[],
size_t  length 
)
inlineinherited

Set the symmetric key of this object.

Parameters
keythe to be set as a byte array.
lengthin bytes of key param

Definition at line 82 of file sym_algo.h.

83  {
84  if(!valid_keylength(length))
85  throw Invalid_Key_Length(name(), length);
86  key_schedule(key, length);
87  }
bool valid_keylength(size_t length) const
Definition: sym_algo.h:57
virtual std::string name() const =0

◆ start() [1/3]

template<typename Alloc >
void Botan::MessageAuthenticationCode::start ( const std::vector< uint8_t, Alloc > &  nonce)
inlineinherited

Begin processing a message with a nonce

Parameters
noncethe per message nonce

Definition at line 80 of file mac.h.

81  {
82  start_msg(nonce.data(), nonce.size());
83  }
virtual void start_msg(const uint8_t nonce[], size_t nonce_len)
Definition: mac.h:67

◆ start() [2/3]

void Botan::MessageAuthenticationCode::start ( const uint8_t  nonce[],
size_t  nonce_len 
)
inlineinherited

Begin processing a message.

Parameters
noncethe per message nonce
nonce_lenlength of nonce

Definition at line 90 of file mac.h.

91  {
92  start_msg(nonce, nonce_len);
93  }
virtual void start_msg(const uint8_t nonce[], size_t nonce_len)
Definition: mac.h:67

◆ start() [3/3]

void Botan::MessageAuthenticationCode::start ( )
inlineinherited

Begin processing a message.

Definition at line 98 of file mac.h.

99  {
100  return start_msg(nullptr, 0);
101  }
virtual void start_msg(const uint8_t nonce[], size_t nonce_len)
Definition: mac.h:67

◆ start_msg()

virtual void Botan::MessageAuthenticationCode::start_msg ( const uint8_t  nonce[],
size_t  nonce_len 
)
inlinevirtualinherited

Prepare for processing a message under the specified nonce

Most MACs neither require nor support a nonce; for these algorithms calling start_msg is optional and calling it with anything other than an empty string is an error. One MAC which requires a per-message nonce be specified is GMAC.

Parameters
noncethe message nonce bytes
nonce_lenthe size of len in bytes Default implementation simply rejects all non-empty nonces since most hash/MAC algorithms do not support randomization

Definition at line 67 of file mac.h.

References BOTAN_UNUSED.

68  {
69  BOTAN_UNUSED(nonce);
70  if(nonce_len > 0)
71  throw Invalid_IV_Length(name(), nonce_len);
72  }
virtual std::string name() const =0
#define BOTAN_UNUSED(...)
Definition: assert.h:106

◆ update() [1/5]

void Botan::Buffered_Computation::update ( const uint8_t  in[],
size_t  length 
)
inlineinherited

◆ update() [2/5]

void Botan::Buffered_Computation::update ( const secure_vector< uint8_t > &  in)
inlineinherited

Add new input to process.

Parameters
inthe input to process as a secure_vector

Definition at line 40 of file buf_comp.h.

41  {
42  add_data(in.data(), in.size());
43  }

◆ update() [3/5]

void Botan::Buffered_Computation::update ( const std::vector< uint8_t > &  in)
inlineinherited

Add new input to process.

Parameters
inthe input to process as a std::vector

Definition at line 49 of file buf_comp.h.

50  {
51  add_data(in.data(), in.size());
52  }

◆ update() [4/5]

void Botan::Buffered_Computation::update ( const std::string &  str)
inlineinherited

Add new input to process.

Parameters
strthe input to process as a std::string. Will be interpreted as a byte array based on the strings encoding.

Definition at line 72 of file buf_comp.h.

References Botan::cast_char_ptr_to_uint8().

73  {
74  add_data(cast_char_ptr_to_uint8(str.data()), str.size());
75  }
const uint8_t * cast_char_ptr_to_uint8(const char *s)
Definition: mem_ops.h:120

◆ update() [5/5]

void Botan::Buffered_Computation::update ( uint8_t  in)
inlineinherited

Process a single byte.

Parameters
inthe byte to process

Definition at line 81 of file buf_comp.h.

81 { add_data(&in, 1); }

◆ update_be()

template<typename T >
void Botan::Buffered_Computation::update_be ( const T  in)
inlineinherited

Add an integer in big-endian order

Parameters
inthe value

Definition at line 58 of file buf_comp.h.

References Botan::get_byte(), and T.

Referenced by Botan::mgf1_mask(), and Botan::pbkdf2().

59  {
60  for(size_t i = 0; i != sizeof(T); ++i)
61  {
62  uint8_t b = get_byte(i, in);
63  add_data(&b, 1);
64  }
65  }
fe T
Definition: ge.cpp:37
uint8_t get_byte(size_t byte_num, T input)
Definition: loadstor.h:39

◆ valid_keylength()

bool Botan::SymmetricAlgorithm::valid_keylength ( size_t  length) const
inlineinherited

Check whether a given key length is valid for this algorithm.

Parameters
lengththe key length to be checked.
Returns
true if the key length is valid.

Definition at line 57 of file sym_algo.h.

Referenced by Botan::aont_package(), and Botan::aont_unpackage().

58  {
59  return key_spec().valid_keylength(length);
60  }
bool valid_keylength(size_t length) const
Definition: key_spec.h:51
virtual Key_Length_Specification key_spec() const =0

◆ verify_key_set()

void Botan::SymmetricAlgorithm::verify_key_set ( bool  cond) const
inlineprotectedinherited

Definition at line 95 of file sym_algo.h.

Referenced by Botan::Salsa20::cipher(), Botan::CTR_BE::cipher(), Botan::RC4::cipher(), Botan::SHAKE_128_Cipher::cipher(), Botan::ChaCha::cipher(), Botan::Poly1305::clear(), Botan::SM4::decrypt_n(), Botan::CAST_256::decrypt_n(), Botan::DES::decrypt_n(), Botan::MISTY1::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::KASUMI::decrypt_n(), Botan::IDEA::decrypt_n(), Botan::XTEA::decrypt_n(), Botan::Blowfish::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::DESX::decrypt_n(), Botan::CAST_128::decrypt_n(), Botan::Threefish_512::decrypt_n(), Botan::SEED::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::Lion::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::GOST_28147_89::decrypt_n(), Botan::CAST_128::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::CAST_256::encrypt_n(), Botan::MISTY1::encrypt_n(), Botan::Twofish::encrypt_n(), Botan::SEED::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::SM4::encrypt_n(), Botan::DES::encrypt_n(), Botan::XTEA::encrypt_n(), Botan::IDEA::encrypt_n(), Botan::DESX::encrypt_n(), Botan::Threefish_512::encrypt_n(), Botan::Blowfish::encrypt_n(), Botan::KASUMI::encrypt_n(), Botan::Serpent::encrypt_n(), Botan::Lion::encrypt_n(), Botan::TripleDES::encrypt_n(), Botan::GOST_28147_89::encrypt_n(), Botan::Salsa20::seek(), Botan::CTR_BE::seek(), Botan::ChaCha::seek(), and Botan::GHASH::update_associated_data().

96  {
97  if(cond == false)
98  throw Key_Not_Set(name());
99  }
virtual std::string name() const =0

◆ verify_mac() [1/3]

bool Botan::MessageAuthenticationCode::verify_mac ( const uint8_t  in[],
size_t  length 
)
virtualinherited

Verify a MAC.

Parameters
inthe MAC to verify as a byte array
lengththe length of param in
Returns
true if the MAC is valid, false otherwise

Definition at line 153 of file mac.cpp.

References Botan::constant_time_compare().

154  {
155  secure_vector<uint8_t> our_mac = final();
156 
157  if(our_mac.size() != length)
158  return false;
159 
160  return constant_time_compare(our_mac.data(), mac, length);
161  }
bool constant_time_compare(const uint8_t x[], const uint8_t y[], size_t len)
Definition: mem_ops.cpp:44

◆ verify_mac() [2/3]

virtual bool Botan::MessageAuthenticationCode::verify_mac ( const std::vector< uint8_t > &  in)
inlinevirtualinherited

Verify a MAC.

Parameters
inthe MAC to verify as a byte array
Returns
true if the MAC is valid, false otherwise

Definition at line 116 of file mac.h.

117  {
118  return verify_mac(in.data(), in.size());
119  }
virtual bool verify_mac(const uint8_t in[], size_t length)
Definition: mac.cpp:153

◆ verify_mac() [3/3]

virtual bool Botan::MessageAuthenticationCode::verify_mac ( const secure_vector< uint8_t > &  in)
inlinevirtualinherited

Verify a MAC.

Parameters
inthe MAC to verify as a byte array
Returns
true if the MAC is valid, false otherwise

Definition at line 126 of file mac.h.

127  {
128  return verify_mac(in.data(), in.size());
129  }
virtual bool verify_mac(const uint8_t in[], size_t length)
Definition: mac.cpp:153

The documentation for this class was generated from the following files: