6 #ifndef CRYPTOPP_PANAMA_H 7 #define CRYPTOPP_PANAMA_H 14 #if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) 15 # define CRYPTOPP_DISABLE_PANAMA_ASM 29 typedef word32 Stage[8];
30 CRYPTOPP_CONSTANT(STAGES = 32)
38 template <
class B = LittleEndian>
42 CRYPTOPP_CONSTANT(DIGESTSIZE = 32)
45 void TruncatedFinal(byte *hash,
size_t size);
46 CRYPTOPP_STATIC_CONSTEXPR
const char* StaticAlgorithmName() {
return B::ToEnum() ==
BIG_ENDIAN_ORDER ?
"Panama-BE" :
"Panama-LE";}
50 void HashEndianCorrectedBlock(
const word32 *data) {this->Iterate(1, data);}
51 size_t HashMultipleBlocks(
const word32 *input,
size_t length);
52 word32* StateBuf() {
return NULLPTR;}
57 template <
class T_Hash,
class T_Info = T_Hash>
61 void UncheckedSetKey(
const byte *key,
unsigned int length,
const NameValuePairs ¶ms)
63 CRYPTOPP_UNUSED(params);
65 m_key.Assign(key, length);
75 void Update(
const byte *input,
size_t length)
79 m_hash.Update(input, length);
82 void TruncatedFinal(byte *digest,
size_t digestSize)
86 m_hash.TruncatedFinal(digest, digestSize);
91 {
return m_hash.DigestSize();}
93 {
return m_hash.BlockSize();}
94 unsigned int OptimalBlockSize()
const 95 {
return m_hash.OptimalBlockSize();}
96 unsigned int OptimalDataAlignment()
const 97 {
return m_hash.OptimalDataAlignment();}
102 m_hash.Update(m_key, m_key.size());
113 template <
class B = LittleEndian>
118 PanamaMAC(
const byte *key,
unsigned int length)
119 {this->SetKey(key, length);}
127 CRYPTOPP_STATIC_CONSTEXPR
const char* StaticAlgorithmName() {
return B::ToEnum() ==
BIG_ENDIAN_ORDER ?
"Panama-BE" :
"Panama-LE";}
137 void CipherSetKey(
const NameValuePairs ¶ms,
const byte *key,
size_t length);
138 void OperateKeystream(
KeystreamOperation operation, byte *output,
const byte *input,
size_t iterationCount);
139 bool CipherIsRandomAccess()
const {
return false;}
140 void CipherResynchronize(byte *keystreamBuffer,
const byte *iv,
size_t length);
141 unsigned int GetAlignment()
const;
148 template <
class B = LittleEndian>
const char * DigestSize()
int, in bytes
Inherited by keyed algorithms with fixed key length.
Base class for additive stream ciphers.
Wirte the keystream to the output buffer, input is NULL.
Classes and functions for secure memory allocations.
unsigned int DigestSize() const
Provides the digest size of the hash.
Panama message authentication code.
MAC construction using a hermetic hash function.
const char * BlockSize()
int, in bytes
Classes for implementing stream ciphers.
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher...
Panama stream cipher operation.
Panama stream cipher information.
KeystreamOperation
Keystream operation flags.
Crypto++ library namespace.
SymmetricCipher implementation.
Base class for additive stream ciphers with SymmetricCipher interface.
Namespace containing weak and wounded algorithms.
Interface for retrieving values given their names.