16#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_MIXED_ASM)
17# define CRYPTOPP_DISABLE_VMAC_ASM 1
27 std::string
AlgorithmName()
const {
return std::string(
"VMAC(") + GetCipher().AlgorithmName() +
")-" +
IntToString(DigestSize()*8);}
29 unsigned int IVSize()
const {
return GetCipher().BlockSize();}
31 void Resynchronize(
const byte *nonce,
int length=-1);
33 unsigned int DigestSize()
const {
return m_is128 ? 16 : 8;};
34 void UncheckedSetKey(
const byte *userKey,
unsigned int keylength,
const NameValuePairs ¶ms);
35 void TruncatedFinal(
byte *mac,
size_t size);
36 unsigned int BlockSize()
const {
return m_L1KeyLength;}
38 unsigned int OptimalDataAlignment()
const;
42 virtual int DefaultDigestSize()
const =0;
44 void HashEndianCorrectedBlock(
const word64 *data);
45 size_t HashMultipleBlocks(
const word64 *input,
size_t length);
47 word64* StateBuf() {
return NULLPTR;}
50 void VHASH_Update_SSE2(
const word64 *data,
size_t blocksRemainingInWord64,
int tagPart);
51 template <
bool T_128BitTag>
52 void VHASH_Update_Template(
const word64 *data,
size_t blockRemainingInWord128);
53 void VHASH_Update(
const word64 *data,
size_t blocksRemainingInWord128);
55 CRYPTOPP_BLOCK_1(polyState,
word64, (m_is128 ? 8 : 4))
56 CRYPTOPP_BLOCK_2(nhKey,
word64, m_L1KeyLength/sizeof(
word64) + 2*m_is128)
57 CRYPTOPP_BLOCK_3(data,
byte, m_L1KeyLength)
58 CRYPTOPP_BLOCK_4(l3Key,
word64, (m_is128 ? 4 : 2))
59 CRYPTOPP_BLOCK_5(nonce,
byte, IVSize())
60 CRYPTOPP_BLOCK_6(pad,
byte, IVSize())
61 CRYPTOPP_BLOCKS_END(6)
63 bool m_is128, m_padCached, m_isFirstBlock;
64 unsigned int m_L1KeyLength;
77template <
class T_BlockCipher,
int T_DigestBitSize = 128>
81 static std::string StaticAlgorithmName() {
return std::string(
"VMAC(") + T_BlockCipher::StaticAlgorithmName() +
")-" +
IntToString(T_DigestBitSize);}
85 int DefaultDigestSize()
const {
return T_DigestBitSize/8;}
86 typename T_BlockCipher::Encryption m_cipher;
Interface for one direction (encryption or decryption) of a block cipher.
Iterated hash base class.
Interface for message authentication codes.
Interface for retrieving values given their names.
Interface for random number generators.
Provides a base implementation of SimpleKeyingInterface.
VMAC message authentication code base class.
unsigned int BlockSize() const
Provides the block size of the compression function.
std::string AlgorithmProvider() const
Retrieve the provider of this algorithm.
std::string AlgorithmName() const
Provides the name of this algorithm.
unsigned int IVSize() const
Returns length of the IV accepted by this object.
unsigned int DigestSize() const
Provides the digest size of the hash.
unsigned int MinIVLength() const
Provides the minimum size of an IV.
VMAC message authentication code.
unsigned char byte
8-bit unsigned datatype
unsigned long long word64
64-bit unsigned datatype
Abstract base classes that provide a uniform interface to this library.
ByteOrder
Provides the byte ordering.
@ LITTLE_ENDIAN_ORDER
byte order is little-endian
Base classes for iterated hashes.
std::string IntToString(T value, unsigned int base=10)
Converts a value to a string.
Crypto++ library namespace.
Classes and functions for implementing secret key algorithms.