diff options
author | lloyd <[email protected]> | 2010-10-13 00:56:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 00:56:15 +0000 |
commit | 6e706bfefa04fc28d6c204442ca45982993dc550 (patch) | |
tree | c3a151b6ce91cb5add058b224a925e4f3b8cfb5d /src/block | |
parent | c59d960db6d69bd9c479ec674768b7ec371830b5 (diff) |
More size_t
Diffstat (limited to 'src/block')
-rw-r--r-- | src/block/aes_intel/aes_intel.cpp | 24 | ||||
-rw-r--r-- | src/block/aes_intel/aes_intel.h | 12 | ||||
-rw-r--r-- | src/block/serpent_ia32/serp_ia32.cpp | 10 | ||||
-rw-r--r-- | src/block/serpent_ia32/serp_ia32.h | 4 |
4 files changed, 25 insertions, 25 deletions
diff --git a/src/block/aes_intel/aes_intel.cpp b/src/block/aes_intel/aes_intel.cpp index c52f3fcd3..d03767e72 100644 --- a/src/block/aes_intel/aes_intel.cpp +++ b/src/block/aes_intel/aes_intel.cpp @@ -103,7 +103,7 @@ __m128i aes_256_key_expansion(__m128i key, __m128i key2) /* * AES-128 Encryption */ -void AES_128_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const +void AES_128_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const { const __m128i* in_mm = (const __m128i*)in; __m128i* out_mm = (__m128i*)out; @@ -155,7 +155,7 @@ void AES_128_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const out_mm += 4; } - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { __m128i B = _mm_loadu_si128(in_mm + i); @@ -179,7 +179,7 @@ void AES_128_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const /* * AES-128 Decryption */ -void AES_128_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const +void AES_128_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const { const __m128i* in_mm = (const __m128i*)in; __m128i* out_mm = (__m128i*)out; @@ -231,7 +231,7 @@ void AES_128_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const out_mm += 4; } - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { __m128i B = _mm_loadu_si128(in_mm + i); @@ -313,7 +313,7 @@ void AES_128_Intel::clear() /* * AES-192 Encryption */ -void AES_192_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const +void AES_192_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const { const __m128i* in_mm = (const __m128i*)in; __m128i* out_mm = (__m128i*)out; @@ -369,7 +369,7 @@ void AES_192_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const out_mm += 4; } - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { __m128i B = _mm_loadu_si128(in_mm + i); @@ -395,7 +395,7 @@ void AES_192_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const /* * AES-192 Decryption */ -void AES_192_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const +void AES_192_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const { const __m128i* in_mm = (const __m128i*)in; __m128i* out_mm = (__m128i*)out; @@ -451,7 +451,7 @@ void AES_192_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const out_mm += 4; } - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { __m128i B = _mm_loadu_si128(in_mm + i); @@ -529,7 +529,7 @@ void AES_192_Intel::clear() /* * AES-256 Encryption */ -void AES_256_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const +void AES_256_Intel::encrypt_n(const byte in[], byte out[], size_t blocks) const { const __m128i* in_mm = (const __m128i*)in; __m128i* out_mm = (__m128i*)out; @@ -589,7 +589,7 @@ void AES_256_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const out_mm += 4; } - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { __m128i B = _mm_loadu_si128(in_mm + i); @@ -617,7 +617,7 @@ void AES_256_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const /* * AES-256 Decryption */ -void AES_256_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const +void AES_256_Intel::decrypt_n(const byte in[], byte out[], size_t blocks) const { const __m128i* in_mm = (const __m128i*)in; __m128i* out_mm = (__m128i*)out; @@ -677,7 +677,7 @@ void AES_256_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const out_mm += 4; } - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { __m128i B = _mm_loadu_si128(in_mm + i); diff --git a/src/block/aes_intel/aes_intel.h b/src/block/aes_intel/aes_intel.h index 34ffcf9c6..43e8f2f0e 100644 --- a/src/block/aes_intel/aes_intel.h +++ b/src/block/aes_intel/aes_intel.h @@ -20,8 +20,8 @@ class BOTAN_DLL AES_128_Intel : public BlockCipher public: size_t parallelism() const { return 4; } - void encrypt_n(const byte in[], byte out[], u32bit blocks) const; - void decrypt_n(const byte in[], byte out[], u32bit blocks) const; + void encrypt_n(const byte in[], byte out[], size_t blocks) const; + void decrypt_n(const byte in[], byte out[], size_t blocks) const; void clear(); std::string name() const { return "AES-128"; } @@ -42,8 +42,8 @@ class BOTAN_DLL AES_192_Intel : public BlockCipher public: size_t parallelism() const { return 4; } - void encrypt_n(const byte in[], byte out[], u32bit blocks) const; - void decrypt_n(const byte in[], byte out[], u32bit blocks) const; + void encrypt_n(const byte in[], byte out[], size_t blocks) const; + void decrypt_n(const byte in[], byte out[], size_t blocks) const; void clear(); std::string name() const { return "AES-192"; } @@ -64,8 +64,8 @@ class BOTAN_DLL AES_256_Intel : public BlockCipher public: size_t parallelism() const { return 4; } - void encrypt_n(const byte in[], byte out[], u32bit blocks) const; - void decrypt_n(const byte in[], byte out[], u32bit blocks) const; + void encrypt_n(const byte in[], byte out[], size_t blocks) const; + void decrypt_n(const byte in[], byte out[], size_t blocks) const; void clear(); std::string name() const { return "AES-256"; } diff --git a/src/block/serpent_ia32/serp_ia32.cpp b/src/block/serpent_ia32/serp_ia32.cpp index e969f5235..28a605d12 100644 --- a/src/block/serpent_ia32/serp_ia32.cpp +++ b/src/block/serpent_ia32/serp_ia32.cpp @@ -46,7 +46,7 @@ void botan_serpent_ia32_key_schedule(u32bit ks[140]); */ void Serpent_IA32::encrypt_n(const byte in[], byte out[], u32bit blocks) const { - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { botan_serpent_ia32_encrypt(in, out, this->get_round_keys()); in += BLOCK_SIZE; @@ -57,9 +57,9 @@ void Serpent_IA32::encrypt_n(const byte in[], byte out[], u32bit blocks) const /* * Serpent Decryption */ -void Serpent_IA32::decrypt_n(const byte in[], byte out[], u32bit blocks) const +void Serpent_IA32::decrypt_n(const byte in[], byte out[], size_t blocks) const { - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { botan_serpent_ia32_decrypt(in, out, this->get_round_keys()); in += BLOCK_SIZE; @@ -73,8 +73,8 @@ void Serpent_IA32::decrypt_n(const byte in[], byte out[], u32bit blocks) const void Serpent_IA32::key_schedule(const byte key[], u32bit length) { SecureVector<u32bit> W(140); - for(u32bit j = 0; j != length / 4; ++j) - W[j] = load_le<u32bit>(key, j); + for(size_t i = 0; i != length / 4; ++i) + W[i] = load_le<u32bit>(key, i); W[length / 4] |= u32bit(1) << ((length%4)*8); botan_serpent_ia32_key_schedule(W); diff --git a/src/block/serpent_ia32/serp_ia32.h b/src/block/serpent_ia32/serp_ia32.h index 229a2042b..cd103c130 100644 --- a/src/block/serpent_ia32/serp_ia32.h +++ b/src/block/serpent_ia32/serp_ia32.h @@ -18,8 +18,8 @@ namespace Botan { class BOTAN_DLL Serpent_IA32 : public Serpent { public: - void encrypt_n(const byte in[], byte out[], u32bit blocks) const; - void decrypt_n(const byte in[], byte out[], u32bit blocks) const; + void encrypt_n(const byte in[], byte out[], size_t blocks) const; + void decrypt_n(const byte in[], byte out[], size_t blocks) const; BlockCipher* clone() const { return new Serpent_IA32; } private: |