8void EAX_Base::SetKeyWithoutResync(
const byte *userKey,
size_t keylength,
const NameValuePairs ¶ms)
10 AccessMAC().
SetKey(userKey, keylength, params);
11 m_buffer.New(2*AccessMAC().
TagSize());
14void EAX_Base::Resync(
const byte *iv,
size_t len)
17 unsigned int blockSize = mac.
TagSize();
19 memset(m_buffer, 0, blockSize);
20 mac.
Update(m_buffer, blockSize);
23 m_buffer[blockSize-1] = 1;
24 mac.
Update(m_buffer, blockSize);
26 m_ctr.
SetCipherWithIV(AccessMAC().AccessCipher(), m_buffer+blockSize, blockSize);
29size_t EAX_Base::AuthenticateBlocks(
const byte *data,
size_t len)
31 AccessMAC().
Update(data, len);
35void EAX_Base::AuthenticateLastHeaderBlock()
39 const unsigned int blockSize = mac.
TagSize();
42 xorbuf(m_buffer+blockSize, m_buffer, blockSize);
44 memset(m_buffer, 0, blockSize);
45 m_buffer[blockSize-1] = 2;
46 mac.
Update(m_buffer, blockSize);
49void EAX_Base::AuthenticateLastFooterBlock(
byte *tag,
size_t macSize)
53 unsigned int blockSize = mac.
TagSize();
56 xorbuf(tag, m_buffer, m_buffer+blockSize, macSize);
void Update(const byte *input, size_t length)
Updates a hash with additional input.
void SetCipherWithIV(BlockCipher &cipher, const byte *iv, int feedbackSize=0)
Set external block cipher and IV.
Interface for message authentication codes.
Interface for retrieving values given their names.
virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms=g_nullNameValuePairs)
Sets or reset the key of this object.
EAX block cipher mode of operation.
CRYPTOPP_DLL void xorbuf(byte *buf, const byte *mask, size_t count)
Performs an XOR of a buffer with a mask.
Crypto++ library namespace.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.