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
18 NAMESPACE_BEGIN(CryptoPP)
29 typedef word32 Stage[8];
30 CRYPTOPP_CONSTANT(STAGES = 32)
39 template <
class B = LittleEndian>
43 CRYPTOPP_CONSTANT(DIGESTSIZE = 32)
47 CRYPTOPP_CONSTEXPR
static const char *StaticAlgorithmName() {
return B::ToEnum() ==
BIG_ENDIAN_ORDER ?
"Panama-BE" :
"Panama-LE";}
51 void HashEndianCorrectedBlock(
const word32 *data) {this->Iterate(1, data);}
52 size_t HashMultipleBlocks(
const word32 *input,
size_t length);
53 word32* StateBuf() {
return NULL;}
59 template <
class T_Hash,
class T_Info = T_Hash>
63 void UncheckedSetKey(
const byte *key,
unsigned int length,
const NameValuePairs ¶ms)
65 CRYPTOPP_UNUSED(params);
77 void Update(
const byte *input,
size_t length)
81 m_hash.Update(input, length);
84 void TruncatedFinal(byte *digest,
size_t digestSize)
88 m_hash.TruncatedFinal(digest, digestSize);
92 unsigned int DigestSize()
const
93 {
return m_hash.DigestSize();}
94 unsigned int BlockSize()
const
95 {
return m_hash.BlockSize();}
96 unsigned int OptimalBlockSize()
const
97 {
return m_hash.OptimalBlockSize();}
98 unsigned int OptimalDataAlignment()
const
99 {
return m_hash.OptimalDataAlignment();}
104 m_hash.Update(m_key, m_key.
size());
116 template <
class B = LittleEndian>
121 PanamaMAC(
const byte *key,
unsigned int length)
122 {this->SetKey(key, length);}
131 CRYPTOPP_CONSTEXPR
static const char *StaticAlgorithmName() {
return B::ToEnum() ==
BIG_ENDIAN_ORDER ?
"Panama-BE" :
"Panama-LE";}
142 void CipherSetKey(
const NameValuePairs ¶ms,
const byte *key,
size_t length);
143 void OperateKeystream(
KeystreamOperation operation, byte *output,
const byte *input,
size_t iterationCount);
144 bool CipherIsRandomAccess()
const {
return false;}
145 void CipherResynchronize(byte *keystreamBuffer,
const byte *iv,
size_t length);
146 unsigned int GetAlignment()
const;
154 template <
class B = LittleEndian>
Inherited by keyed algorithms with fixed key length.
unsigned int DigestSize() const
Provides the digest size of the hash.
Base class for additive stream ciphers.
size_type size() const
Provides the count of elements in the SecBlock.
Wirte the keystream to the output buffer, input is NULL.
SecBlock<byte> typedef.
Classes and functions for secure memory allocations.
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
void Assign(const T *ptr, size_type len)
Set contents and size from an array.
Panama message authentication code.
MAC construction using a hermetic hash function.
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.
SymmetricCipher implementation.
Base class for additive stream ciphers with SymmetricCipher interface.
Interface for retrieving values given their names.
Base class for identifying alogorithm.