diff options
author | lloyd <[email protected]> | 2010-10-13 02:56:03 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 02:56:03 +0000 |
commit | 3697dcff8b5e9765b41114281ce10e7ed3d3abb4 (patch) | |
tree | 670853a74b0fe173e7e9fce9cd3e6eda7a03d2c7 /src/block | |
parent | 63121e1e169616f724bf79b8aac1a2b4423c8904 (diff) |
s/BLOCK_SIZE/block_size()/
Diffstat (limited to 'src/block')
30 files changed, 143 insertions, 143 deletions
diff --git a/src/block/aes/aes.cpp b/src/block/aes/aes.cpp index cfd490e1d..88439cf98 100644 --- a/src/block/aes/aes.cpp +++ b/src/block/aes/aes.cpp @@ -521,8 +521,8 @@ void AES::encrypt_n(const byte in[], byte out[], size_t blocks) const out[14] = SE[get_byte(2, B1)] ^ ME[14]; out[15] = SE[get_byte(3, B2)] ^ ME[15]; - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -611,8 +611,8 @@ void AES::decrypt_n(const byte in[], byte out[], size_t blocks) const out[14] = SD[get_byte(2, B1)] ^ MD[14]; out[15] = SD[get_byte(3, B0)] ^ MD[15]; - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/block_cipher.h b/src/block/block_cipher.h index a7ca4cd99..5f5e5e530 100644 --- a/src/block/block_cipher.h +++ b/src/block/block_cipher.h @@ -54,15 +54,15 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm */ size_t parallel_bytes() const { - return parallelism() * BLOCK_SIZE * BOTAN_BLOCK_CIPHER_PAR_MULT; + return parallelism() * block_size() * BOTAN_BLOCK_CIPHER_PAR_MULT; } /** * Encrypt a block. * @param in The plaintext block to be encrypted as a byte array. - * Must be of length BLOCK_SIZE. + * Must be of length block_size(). * @param out The byte array designated to hold the encrypted block. - * Must be of length BLOCK_SIZE. + * Must be of length block_size(). */ void encrypt(const byte in[], byte out[]) const { encrypt_n(in, out, 1); } @@ -70,9 +70,9 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm /** * Decrypt a block. * @param in The ciphertext block to be decypted as a byte array. - * Must be of length BLOCK_SIZE. + * Must be of length block_size(). * @param out The byte array designated to hold the decrypted block. - * Must be of length BLOCK_SIZE. + * Must be of length block_size(). */ void decrypt(const byte in[], byte out[]) const { decrypt_n(in, out, 1); } @@ -80,7 +80,7 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm /** * Encrypt a block. * @param block the plaintext block to be encrypted - * Must be of length BLOCK_SIZE. Will hold the result when the function + * Must be of length block_size(). Will hold the result when the function * has finished. */ void encrypt(byte block[]) const { encrypt_n(block, block, 1); } @@ -88,14 +88,14 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm /** * Decrypt a block. * @param block the ciphertext block to be decrypted - * Must be of length BLOCK_SIZE. Will hold the result when the function + * Must be of length block_size(). Will hold the result when the function * has finished. */ void decrypt(byte block[]) const { decrypt_n(block, block, 1); } /** * Encrypt one or more blocks - * @param in the input buffer (multiple of BLOCK_SIZE) + * @param in the input buffer (multiple of block_size()) * @param out the output buffer (same size as in) * @param blocks the number of blocks to process */ @@ -104,7 +104,7 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm /** * Decrypt one or more blocks - * @param in the input buffer (multiple of BLOCK_SIZE) + * @param in the input buffer (multiple of block_size()) * @param out the output buffer (same size as in) * @param blocks the number of blocks to process */ diff --git a/src/block/blowfish/blowfish.cpp b/src/block/blowfish/blowfish.cpp index ea227e93e..f77c65d4d 100644 --- a/src/block/blowfish/blowfish.cpp +++ b/src/block/blowfish/blowfish.cpp @@ -40,8 +40,8 @@ void Blowfish::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, R, L); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -75,8 +75,8 @@ void Blowfish::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, R, L); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/cascade/cascade.cpp b/src/block/cascade/cascade.cpp index 54c33bc68..225b7fd6e 100644 --- a/src/block/cascade/cascade.cpp +++ b/src/block/cascade/cascade.cpp @@ -12,8 +12,8 @@ namespace Botan { void Cascade_Cipher::encrypt_n(const byte in[], byte out[], size_t blocks) const { - size_t c1_blocks = blocks * (BLOCK_SIZE / cipher1->BLOCK_SIZE); - size_t c2_blocks = blocks * (BLOCK_SIZE / cipher2->BLOCK_SIZE); + size_t c1_blocks = blocks * (block_size() / cipher1->block_size()); + size_t c2_blocks = blocks * (block_size() / cipher2->block_size()); cipher1->encrypt_n(in, out, c1_blocks); cipher2->encrypt_n(out, out, c2_blocks); @@ -22,8 +22,8 @@ void Cascade_Cipher::encrypt_n(const byte in[], byte out[], void Cascade_Cipher::decrypt_n(const byte in[], byte out[], size_t blocks) const { - size_t c1_blocks = blocks * (BLOCK_SIZE / cipher1->BLOCK_SIZE); - size_t c2_blocks = blocks * (BLOCK_SIZE / cipher2->BLOCK_SIZE); + size_t c1_blocks = blocks * (block_size() / cipher1->block_size()); + size_t c2_blocks = blocks * (block_size() / cipher2->block_size()); cipher2->decrypt_n(in, out, c2_blocks); cipher1->decrypt_n(out, out, c1_blocks); @@ -81,11 +81,11 @@ size_t block_size_for_cascade(size_t bs, size_t bs2) } Cascade_Cipher::Cascade_Cipher(BlockCipher* c1, BlockCipher* c2) : - BlockCipher(block_size_for_cascade(c1->BLOCK_SIZE, c2->BLOCK_SIZE), + BlockCipher(block_size_for_cascade(c1->block_size(), c2->block_size()), c1->MAXIMUM_KEYLENGTH + c2->MAXIMUM_KEYLENGTH), cipher1(c1), cipher2(c2) { - if(BLOCK_SIZE % c1->BLOCK_SIZE || BLOCK_SIZE % c2->BLOCK_SIZE) + if(block_size() % c1->block_size() || block_size() % c2->block_size()) throw Internal_Error("Failure in " + name() + " constructor"); } diff --git a/src/block/cast/cast128.cpp b/src/block/cast/cast128.cpp index 24469e025..092fc201e 100644 --- a/src/block/cast/cast128.cpp +++ b/src/block/cast/cast128.cpp @@ -74,8 +74,8 @@ void CAST_128::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, R, L); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -108,8 +108,8 @@ void CAST_128::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, R, L); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/cast/cast256.cpp b/src/block/cast/cast256.cpp index 8be0a8dd6..1b41cd2af 100644 --- a/src/block/cast/cast256.cpp +++ b/src/block/cast/cast256.cpp @@ -84,8 +84,8 @@ void CAST_256::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, A, B, C, D); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -128,8 +128,8 @@ void CAST_256::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, A, B, C, D); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/des/des.cpp b/src/block/des/des.cpp index 15c771bda..7c61df3db 100644 --- a/src/block/des/des.cpp +++ b/src/block/des/des.cpp @@ -162,8 +162,8 @@ void DES::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(T, out); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -193,8 +193,8 @@ void DES::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(T, out); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -234,8 +234,8 @@ void TripleDES::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(T, out); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -267,8 +267,8 @@ void TripleDES::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(T, out); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/des/desx.cpp b/src/block/des/desx.cpp index b92011e56..c4dacdfdd 100644 --- a/src/block/des/desx.cpp +++ b/src/block/des/desx.cpp @@ -17,12 +17,12 @@ void DESX::encrypt_n(const byte in[], byte out[], size_t blocks) const { for(size_t i = 0; i != blocks; ++i) { - xor_buf(out, in, &K1[0], BLOCK_SIZE); + xor_buf(out, in, &K1[0], block_size()); des.encrypt(out); - xor_buf(out, &K2[0], BLOCK_SIZE); + xor_buf(out, &K2[0], block_size()); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -33,12 +33,12 @@ void DESX::decrypt_n(const byte in[], byte out[], size_t blocks) const { for(size_t i = 0; i != blocks; ++i) { - xor_buf(out, in, &K2[0], BLOCK_SIZE); + xor_buf(out, in, &K2[0], block_size()); des.decrypt(out); - xor_buf(out, &K1[0], BLOCK_SIZE); + xor_buf(out, &K1[0], block_size()); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/gost_28147/gost_28147.cpp b/src/block/gost_28147/gost_28147.cpp index 4b4b83dcc..ddf26b3d0 100644 --- a/src/block/gost_28147/gost_28147.cpp +++ b/src/block/gost_28147/gost_28147.cpp @@ -107,8 +107,8 @@ void GOST_28147_89::encrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, N2, N1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -136,8 +136,8 @@ void GOST_28147_89::decrypt_n(const byte in[], byte out[], size_t blocks) const } store_le(out, N2, N1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/idea_sse2/idea_sse2.cpp b/src/block/idea_sse2/idea_sse2.cpp index 469a33943..8c7bd2a2c 100644 --- a/src/block/idea_sse2/idea_sse2.cpp +++ b/src/block/idea_sse2/idea_sse2.cpp @@ -201,8 +201,8 @@ void IDEA_SSE2::encrypt_n(const byte in[], byte out[], size_t blocks) const while(blocks >= 8) { idea_op_8(in, out, KS); - in += 8 * BLOCK_SIZE; - out += 8 * BLOCK_SIZE; + in += 8 * block_size(); + out += 8 * block_size(); blocks -= 8; } @@ -220,8 +220,8 @@ void IDEA_SSE2::decrypt_n(const byte in[], byte out[], size_t blocks) const while(blocks >= 8) { idea_op_8(in, out, KS); - in += 8 * BLOCK_SIZE; - out += 8 * BLOCK_SIZE; + in += 8 * block_size(); + out += 8 * block_size(); blocks -= 8; } diff --git a/src/block/kasumi/kasumi.cpp b/src/block/kasumi/kasumi.cpp index a57c0396a..1a217a9c7 100644 --- a/src/block/kasumi/kasumi.cpp +++ b/src/block/kasumi/kasumi.cpp @@ -145,8 +145,8 @@ void KASUMI::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, B0, B1, B2, B3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -191,8 +191,8 @@ void KASUMI::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, B0, B1, B2, B3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/lion/lion.cpp b/src/block/lion/lion.cpp index 0b3e7762a..7f6a06b79 100644 --- a/src/block/lion/lion.cpp +++ b/src/block/lion/lion.cpp @@ -33,8 +33,8 @@ void Lion::encrypt_n(const byte in[], byte out[], size_t blocks) const cipher->set_key(buffer, LEFT_SIZE); cipher->cipher1(out + LEFT_SIZE, RIGHT_SIZE); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -60,8 +60,8 @@ void Lion::decrypt_n(const byte in[], byte out[], size_t blocks) const cipher->set_key(buffer, LEFT_SIZE); cipher->cipher1(out + LEFT_SIZE, RIGHT_SIZE); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -83,7 +83,7 @@ std::string Lion::name() const { return "Lion(" + hash->name() + "," + cipher->name() + "," + - to_string(BLOCK_SIZE) + ")"; + to_string(block_size()) + ")"; } /* @@ -91,7 +91,7 @@ std::string Lion::name() const */ BlockCipher* Lion::clone() const { - return new Lion(hash->clone(), cipher->clone(), BLOCK_SIZE); + return new Lion(hash->clone(), cipher->clone(), block_size()); } /* @@ -112,11 +112,11 @@ Lion::Lion(HashFunction* hash_in, StreamCipher* sc_in, size_t block_len) : BlockCipher(std::max<size_t>(2*hash_in->output_length() + 1, block_len), 2, 2*hash_in->output_length(), 2), LEFT_SIZE(hash_in->output_length()), - RIGHT_SIZE(BLOCK_SIZE - LEFT_SIZE), + RIGHT_SIZE(block_size() - LEFT_SIZE), hash(hash_in), cipher(sc_in) { - if(2*LEFT_SIZE + 1 > BLOCK_SIZE) + if(2*LEFT_SIZE + 1 > block_size()) throw Invalid_Argument(name() + ": Chosen block size is too small"); if(!cipher->valid_keylength(LEFT_SIZE)) diff --git a/src/block/lubyrack/lubyrack.cpp b/src/block/lubyrack/lubyrack.cpp index ecc0fadfd..aa33c6bc4 100644 --- a/src/block/lubyrack/lubyrack.cpp +++ b/src/block/lubyrack/lubyrack.cpp @@ -42,8 +42,8 @@ void LubyRackoff::encrypt_n(const byte in[], byte out[], size_t blocks) const hash->final(buffer); xor_buf(out, buffer, len); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -79,8 +79,8 @@ void LubyRackoff::decrypt_n(const byte in[], byte out[], size_t blocks) const hash->final(buffer); xor_buf(out + len, buffer, len); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/mars/mars.cpp b/src/block/mars/mars.cpp index fa73e564f..5864ac49b 100644 --- a/src/block/mars/mars.cpp +++ b/src/block/mars/mars.cpp @@ -267,8 +267,8 @@ void MARS::encrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, A, B, C, D); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -310,8 +310,8 @@ void MARS::decrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, D, C, B, A); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/misty1/misty1.cpp b/src/block/misty1/misty1.cpp index 2f82e18e8..c904c5d78 100644 --- a/src/block/misty1/misty1.cpp +++ b/src/block/misty1/misty1.cpp @@ -144,8 +144,8 @@ void MISTY1::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, B2, B3, B0, B1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -194,8 +194,8 @@ void MISTY1::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, B0, B1, B2, B3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/noekeon/noekeon.cpp b/src/block/noekeon/noekeon.cpp index 06c415be9..c29fed93e 100644 --- a/src/block/noekeon/noekeon.cpp +++ b/src/block/noekeon/noekeon.cpp @@ -114,8 +114,8 @@ void Noekeon::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, A0, A1, A2, A3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -152,8 +152,8 @@ void Noekeon::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, A0, A1, A2, A3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/rc2/rc2.cpp b/src/block/rc2/rc2.cpp index 97ca5d577..5c7cb1ead 100644 --- a/src/block/rc2/rc2.cpp +++ b/src/block/rc2/rc2.cpp @@ -48,8 +48,8 @@ void RC2::encrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, R0, R1, R2, R3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -90,8 +90,8 @@ void RC2::decrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, R0, R1, R2, R3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/rc5/rc5.cpp b/src/block/rc5/rc5.cpp index 519735967..3cd169e5d 100644 --- a/src/block/rc5/rc5.cpp +++ b/src/block/rc5/rc5.cpp @@ -38,8 +38,8 @@ void RC5::encrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, A, B); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -68,8 +68,8 @@ void RC5::decrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, A, B); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/rc6/rc6.cpp b/src/block/rc6/rc6.cpp index 53ca5a7a2..df87acbb1 100644 --- a/src/block/rc6/rc6.cpp +++ b/src/block/rc6/rc6.cpp @@ -55,8 +55,8 @@ void RC6::encrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, A, B, C, D); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -103,8 +103,8 @@ void RC6::decrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, A, B, C, D); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/safer/safer_sk.cpp b/src/block/safer/safer_sk.cpp index f78e326e4..48d96d1a2 100644 --- a/src/block/safer/safer_sk.cpp +++ b/src/block/safer/safer_sk.cpp @@ -43,8 +43,8 @@ void SAFER_SK::encrypt_n(const byte in[], byte out[], size_t blocks) const out[4] = E ^ EK[16*ROUNDS+4]; out[5] = F + EK[16*ROUNDS+5]; out[6] = G + EK[16*ROUNDS+6]; out[7] = H ^ EK[16*ROUNDS+7]; - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -81,8 +81,8 @@ void SAFER_SK::decrypt_n(const byte in[], byte out[], size_t blocks) const out[0] = A; out[1] = B; out[2] = C; out[3] = D; out[4] = E; out[5] = F; out[6] = G; out[7] = H; - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/seed/seed.cpp b/src/block/seed/seed.cpp index 408220013..015d2d48d 100644 --- a/src/block/seed/seed.cpp +++ b/src/block/seed/seed.cpp @@ -54,8 +54,8 @@ void SEED::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, B2, B3, B0, B1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -94,8 +94,8 @@ void SEED::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, B2, B3, B0, B1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/serpent/serpent.cpp b/src/block/serpent/serpent.cpp index 1d940cf39..ec37a9e97 100644 --- a/src/block/serpent/serpent.cpp +++ b/src/block/serpent/serpent.cpp @@ -287,8 +287,8 @@ void Serpent::encrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, B0, B1, B2, B3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -339,8 +339,8 @@ void Serpent::decrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, B0, B1, B2, B3); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/serpent_ia32/serp_ia32.cpp b/src/block/serpent_ia32/serp_ia32.cpp index d2f8adb62..76814647c 100644 --- a/src/block/serpent_ia32/serp_ia32.cpp +++ b/src/block/serpent_ia32/serp_ia32.cpp @@ -49,8 +49,8 @@ void Serpent_IA32::encrypt_n(const byte in[], byte out[], size_t blocks) const for(size_t i = 0; i != blocks; ++i) { botan_serpent_ia32_encrypt(in, out, this->get_round_keys()); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -62,8 +62,8 @@ void Serpent_IA32::decrypt_n(const byte in[], byte out[], size_t blocks) const for(size_t i = 0; i != blocks; ++i) { botan_serpent_ia32_decrypt(in, out, this->get_round_keys()); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/serpent_simd/serp_simd.cpp b/src/block/serpent_simd/serp_simd.cpp index babe68d40..aef37cb99 100644 --- a/src/block/serpent_simd/serp_simd.cpp +++ b/src/block/serpent_simd/serp_simd.cpp @@ -185,8 +185,8 @@ void Serpent_SIMD::encrypt_n(const byte in[], byte out[], size_t blocks) const while(blocks >= 4) { serpent_encrypt_4(in, out, KS); - in += 4 * BLOCK_SIZE; - out += 4 * BLOCK_SIZE; + in += 4 * block_size(); + out += 4 * block_size(); blocks -= 4; } @@ -204,8 +204,8 @@ void Serpent_SIMD::decrypt_n(const byte in[], byte out[], size_t blocks) const while(blocks >= 4) { serpent_decrypt_4(in, out, KS); - in += 4 * BLOCK_SIZE; - out += 4 * BLOCK_SIZE; + in += 4 * block_size(); + out += 4 * block_size(); blocks -= 4; } diff --git a/src/block/skipjack/skipjack.cpp b/src/block/skipjack/skipjack.cpp index b73972b59..7f25cc90a 100644 --- a/src/block/skipjack/skipjack.cpp +++ b/src/block/skipjack/skipjack.cpp @@ -108,8 +108,8 @@ void Skipjack::encrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, W4, W3, W2, W1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -149,8 +149,8 @@ void Skipjack::decrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, W4, W3, W2, W1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/square/square.cpp b/src/block/square/square.cpp index b1517b990..ba86dd931 100644 --- a/src/block/square/square.cpp +++ b/src/block/square/square.cpp @@ -68,8 +68,8 @@ void Square::encrypt_n(const byte in[], byte out[], size_t blocks) const out[14] = SE[get_byte(3, B2)] ^ ME[30]; out[15] = SE[get_byte(3, B3)] ^ ME[31]; - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -130,8 +130,8 @@ void Square::decrypt_n(const byte in[], byte out[], size_t blocks) const out[14] = SD[get_byte(3, B2)] ^ MD[30]; out[15] = SD[get_byte(3, B3)] ^ MD[31]; - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/tea/tea.cpp b/src/block/tea/tea.cpp index 4ef995a7c..328786a14 100644 --- a/src/block/tea/tea.cpp +++ b/src/block/tea/tea.cpp @@ -30,8 +30,8 @@ void TEA::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, L, R); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -55,8 +55,8 @@ void TEA::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, L, R); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/twofish/twofish.cpp b/src/block/twofish/twofish.cpp index 41bc7ca1c..a573c2ec8 100644 --- a/src/block/twofish/twofish.cpp +++ b/src/block/twofish/twofish.cpp @@ -57,8 +57,8 @@ void Twofish::encrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, C, D, A, B); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -108,8 +108,8 @@ void Twofish::decrypt_n(const byte in[], byte out[], size_t blocks) const store_le(out, C, D, A, B); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/xtea/xtea.cpp b/src/block/xtea/xtea.cpp index 597eedd07..ba07ba57c 100644 --- a/src/block/xtea/xtea.cpp +++ b/src/block/xtea/xtea.cpp @@ -64,8 +64,8 @@ void XTEA::encrypt_n(const byte in[], byte out[], size_t blocks) const while(blocks >= 4) { xtea_encrypt_4(in, out, &(this->EK[0])); - in += 4 * BLOCK_SIZE; - out += 4 * BLOCK_SIZE; + in += 4 * block_size(); + out += 4 * block_size(); blocks -= 4; } @@ -82,8 +82,8 @@ void XTEA::encrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, L, R); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } @@ -95,8 +95,8 @@ void XTEA::decrypt_n(const byte in[], byte out[], size_t blocks) const while(blocks >= 4) { xtea_decrypt_4(in, out, &(this->EK[0])); - in += 4 * BLOCK_SIZE; - out += 4 * BLOCK_SIZE; + in += 4 * block_size(); + out += 4 * block_size(); blocks -= 4; } @@ -113,8 +113,8 @@ void XTEA::decrypt_n(const byte in[], byte out[], size_t blocks) const store_be(out, L, R); - in += BLOCK_SIZE; - out += BLOCK_SIZE; + in += block_size(); + out += block_size(); } } diff --git a/src/block/xtea_simd/xtea_simd.cpp b/src/block/xtea_simd/xtea_simd.cpp index 831cc0359..5b73c7bb9 100644 --- a/src/block/xtea_simd/xtea_simd.cpp +++ b/src/block/xtea_simd/xtea_simd.cpp @@ -99,8 +99,8 @@ void XTEA_SIMD::encrypt_n(const byte in[], byte out[], size_t blocks) const while(blocks >= 8) { xtea_encrypt_8(in, out, KS); - in += 8 * BLOCK_SIZE; - out += 8 * BLOCK_SIZE; + in += 8 * block_size(); + out += 8 * block_size(); blocks -= 8; } @@ -118,8 +118,8 @@ void XTEA_SIMD::decrypt_n(const byte in[], byte out[], size_t blocks) const while(blocks >= 8) { xtea_decrypt_8(in, out, KS); - in += 8 * BLOCK_SIZE; - out += 8 * BLOCK_SIZE; + in += 8 * block_size(); + out += 8 * block_size(); blocks -= 8; } |