aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/chacha
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-08 13:12:50 -0400
committerJack Lloyd <[email protected]>2018-08-08 13:12:50 -0400
commit5111c4c3aa0b51efb85284c2b3e6e664101dbc94 (patch)
tree659d8748c25b56f3b954071948fc42ea5ad86faf /src/lib/stream/chacha
parent9eb10b06036840822c03aec900a1e64f90e77181 (diff)
De-inline functions from stream cipher headers
Diffstat (limited to 'src/lib/stream/chacha')
-rw-r--r--src/lib/stream/chacha/chacha.cpp15
-rw-r--r--src/lib/stream/chacha/chacha.h11
2 files changed, 19 insertions, 7 deletions
diff --git a/src/lib/stream/chacha/chacha.cpp b/src/lib/stream/chacha/chacha.cpp
index fac9a5a36..d2d31a12e 100644
--- a/src/lib/stream/chacha/chacha.cpp
+++ b/src/lib/stream/chacha/chacha.cpp
@@ -233,6 +233,21 @@ void ChaCha::key_schedule(const uint8_t key[], size_t length)
set_iv(nullptr, 0);
}
+size_t ChaCha::default_iv_length() const
+ {
+ return 24;
+ }
+
+Key_Length_Specification ChaCha::key_spec() const
+ {
+ return Key_Length_Specification(16, 32, 16);
+ }
+
+StreamCipher* ChaCha::clone() const
+ {
+ return new ChaCha(m_rounds);
+ }
+
bool ChaCha::valid_iv_length(size_t iv_len) const
{
return (iv_len == 0 || iv_len == 8 || iv_len == 12 || iv_len == 24);
diff --git a/src/lib/stream/chacha/chacha.h b/src/lib/stream/chacha/chacha.h
index d0e131315..e41fd927f 100644
--- a/src/lib/stream/chacha/chacha.h
+++ b/src/lib/stream/chacha/chacha.h
@@ -18,8 +18,6 @@ namespace Botan {
class BOTAN_PUBLIC_API(2,0) ChaCha final : public StreamCipher
{
public:
- StreamCipher* clone() const override { return new ChaCha(m_rounds); }
-
/**
* @param rounds number of rounds
* @note Currently only 8, 12 or 20 rounds are supported, all others
@@ -41,15 +39,14 @@ class BOTAN_PUBLIC_API(2,0) ChaCha final : public StreamCipher
*/
bool valid_iv_length(size_t iv_len) const override;
- size_t default_iv_length() const override { return 24; }
+ size_t default_iv_length() const override;
- Key_Length_Specification key_spec() const override
- {
- return Key_Length_Specification(16, 32, 16);
- }
+ Key_Length_Specification key_spec() const override;
void clear() override;
+ StreamCipher* clone() const override;
+
std::string name() const override;
void seek(uint64_t offset) override;