5 #ifndef CRYPTOPP_IMPORTS 15 blockCipher.
SetKey(userKey, keylength, params);
17 if (blockCipher.
BlockSize() != REQUIRED_BLOCKSIZE)
18 throw InvalidArgument(AlgorithmName() +
": block size of underlying block cipher is not 16");
20 m_digestSize = params.GetIntValueWithDefault(Name::DigestSize(), DefaultDigestSize());
21 if (m_digestSize % 2 > 0 || m_digestSize < 4 || m_digestSize > 16)
22 throw InvalidArgument(AlgorithmName() +
": DigestSize must be 4, 6, 8, 10, 12, 14, or 16");
24 m_buffer.Grow(2*REQUIRED_BLOCKSIZE);
71 if (headerLength < ((1<<16) - (1<<8)))
76 else if (headerLength < (
W64LIT(1)<<32))
std::string AlgorithmName() const
Provides the name of this algorithm.
An invalid argument was detected.
void Resynchronize(const byte *iv, int length=-1)
Resynchronize the cipher.
virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms=g_nullNameValuePairs)
Sets or reset the key of this object.
void SetCipherWithIV(BlockCipher &cipher, const byte *iv, int feedbackSize=0)
Exception thrown when the object is in the wrong state for the operation.
#define NAMESPACE_BEGIN(x)
AlignedSecByteBlock m_buffer
CTR_Mode_ExternalCipher::Encryption m_ctr
void AuthenticateLastHeaderBlock()
Interface for one direction (encryption or decryption) of a block cipher.
void Seek(lword position)
Seeks to a random position in the stream.
void ProcessData(byte *outString, const byte *inString, size_t length)
Apply keystream to data.
void AuthenticateLastFooterBlock(byte *mac, size_t macSize)
unsigned int m_bufferedDataLength
CCM block cipher base implementation.
#define CRYPTOPP_ASSERT(exp)
virtual BlockCipher & AccessBlockCipher()=0
size_t AuthenticateBlocks(const byte *data, size_t len)
void xorbuf(byte *buf, const byte *mask, size_t count)
Performs an XOR of a buffer with a mask.
void * memcpy(void *a, const void *b, size_t c)
lword m_totalHeaderLength
const BlockCipher & GetBlockCipher() const
void UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength)
lword m_totalMessageLength
void Resync(const byte *iv, size_t len)
void AuthenticateLastConfidentialBlock()
CCM block cipher mode of operation.
Interface for retrieving values given their names.