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/skipjack | |
parent | e7e3af16a3540e1d7a84e085aa1ea7c55f627930 (diff) |
Use size_t rather than u32bit for the blocks argument of encrypt_n
Diffstat (limited to 'src/block/skipjack')
-rw-r--r-- | src/block/skipjack/skipjack.cpp | 20 | ||||
-rw-r--r-- | src/block/skipjack/skipjack.h | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/block/skipjack/skipjack.cpp b/src/block/skipjack/skipjack.cpp index 2a1901230..e3c8598ff 100644 --- a/src/block/skipjack/skipjack.cpp +++ b/src/block/skipjack/skipjack.cpp @@ -15,7 +15,7 @@ namespace { /* * Skipjack Stepping Rule 'A' */ -void step_A(u16bit& W1, u16bit& W4, u32bit round, const byte FTAB[]) +void step_A(u16bit& W1, u16bit& W4, size_t round, const byte FTAB[]) { byte G1 = get_byte(0, W1), G2 = get_byte(1, W1), G3; @@ -31,7 +31,7 @@ void step_A(u16bit& W1, u16bit& W4, u32bit round, const byte FTAB[]) /* * Skipjack Stepping Rule 'B' */ -void step_B(u16bit& W1, u16bit& W2, u32bit round, const byte FTAB[]) +void step_B(u16bit& W1, u16bit& W2, size_t round, const byte FTAB[]) { W2 ^= W1 ^ round; byte G1 = get_byte(0, W1), G2 = get_byte(1, W1), G3; @@ -45,7 +45,7 @@ void step_B(u16bit& W1, u16bit& W2, u32bit round, const byte FTAB[]) /* * Skipjack Invserse Stepping Rule 'A' */ -void step_Ai(u16bit& W1, u16bit& W2, u32bit round, const byte FTAB[]) +void step_Ai(u16bit& W1, u16bit& W2, size_t round, const byte FTAB[]) { W1 ^= W2 ^ round; byte G1 = get_byte(1, W2), G2 = get_byte(0, W2), G3; @@ -59,7 +59,7 @@ void step_Ai(u16bit& W1, u16bit& W2, u32bit round, const byte FTAB[]) /* * Skipjack Invserse Stepping Rule 'B' */ -void step_Bi(u16bit& W2, u16bit& W3, u32bit round, const byte FTAB[]) +void step_Bi(u16bit& W2, u16bit& W3, size_t round, const byte FTAB[]) { byte G1 = get_byte(1, W2), G2 = get_byte(0, W2), G3; G3 = FTAB[((4 * round - 1) % 10)*256 + G2] ^ G1; @@ -75,11 +75,11 @@ void step_Bi(u16bit& W2, u16bit& W3, u32bit round, const byte FTAB[]) /* * Skipjack Encryption */ -void Skipjack::encrypt_n(const byte in[], byte out[], u32bit blocks) const +void Skipjack::encrypt_n(const byte in[], byte out[], size_t blocks) const { const byte* ftab = &FTAB[0]; - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { u16bit W1 = load_le<u16bit>(in, 3); u16bit W2 = load_le<u16bit>(in, 2); @@ -116,11 +116,11 @@ void Skipjack::encrypt_n(const byte in[], byte out[], u32bit blocks) const /* * Skipjack Decryption */ -void Skipjack::decrypt_n(const byte in[], byte out[], u32bit blocks) const +void Skipjack::decrypt_n(const byte in[], byte out[], size_t blocks) const { const byte* ftab = &FTAB[0]; - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { u16bit W1 = load_le<u16bit>(in, 3); u16bit W2 = load_le<u16bit>(in, 2); @@ -183,8 +183,8 @@ void Skipjack::key_schedule(const byte key[], u32bit) 0x5E, 0x6C, 0xA9, 0x13, 0x57, 0x25, 0xB5, 0xE3, 0xBD, 0xA8, 0x3A, 0x01, 0x05, 0x59, 0x2A, 0x46 }; - for(u32bit i = 0; i != 10; ++i) - for(u32bit j = 0; j != 256; ++j) + for(size_t i = 0; i != 10; ++i) + for(size_t j = 0; j != 256; ++j) FTAB[256*i+j] = F[j ^ key[9-i]]; } diff --git a/src/block/skipjack/skipjack.h b/src/block/skipjack/skipjack.h index 123ab85ae..98cea7650 100644 --- a/src/block/skipjack/skipjack.h +++ b/src/block/skipjack/skipjack.h @@ -18,8 +18,8 @@ namespace Botan { class BOTAN_DLL Skipjack : 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(); std::string name() const { return "Skipjack"; } |