aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream/salsa20
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-13 00:38:07 +0000
committerlloyd <[email protected]>2010-10-13 00:38:07 +0000
commitc59d960db6d69bd9c479ec674768b7ec371830b5 (patch)
tree250385bd1c9c5b4a2afac27cc47d10031965f84b /src/stream/salsa20
parent2e42b5aaaf8d817f612518afa91a5bc9d1465eb7 (diff)
s/u32bit/size_t/ in stream
Diffstat (limited to 'src/stream/salsa20')
-rw-r--r--src/stream/salsa20/salsa20.cpp8
-rw-r--r--src/stream/salsa20/salsa20.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/stream/salsa20/salsa20.cpp b/src/stream/salsa20/salsa20.cpp
index 58626fb2f..7f76276bb 100644
--- a/src/stream/salsa20/salsa20.cpp
+++ b/src/stream/salsa20/salsa20.cpp
@@ -32,7 +32,7 @@ void hsalsa20(u32bit output[8], const u32bit input[16])
x08 = input[ 8], x09 = input[ 9], x10 = input[10], x11 = input[11],
x12 = input[12], x13 = input[13], x14 = input[14], x15 = input[15];
- for(u32bit i = 0; i != 10; ++i)
+ for(size_t i = 0; i != 10; ++i)
{
SALSA20_QUARTER_ROUND(x00, x04, x08, x12);
SALSA20_QUARTER_ROUND(x05, x09, x13, x01);
@@ -65,7 +65,7 @@ void salsa20(byte output[64], const u32bit input[16])
x08 = input[ 8], x09 = input[ 9], x10 = input[10], x11 = input[11],
x12 = input[12], x13 = input[13], x14 = input[14], x15 = input[15];
- for(u32bit i = 0; i != 10; ++i)
+ for(size_t i = 0; i != 10; ++i)
{
SALSA20_QUARTER_ROUND(x00, x04, x08, x12);
SALSA20_QUARTER_ROUND(x05, x09, x13, x01);
@@ -101,7 +101,7 @@ void salsa20(byte output[64], const u32bit input[16])
/*
* Combine cipher stream with message
*/
-void Salsa20::cipher(const byte in[], byte out[], u32bit length)
+void Salsa20::cipher(const byte in[], byte out[], size_t length)
{
while(length >= buffer.size() - position)
{
@@ -174,7 +174,7 @@ void Salsa20::key_schedule(const byte key[], u32bit length)
/*
* Return the name of this type
*/
-void Salsa20::set_iv(const byte iv[], u32bit length)
+void Salsa20::set_iv(const byte iv[], size_t length)
{
if(!valid_iv_length(length))
throw Invalid_IV_Length(name(), length);
diff --git a/src/stream/salsa20/salsa20.h b/src/stream/salsa20/salsa20.h
index 7e6c523cd..2addee9a9 100644
--- a/src/stream/salsa20/salsa20.h
+++ b/src/stream/salsa20/salsa20.h
@@ -18,11 +18,11 @@ namespace Botan {
class BOTAN_DLL Salsa20 : public StreamCipher
{
public:
- void cipher(const byte in[], byte out[], u32bit length);
+ void cipher(const byte in[], byte out[], size_t length);
- void set_iv(const byte iv[], u32bit iv_len);
+ void set_iv(const byte iv[], size_t iv_len);
- bool valid_iv_length(u32bit iv_len) const
+ bool valid_iv_length(size_t iv_len) const
{ return (iv_len == 8 || iv_len == 24); }
void clear();
@@ -36,7 +36,7 @@ class BOTAN_DLL Salsa20 : public StreamCipher
SecureVector<u32bit> state;
SecureVector<byte> buffer;
- u32bit position;
+ size_t position;
};
}