aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream/salsa20/salsa20.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-03 23:41:56 +0000
committerlloyd <[email protected]>2009-11-03 23:41:56 +0000
commit30f6169ebf9164a6fdb35519030975440a5b07d7 (patch)
tree8435e826dd692066c6c3fc56d02f8f4479188c02 /src/stream/salsa20/salsa20.cpp
parentcb0d4a18f2fc77a40f6055fedb43b78606068b7b (diff)
parent226d96ee4e64994beb9ec9436a29ac6656d61924 (diff)
propagate from branch 'net.randombit.botan.1_8' (head 6e8c18515725a70923b34118951252723dd4c29a)
to branch 'net.randombit.botan' (head 77ba4ea5a4be36d6d029bcc852b2271edff0d679)
Diffstat (limited to 'src/stream/salsa20/salsa20.cpp')
-rw-r--r--src/stream/salsa20/salsa20.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/stream/salsa20/salsa20.cpp b/src/stream/salsa20/salsa20.cpp
index 75137798c..3aae64eae 100644
--- a/src/stream/salsa20/salsa20.cpp
+++ b/src/stream/salsa20/salsa20.cpp
@@ -6,10 +6,8 @@
*/
#include <botan/salsa20.h>
-#include <botan/mem_ops.h>
#include <botan/xor_buf.h>
#include <botan/loadstor.h>
-#include <botan/parsing.h>
namespace Botan {
@@ -164,15 +162,15 @@ void Salsa20::key_schedule(const byte key[], u32bit length)
}
const byte ZERO[8] = { 0 };
- resync(ZERO, sizeof(ZERO));
+ set_iv(ZERO, sizeof(ZERO));
}
/*
* Return the name of this type
*/
-void Salsa20::resync(const byte iv[], u32bit length)
+void Salsa20::set_iv(const byte iv[], u32bit length)
{
- if(length != IV_LENGTH)
+ if(!valid_iv_length(length))
throw Invalid_IV_Length(name(), length);
state[6] = load_le<u32bit>(iv, 0);
@@ -199,7 +197,7 @@ std::string Salsa20::name() const
/*
* Clear memory of sensitive data
*/
-void Salsa20::clear() throw()
+void Salsa20::clear()
{
state.clear();
buffer.clear();
@@ -209,7 +207,7 @@ void Salsa20::clear() throw()
/*
* Salsa20 Constructor
*/
-Salsa20::Salsa20() : StreamCipher(16, 32, 16, 8)
+Salsa20::Salsa20() : StreamCipher(16, 32, 16)
{
clear();
}