Crypto++
5.6.4
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
6 #ifndef CRYPTOPP_VMAC_H
7 #define CRYPTOPP_VMAC_H
14 # define CRYPTOPP_DISABLE_VMAC_ASM
25 unsigned int IVSize()
const {
return GetCipher().BlockSize();}
27 void Resynchronize(
const byte *nonce,
int length=-1);
29 unsigned int DigestSize()
const {
return m_is128 ? 16 : 8;};
30 void UncheckedSetKey(
const byte *userKey,
unsigned int keylength,
const NameValuePairs ¶ms);
31 void TruncatedFinal(
byte *mac,
size_t size);
32 unsigned int BlockSize()
const {
return m_L1KeyLength;}
34 unsigned int OptimalDataAlignment()
const;
38 virtual int DefaultDigestSize()
const =0;
40 void HashEndianCorrectedBlock(
const word64 *data);
41 size_t HashMultipleBlocks(
const word64 *input,
size_t length);
43 word64* StateBuf() {
return NULL;}
44 word64* DataBuf() {
return (word64 *)(
void*)m_data();}
46 void VHASH_Update_SSE2(
const word64 *data,
size_t blocksRemainingInWord64,
int tagPart);
47 #if !(defined(_MSC_VER) && _MSC_VER < 1300) // can't use function template here with VC6
48 template <
bool T_128BitTag>
50 void VHASH_Update_Template(
const word64 *data,
size_t blockRemainingInWord128);
51 void VHASH_Update(
const word64 *data,
size_t blocksRemainingInWord128);
53 CRYPTOPP_BLOCK_1(polyState, word64, 4*(m_is128+1))
54 CRYPTOPP_BLOCK_2(nhKey, word64, m_L1KeyLength/sizeof(word64) + 2*m_is128)
55 CRYPTOPP_BLOCK_3(data,
byte, m_L1KeyLength)
56 CRYPTOPP_BLOCK_4(l3Key, word64, 2*(m_is128+1))
57 CRYPTOPP_BLOCK_5(nonce,
byte, IVSize())
58 CRYPTOPP_BLOCK_6(pad,
byte, IVSize())
59 CRYPTOPP_BLOCKS_END(6)
61 bool m_is128, m_padCached, m_isFirstBlock;
75 template <class T_BlockCipher,
int T_DigestBitSize = 128>
79 static std::string StaticAlgorithmName() {
return std::string(
"VMAC(") + T_BlockCipher::StaticAlgorithmName() +
")-" +
IntToString(T_DigestBitSize);}
83 int DefaultDigestSize()
const {
return T_DigestBitSize/8;}
84 typename T_BlockCipher::Encryption m_cipher;
VMAC message authentication code base class.
Provides a base implementation of SimpleKeyingInterface.
Interface for algorithms that take byte strings as keys.
const char * DigestSize()
int, in bytes
@ LITTLE_ENDIAN_ORDER
byte order is little-endian
unsigned int DigestSize() const
Provides the digest size of the hash.
std::string AlgorithmName() const
Provides the name of this algorithm.
unsigned int BlockSize() const
Provides the block size of the compression function.
Interface for random number generators.
const char * IV()
ConstByteArrayParameter, also accepts const byte * for backwards compatibility.
unsigned int IVSize() const
Returns length of the IV accepted by this object.
Provides key lengths based on another class's key length.
std::string IntToString(T value, unsigned int base=10)
Converts a value to a string.
ByteOrder
Provides the byte ordering.
Classes and functions for implementing secret key algorithms.
VMAC message authentication code.
Crypto++ library namespace.
Interface for one direction (encryption or decryption) of a block cipher.
Interface for message authentication codes.
Interface for retrieving values given their names.
Abstract base classes that provide a uniform interface to this library.
unsigned int MinIVLength() const
Provides the minimum size of an IV.