32 {
return GetBlockCipher().AlgorithmName() + std::string(
"/GCM");}
34 {
return GetBlockCipher().MinKeyLength();}
36 {
return GetBlockCipher().MaxKeyLength();}
38 {
return GetBlockCipher().DefaultKeyLength();}
40 {
return GetBlockCipher().GetValidKeyLength(n);}
42 {
return GetBlockCipher().IsValidKeyLength(n);}
55 {
return (
W64LIT(1)<<61)-1;}
57 {
return ((
W64LIT(1)<<39)-256)/8;}
64 {
return HASH_BLOCKSIZE;}
80 inline void ReverseHashBufferIfNeeded();
85 void IncrementCounterBy256();
91 enum {REQUIRED_BLOCKSIZE = 16, HASH_BLOCKSIZE = 16};
100 template <
class T_BlockCipher, GCM_TablesOption T_TablesOption,
bool T_IsEncryption>
105 {
return T_BlockCipher::StaticAlgorithmName() + std::string(
"/GCM");}
107 {
return T_IsEncryption;}
123 template <
class T_BlockCipher, GCM_TablesOption T_TablesOption=GCM_2K_Tables>
GCM block cipher base implementation.
BlockCipher & AccessBlockCipher()
unsigned int MaxIVLength() const
Provides the maximum size of an IV.
Use a table with 2K entries.
const BlockCipher & GetBlockCipher() const
unsigned int MinIVLength() const
Provides the minimum size of an IV.
Class file for modes of operation.
T_BlockCipher::Encryption m_cipher
lword MaxHeaderLength() const
Provides the maximum length of AAD that can be input.
size_t MinKeyLength() const
Returns smallest valid key length.
GCM_Final< T_BlockCipher, T_TablesOption, false > Decryption
#define NAMESPACE_BEGIN(x)
virtual void AuthenticateLastHeaderBlock()=0
Provides Encryption and Decryption typedefs used by derived classes to implement an authenticated enc...
unsigned int AuthenticationBlockSize() const
virtual void SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms)=0
GCM_Final< T_BlockCipher, T_TablesOption, true > Encryption
Interface for one direction (encryption or decryption) of a block cipher.
Use a table with 64K entries.
virtual size_t AuthenticateBlocks(const byte *data, size_t len)=0
virtual void AuthenticateLastFooterBlock(byte *mac, size_t macSize)=0
unsigned int DigestSize() const
Provides the digest size of the hash.
Interface for one direction (encryption or decryption) of a stream cipher or cipher mode...
GCM block cipher mode of operation.
Base implementation for one direction (encryption or decryption) of a stream cipher or block cipher m...
size_t MaxKeyLength() const
Returns largest valid key length.
size_t DefaultKeyLength() const
Returns default key length.
bool IsForwardTransformation() const
Determines if the cipher is being operated in its forward direction.
lword MaxMessageLength() const
Provides the maximum length of encrypted data.
#define CRYPTOPP_NO_VTABLE
size_t GetValidKeyLength(size_t n) const
Returns a valid key length for the algorithm.
IV_Requirement
Secure IVs requirements as enumerated values.
virtual void AuthenticateLastConfidentialBlock()
GCM_TablesOption
GCM table size options.
GCM_TablesOption GetTablesOption() const
std::string AlgorithmName() const
Provides the name of this algorithm.
IV_Requirement IVRequirement() const
Minimal requirement for secure IVs.
SymmetricCipher & AccessSymmetricCipher()
static std::string StaticAlgorithmName()
GCM block cipher final implementation.
unsigned int IVSize() const
Returns length of the IV accepted by this object.
virtual void Resync(const byte *iv, size_t len)=0
bool IsValidKeyLength(size_t n) const
Returns whether keylength is a valid key length.
static volatile bool s_reductionTableInitialized
Base classes for working with authenticated encryption modes of encryption.
bool AuthenticationIsOnPlaintext() const
Interface for retrieving values given their names.