diff options
author | lloyd <[email protected]> | 2010-10-12 19:41:37 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-12 19:41:37 +0000 |
commit | ff2210b035a1598bf99e18a578ff075bece8fbe5 (patch) | |
tree | 4efe3a23daac9e2cd8b9f2b794d95089ba4cdfb2 /src/block/des | |
parent | e7e3af16a3540e1d7a84e085aa1ea7c55f627930 (diff) |
Use size_t rather than u32bit for the blocks argument of encrypt_n
Diffstat (limited to 'src/block/des')
-rw-r--r-- | src/block/des/des.cpp | 16 | ||||
-rw-r--r-- | src/block/des/des.h | 8 | ||||
-rw-r--r-- | src/block/des/desx.cpp | 8 | ||||
-rw-r--r-- | src/block/des/desx.h | 4 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/block/des/des.cpp b/src/block/des/des.cpp index 37424cd35..043391938 100644 --- a/src/block/des/des.cpp +++ b/src/block/des/des.cpp @@ -140,9 +140,9 @@ void des_decrypt(u32bit& L, u32bit& R, /* * DES Encryption */ -void DES::encrypt_n(const byte in[], byte out[], u32bit blocks) const +void DES::encrypt_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) { u64bit T = (DES_IPTAB1[in[0]] ) | (DES_IPTAB1[in[1]] << 1) | (DES_IPTAB1[in[2]] << 2) | (DES_IPTAB1[in[3]] << 3) | @@ -170,9 +170,9 @@ void DES::encrypt_n(const byte in[], byte out[], u32bit blocks) const /* * DES Decryption */ -void DES::decrypt_n(const byte in[], byte out[], u32bit blocks) const +void DES::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) { u64bit T = (DES_IPTAB1[in[0]] ) | (DES_IPTAB1[in[1]] << 1) | (DES_IPTAB1[in[2]] << 2) | (DES_IPTAB1[in[3]] << 3) | @@ -209,9 +209,9 @@ void DES::key_schedule(const byte key[], u32bit) /* * TripleDES Encryption */ -void TripleDES::encrypt_n(const byte in[], byte out[], u32bit blocks) const +void TripleDES::encrypt_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) { u64bit T = (DES_IPTAB1[in[0]] ) | (DES_IPTAB1[in[1]] << 1) | (DES_IPTAB1[in[2]] << 2) | (DES_IPTAB1[in[3]] << 3) | @@ -242,9 +242,9 @@ void TripleDES::encrypt_n(const byte in[], byte out[], u32bit blocks) const /* * TripleDES Decryption */ -void TripleDES::decrypt_n(const byte in[], byte out[], u32bit blocks) const +void TripleDES::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) { u64bit T = (DES_IPTAB1[in[0]] ) | (DES_IPTAB1[in[1]] << 1) | (DES_IPTAB1[in[2]] << 2) | (DES_IPTAB1[in[3]] << 3) | diff --git a/src/block/des/des.h b/src/block/des/des.h index e338b9a29..dbca8ddfd 100644 --- a/src/block/des/des.h +++ b/src/block/des/des.h @@ -18,8 +18,8 @@ namespace Botan { class BOTAN_DLL DES : public BlockCipher { 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; void clear() { zeroise(round_key); } std::string name() const { return "DES"; } @@ -38,8 +38,8 @@ class BOTAN_DLL DES : public BlockCipher class BOTAN_DLL TripleDES : public BlockCipher { 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; void clear() { zeroise(round_key); } std::string name() const { return "TripleDES"; } diff --git a/src/block/des/desx.cpp b/src/block/des/desx.cpp index cc97c4e7b..cb53448b4 100644 --- a/src/block/des/desx.cpp +++ b/src/block/des/desx.cpp @@ -13,9 +13,9 @@ namespace Botan { /* * DESX Encryption */ -void DESX::encrypt_n(const byte in[], byte out[], u32bit blocks) const +void DESX::encrypt_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) { xor_buf(out, in, &K1[0], BLOCK_SIZE); des.encrypt(out); @@ -29,9 +29,9 @@ void DESX::encrypt_n(const byte in[], byte out[], u32bit blocks) const /* * DESX Decryption */ -void DESX::decrypt_n(const byte in[], byte out[], u32bit blocks) const +void DESX::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) { xor_buf(out, in, &K2[0], BLOCK_SIZE); des.decrypt(out); diff --git a/src/block/des/desx.h b/src/block/des/desx.h index cb452c47b..5b7f10281 100644 --- a/src/block/des/desx.h +++ b/src/block/des/desx.h @@ -18,8 +18,8 @@ namespace Botan { class BOTAN_DLL DESX : public BlockCipher { 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; void clear() { des.clear(); zeroise(K1); zeroise(K2); } std::string name() const { return "DESX"; } |