summaryrefslogtreecommitdiff
path: root/salsa.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-02-12 16:56:01 -0500
committerGitHub <noreply@github.com>2019-02-12 16:56:01 -0500
commite499131ea6ba23ce57f6a7e50d0c2ff3fb8eff62 (patch)
treed25a7600ec6a4aaf3ab669ce3bd97559dbd0ebec /salsa.h
parenta9eac2ce6ea615f611e1a0f2738f79e797efe074 (diff)
downloadcryptopp-git-e499131ea6ba23ce57f6a7e50d0c2ff3fb8eff62.tar.gz
Latch previous ROUNDS in Salsa and ChaCha ciphers (GH #800, PR #804)
Diffstat (limited to 'salsa.h')
-rw-r--r--salsa.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/salsa.h b/salsa.h
index a42d684b..31bb9a67 100644
--- a/salsa.h
+++ b/salsa.h
@@ -36,6 +36,7 @@ struct Salsa20_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInter
class CRYPTOPP_NO_VTABLE Salsa20_Policy : public AdditiveCipherConcretePolicy<word32, 16>
{
protected:
+ Salsa20_Policy() : m_rounds(ROUNDS) {}
void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length);
@@ -49,6 +50,7 @@ protected:
std::string AlgorithmProvider() const;
+ CRYPTOPP_CONSTANT(ROUNDS = 20) // Default rounds
FixedSizeAlignedSecBlock<word32, 16> m_state;
int m_rounds;
};