Crypto++
5.6.5
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
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)
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>
@ BIG_ENDIAN_ORDER
byte order is big-endian
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher.
SymmetricCipher implementation.
Base class for additive stream ciphers.
Classes and functions for secure memory allocations.
unsigned int DigestSize() const
Provides the digest size of the hash.
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
Inherited by keyed algorithms with fixed key length.
MAC construction using a hermetic hash function.
Base class for additive stream ciphers with SymmetricCipher interface.
@ WRITE_KEYSTREAM
Wirte the keystream to the output buffer, input is NULL.
KeystreamOperation
Keystream operation flags.
Panama message authentication code.
Panama stream cipher operation.
size_type size() const
Provides the count of elements in the SecBlock.
void Assign(const T *ptr, size_type len)
Set contents and size from an array.
Panama stream cipher information.
Crypto++ library namespace.
Namespace containing weak and wounded algorithms.
Interface for retrieving values given their names.
Base class for identifying alogorithm.
Classes for implementing stream ciphers.