From c59d960db6d69bd9c479ec674768b7ec371830b5 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 13 Oct 2010 00:38:07 +0000 Subject: s/u32bit/size_t/ in stream --- src/stream/salsa20/salsa20.cpp | 8 ++++---- src/stream/salsa20/salsa20.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/stream/salsa20') 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 state; SecureVector buffer; - u32bit position; + size_t position; }; } -- cgit v1.2.3