aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/salsa20/salsa20.cpp
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/salsa20/salsa20.cpp
parent9eb10b06036840822c03aec900a1e64f90e77181 (diff)
De-inline functions from stream cipher headers
Diffstat (limited to 'src/lib/stream/salsa20/salsa20.cpp')
-rw-r--r--src/lib/stream/salsa20/salsa20.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/lib/stream/salsa20/salsa20.cpp b/src/lib/stream/salsa20/salsa20.cpp
index ff24995ee..cc1d80568 100644
--- a/src/lib/stream/salsa20/salsa20.cpp
+++ b/src/lib/stream/salsa20/salsa20.cpp
@@ -243,9 +243,26 @@ void Salsa20::set_iv(const uint8_t iv[], size_t length)
m_position = 0;
}
-/*
-* Return the name of this type
-*/
+bool Salsa20::valid_iv_length(size_t iv_len) const
+ {
+ return (iv_len == 0 || iv_len == 8 || iv_len == 24);
+ }
+
+size_t Salsa20::default_iv_length() const
+ {
+ return 24;
+ }
+
+Key_Length_Specification Salsa20::key_spec() const
+ {
+ return Key_Length_Specification(16, 32, 16);
+ }
+
+StreamCipher* Salsa20::clone() const
+ {
+ return new Salsa20;
+ }
+
std::string Salsa20::name() const
{
return "Salsa20";