9 #include <botan/cmac.h> 10 #include <botan/ctr.h> 11 #include <botan/parsing.h> 12 #include <botan/internal/xor_buf.h> 22 SecureVector<byte> eax_prf(
byte tag,
size_t BLOCK_SIZE,
23 MessageAuthenticationCode* mac,
24 const byte in[],
size_t length)
26 for(
size_t i = 0; i != BLOCK_SIZE - 1; ++i)
29 mac->update(in, length);
39 BLOCK_SIZE(cipher->block_size()),
40 TAG_SIZE(tag_size ? tag_size / 8 : BLOCK_SIZE),
41 cipher_name(cipher->name()),
42 ctr_buf(DEFAULT_BUFFERSIZE)
81 for(
size_t i = 0; i != BLOCK_SIZE - 1; ++i)
114 void EAX_Encryption::write(
const byte input[],
size_t length)
118 size_t copied = std::min<size_t>(length,
ctr_buf.
size());
132 void EAX_Encryption::end_msg()
void set_iv(const InitializationVector &iv)
virtual void set_iv(const byte iv[], size_t iv_len)
EAX_Base(BlockCipher *cipher, size_t tag_size)
SecureVector< byte > ctr_buf
SecureVector< byte > header_mac
MessageAuthenticationCode * cmac
virtual BlockCipher * clone() const =0
std::invalid_argument Invalid_Argument
const byte * begin() const
bool valid_keylength(size_t key_len) const
bool valid_keylength(size_t length) const
void send(const byte in[], size_t length)
void set_key(const SymmetricKey &key)
void update(const byte in[], size_t length)
virtual void cipher(const byte in[], byte out[], size_t len)=0
void set_header(const byte header[], size_t header_len)
std::string to_string(u64bit n, size_t min_len)
void set_key(const SymmetricKey &key)
void xor_buf(byte out[], const byte in[], size_t length)
SecureVector< byte > nonce_mac
virtual size_t output_length() const =0