1 #ifndef CRYPTOPP_PANAMA_H
2 #define CRYPTOPP_PANAMA_H
7 NAMESPACE_BEGIN(CryptoPP)
15 void Iterate(
size_t count,
const word32 *p=NULL, byte *output=NULL,
const byte *input=NULL, KeystreamOperation operation=WRITE_KEYSTREAM);
18 typedef word32 Stage[8];
19 CRYPTOPP_CONSTANT(STAGES = 32)
26 template <
class B = LittleEndian>
30 CRYPTOPP_CONSTANT(DIGESTSIZE = 32)
34 static const char * StaticAlgorithmName() {
return B::ToEnum() == BIG_ENDIAN_ORDER ?
"Panama-BE" :
"Panama-LE";}
38 void HashEndianCorrectedBlock(
const word32 *data) {this->Iterate(1, data);}
39 size_t HashMultipleBlocks(
const word32 *input,
size_t length);
40 word32* StateBuf() {
return NULL;}
45 template <
class T_Hash,
class T_Info = T_Hash>
49 void UncheckedSetKey(
const byte *key,
unsigned int length,
const NameValuePairs ¶ms)
61 void Update(
const byte *input,
size_t length)
65 m_hash.Update(input, length);
72 m_hash.TruncatedFinal(digest, digestSize);
77 {
return m_hash.DigestSize();}
79 {
return m_hash.BlockSize();}
81 {
return m_hash.OptimalBlockSize();}
83 {
return m_hash.OptimalDataAlignment();}
88 m_hash.Update(m_key, m_key.size());
99 template <
class B = LittleEndian>
104 PanamaMAC(
const byte *key,
unsigned int length)
105 {this->
SetKey(key, length);}
113 static const char * StaticAlgorithmName() {
return B::ToEnum() == BIG_ENDIAN_ORDER ?
"Panama-BE" :
"Panama-LE";}
123 void CipherSetKey(
const NameValuePairs ¶ms,
const byte *key,
size_t length);
124 void OperateKeystream(KeystreamOperation operation, byte *output,
const byte *input,
size_t iterationCount);
125 bool CipherIsRandomAccess()
const {
return false;}
126 void CipherResynchronize(byte *keystreamBuffer,
const byte *iv,
size_t length);
127 #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64
128 unsigned int GetAlignment()
const;
135 template <
class B = LittleEndian>