aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/chacha/chacha.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/stream/chacha/chacha.h')
-rw-r--r--src/lib/stream/chacha/chacha.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/stream/chacha/chacha.h b/src/lib/stream/chacha/chacha.h
index f8f42e41d..eafeac2fd 100644
--- a/src/lib/stream/chacha/chacha.h
+++ b/src/lib/stream/chacha/chacha.h
@@ -24,7 +24,9 @@ class BOTAN_DLL ChaCha final : public StreamCipher
* Currently only 8, 12 or 20 rounds are supported, all others
* will throw an exception
*/
- ChaCha(size_t rounds);
+ ChaCha(size_t rounds = 20);
+
+ std::string provider() const override;
void cipher(const byte in[], byte out[], size_t length) override;
@@ -47,6 +49,12 @@ class BOTAN_DLL ChaCha final : public StreamCipher
private:
void key_schedule(const byte key[], size_t key_len) override;
+ void chacha_x4(byte output[64*4], u32bit state[16], size_t rounds);
+
+#if defined(BOTAN_HAS_CHACHA_SSE2)
+ void chacha_sse2_x4(byte output[64*4], u32bit state[16], size_t rounds);
+#endif
+
size_t m_rounds;
secure_vector<u32bit> m_state;
secure_vector<byte> m_buffer;