6#ifndef CRYPTOPP_PANAMA_H
7#define CRYPTOPP_PANAMA_H
19#define CRYPTOPP_DISABLE_PANAMA_ASM 1
29 std::string AlgorithmProvider()
const;
35 CRYPTOPP_CONSTANT(STAGES = 32);
43template <
class B = LittleEndian>
47 CRYPTOPP_CONSTANT(DIGESTSIZE = 32);
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";}
147 std::string AlgorithmProvider()
const;
148 void CipherSetKey(
const NameValuePairs ¶ms,
const byte *key,
size_t length);
149 void OperateKeystream(
KeystreamOperation operation,
byte *output,
const byte *input,
size_t iterationCount);
150 bool CipherIsRandomAccess()
const {
return false;}
151 void CipherResynchronize(
byte *keystreamBuffer,
const byte *iv,
size_t length);
152 unsigned int GetAlignment()
const;
160template <
class B = LittleEndian>
Base class for additive stream ciphers with SymmetricCipher interface.
Inherited by keyed algorithms with fixed key length.
MAC construction using a hermetic hash function.
Interface for retrieving values given their names.
Panama stream cipher operation.
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.
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
std::string AlgorithmProvider() const
Retrieve the provider of this algorithm.
unsigned int DigestSize() const
Provides the digest size of the hash.
Panama message authentication code.
unsigned int word32
32-bit unsigned datatype
@ BIG_ENDIAN_ORDER
byte order is big-endian
Base classes for iterated hashes.
Crypto++ library namespace.
Namespace containing weak and wounded algorithms.
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.