29#ifndef CRYPTOPP_CHACHA_H
30#define CRYPTOPP_CHACHA_H
60 virtual ~ChaCha_Policy() {}
61 ChaCha_Policy() : m_rounds(ROUNDS) {}
64 void CipherSetKey(
const NameValuePairs ¶ms,
const byte *key,
size_t length);
65 void OperateKeystream(
KeystreamOperation operation,
byte *output,
const byte *input,
size_t iterationCount);
66 void CipherResynchronize(
byte *keystreamBuffer,
const byte *IV,
size_t length);
67 bool CipherIsRandomAccess()
const {
return true;}
68 void SeekToIteration(
lword iterationCount);
69 unsigned int GetAlignment()
const;
70 unsigned int GetOptimalBlockSize()
const;
72 std::string AlgorithmName()
const;
73 std::string AlgorithmProvider()
const;
75 CRYPTOPP_CONSTANT(ROUNDS = 20);
77 unsigned int m_rounds;
117 virtual ~ChaChaTLS_Policy() {}
118 ChaChaTLS_Policy() : m_counter(0) {}
121 void CipherSetKey(
const NameValuePairs ¶ms,
const byte *key,
size_t length);
122 void OperateKeystream(
KeystreamOperation operation,
byte *output,
const byte *input,
size_t iterationCount);
123 void CipherResynchronize(
byte *keystreamBuffer,
const byte *IV,
size_t length);
124 bool CipherIsRandomAccess()
const {
return true;}
125 void SeekToIteration(
lword iterationCount);
126 unsigned int GetAlignment()
const;
127 unsigned int GetOptimalBlockSize()
const;
129 std::string AlgorithmName()
const;
130 std::string AlgorithmProvider()
const;
133 unsigned int m_counter;
135 CRYPTOPP_CONSTANT(KEY = 16);
136 CRYPTOPP_CONSTANT(CTR = 24);
183 virtual ~XChaCha20_Policy() {}
184 XChaCha20_Policy() : m_counter(0), m_rounds(ROUNDS) {}
187 void CipherSetKey(
const NameValuePairs ¶ms,
const byte *key,
size_t length);
188 void OperateKeystream(
KeystreamOperation operation,
byte *output,
const byte *input,
size_t iterationCount);
189 void CipherResynchronize(
byte *keystreamBuffer,
const byte *IV,
size_t length);
190 bool CipherIsRandomAccess()
const {
return false;}
191 void SeekToIteration(
lword iterationCount);
192 unsigned int GetAlignment()
const;
193 unsigned int GetOptimalBlockSize()
const;
195 std::string AlgorithmName()
const;
196 std::string AlgorithmProvider()
const;
199 unsigned int m_counter, m_rounds;
200 CRYPTOPP_CONSTANT(ROUNDS = 20);
201 CRYPTOPP_CONSTANT(KEY = 16);
Inherited by keyed algorithms with fixed key length.
Inherited by algorithms with fixed number of rounds.
Fixed size stack-based SecBlock with 16-byte alignment.
Interface for retrieving values given their names.
Interface for algorithms that take byte strings as keys.
SymmetricCipher implementation.
Inherited by keyed algorithms with variable key length.
word64 lword
Large word type.
Crypto++ library namespace.
Classes and functions for secure memory allocations.
Classes for implementing stream ciphers.
KeystreamOperation
Keystream operation flags.
Base class for additive stream ciphers.
ChaCha stream cipher information.
static const char * StaticAlgorithmName()
The algorithm name.
SymmetricCipherFinal< ConcretePolicyHolder< ChaCha_Policy, AdditiveCipherTemplate<> >, ChaCha_Info > Encryption
ChaCha Encryption.
Encryption Decryption
ChaCha Decryption.
IETF ChaCha20 stream cipher information.
static const char * StaticAlgorithmName()
The algorithm name.
IETF ChaCha20 stream cipher.
SymmetricCipherFinal< ConcretePolicyHolder< ChaChaTLS_Policy, AdditiveCipherTemplate<> >, ChaChaTLS_Info > Encryption
ChaCha-TLS Encryption.
Encryption Decryption
ChaCha-TLS Decryption.
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher.
IETF XChaCha20 stream cipher information.
static const char * StaticAlgorithmName()
The algorithm name.
IETF XChaCha20 stream cipher.
SymmetricCipherFinal< ConcretePolicyHolder< XChaCha20_Policy, AdditiveCipherTemplate<> >, XChaCha20_Info > Encryption
XChaCha Encryption.
Encryption Decryption
XChaCha Decryption.