aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/des
diff options
context:
space:
mode:
Diffstat (limited to 'src/block/des')
-rw-r--r--src/block/des/des.cpp16
-rw-r--r--src/block/des/des.h8
-rw-r--r--src/block/des/desx.cpp8
-rw-r--r--src/block/des/desx.h4
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"; }