6#ifndef CRYPTOPP_PANAMA_H
7#define CRYPTOPP_PANAMA_H
19#define CRYPTOPP_DISABLE_PANAMA_ASM 1
21NAMESPACE_BEGIN(CryptoPP)
29 std::string AlgorithmProvider()
const;
35 CRYPTOPP_CONSTANT(STAGES = 32);
43template <
class B = LittleEndian>
47 CRYPTOPP_CONSTANT(DIGESTSIZE = 32);
50 unsigned int DigestSize()
const {
return DIGESTSIZE;}
51 void TruncatedFinal(
byte *hash,
size_t size);
52 CRYPTOPP_STATIC_CONSTEXPR
const char* StaticAlgorithmName() {
return B::ToEnum() ==
BIG_ENDIAN_ORDER ?
"Panama-BE" :
"Panama-LE";}
57 void HashEndianCorrectedBlock(
const word32 *data) {this->Iterate(1, data);}
58 size_t HashMultipleBlocks(
const word32 *input,
size_t length);
59 word32* StateBuf() {
return NULLPTR;}
66template <
class T_Hash,
class T_Info = T_Hash>
70 void UncheckedSetKey(
const byte *key,
unsigned int length,
const NameValuePairs ¶ms)
72 CRYPTOPP_UNUSED(params);
84 void Update(
const byte *input,
size_t length)
88 m_hash.Update(input, length);
91 void TruncatedFinal(
byte *digest,
size_t digestSize)
95 m_hash.TruncatedFinal(digest, digestSize);
99 unsigned int DigestSize()
const
100 {
return m_hash.DigestSize();}
101 unsigned int BlockSize()
const
102 {
return m_hash.BlockSize();}
103 unsigned int OptimalBlockSize()
const
104 {
return m_hash.OptimalBlockSize();}
105 unsigned int OptimalDataAlignment()
const
106 {
return m_hash.OptimalDataAlignment();}
111 m_hash.Update(m_key, m_key.
size());
122template <
class B = LittleEndian>
127 PanamaMAC(
const byte *key,
unsigned int length)
128 {this->SetKey(key, length);}
136 CRYPTOPP_STATIC_CONSTEXPR
const char* StaticAlgorithmName() {
return B::ToEnum() ==
BIG_ENDIAN_ORDER ?
"Panama-BE" :
"Panama-LE";}
160template <
class B = LittleEndian>
Base class for additive stream ciphers with SymmetricCipher interface.
Inherited by keyed algorithms with fixed key length.
Fixed size stack-based SecBlock with 16-byte alignment.
Fixed size stack-based SecBlock.
MAC construction using a hermetic hash function.
Interface for retrieving values given their names.
Panama stream cipher operation.
void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length)
Resynchronize the cipher.
std::string AlgorithmProvider() const
Retrieve the provider of this algorithm.
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length)
Key the cipher.
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)
Operates the keystream.
unsigned int GetAlignment() const
Provides data alignment requirements.
bool CipherIsRandomAccess() const
Flag indicating random access.
void Assign(const T *ptr, size_type len)
Set contents and size from an array.
size_type size() const
Provides the count of elements in the SecBlock.
SymmetricCipher implementation.
Panama message authentication code.
unsigned int word32
32-bit unsigned datatype
@ BIG_ENDIAN_ORDER
byte order is big-endian
Base classes for iterated hashes.
Classes and functions for secure memory allocations.
Classes for implementing stream ciphers.
KeystreamOperation
Keystream operation flags.
@ WRITE_KEYSTREAM
Write the keystream to the output buffer, input is NULL.
Base class for additive stream ciphers.
Panama stream cipher information.
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher.