diff options
-rw-r--r-- | src/filters/modes/cbc/cbc.cpp | 28 | ||||
-rw-r--r-- | src/filters/modes/cbc/cbc.h | 8 | ||||
-rw-r--r-- | src/filters/modes/xts/xts.cpp | 14 | ||||
-rw-r--r-- | src/filters/modes/xts/xts.h | 4 |
4 files changed, 27 insertions, 27 deletions
diff --git a/src/filters/modes/cbc/cbc.cpp b/src/filters/modes/cbc/cbc.cpp index fb997b7ef..2a339554e 100644 --- a/src/filters/modes/cbc/cbc.cpp +++ b/src/filters/modes/cbc/cbc.cpp @@ -19,8 +19,8 @@ namespace Botan { CBC_Encryption::CBC_Encryption(BlockCipher* ciph, BlockCipherModePaddingMethod* pad) : cipher(ciph), padder(pad), - buf_op(std::tr1::bind(&CBC_Encryption::cbc_encrypt, this, _1, _2), - std::tr1::bind(&CBC_Encryption::cbc_final, this, _1, _2), + buf_op(std::tr1::bind(&CBC_Encryption::buffered_proc_block, this, _1, _2), + std::tr1::bind(&CBC_Encryption::buffered_final, this, _1, _2), 2 * cipher->BLOCK_SIZE) { if(!padder->valid_blocksize(cipher->BLOCK_SIZE)) @@ -37,8 +37,8 @@ CBC_Encryption::CBC_Encryption(BlockCipher* ciph, const SymmetricKey& key, const InitializationVector& iv) : cipher(ciph), padder(pad), - buf_op(std::tr1::bind(&CBC_Encryption::cbc_encrypt, this, _1, _2), - std::tr1::bind(&CBC_Encryption::cbc_final, this, _1, _2), + buf_op(std::tr1::bind(&CBC_Encryption::buffered_proc_block, this, _1, _2), + std::tr1::bind(&CBC_Encryption::buffered_final, this, _1, _2), 2 * cipher->BLOCK_SIZE) { if(!padder->valid_blocksize(cipher->BLOCK_SIZE)) @@ -65,7 +65,7 @@ void CBC_Encryption::set_iv(const InitializationVector& iv) /* * Encrypt in CBC mode */ -void CBC_Encryption::cbc_encrypt(const byte input[], u32bit length) +void CBC_Encryption::buffered_proc_block(const byte input[], u32bit length) { u32bit blocks = length / state.size(); @@ -80,10 +80,10 @@ void CBC_Encryption::cbc_encrypt(const byte input[], u32bit length) /* * Finish encrypting in CBC mode */ -void CBC_Encryption::cbc_final(const byte input[], u32bit length) +void CBC_Encryption::buffered_final(const byte input[], u32bit length) { if(length % cipher->BLOCK_SIZE == 0) - cbc_encrypt(input, length); + buffered_proc_block(input, length); else if(length != 0) throw Exception(name() + ": Did not pad to full blocksize"); } @@ -120,8 +120,8 @@ std::string CBC_Encryption::name() const CBC_Decryption::CBC_Decryption(BlockCipher* ciph, BlockCipherModePaddingMethod* pad) : cipher(ciph), padder(pad), - buf_op(std::tr1::bind(&CBC_Decryption::cbc_decrypt, this, _1, _2), - std::tr1::bind(&CBC_Decryption::cbc_final, this, _1, _2), + buf_op(std::tr1::bind(&CBC_Decryption::buffered_proc_block, this, _1, _2), + std::tr1::bind(&CBC_Decryption::buffered_final, this, _1, _2), BOTAN_PARALLEL_BLOCKS_CBC * cipher->BLOCK_SIZE, cipher->BLOCK_SIZE) { @@ -140,8 +140,8 @@ CBC_Decryption::CBC_Decryption(BlockCipher* ciph, const SymmetricKey& key, const InitializationVector& iv) : cipher(ciph), padder(pad), - buf_op(std::tr1::bind(&CBC_Decryption::cbc_decrypt, this, _1, _2), - std::tr1::bind(&CBC_Decryption::cbc_final, this, _1, _2), + buf_op(std::tr1::bind(&CBC_Decryption::buffered_proc_block, this, _1, _2), + std::tr1::bind(&CBC_Decryption::buffered_final, this, _1, _2), BOTAN_PARALLEL_BLOCKS_CBC * cipher->BLOCK_SIZE, cipher->BLOCK_SIZE) { @@ -170,7 +170,7 @@ void CBC_Decryption::set_iv(const InitializationVector& iv) /* * Decrypt in CBC mode */ -void CBC_Decryption::cbc_decrypt(const byte input[], u32bit length) +void CBC_Decryption::buffered_proc_block(const byte input[], u32bit length) { const u32bit blocks_in_temp = temp.size() / cipher->BLOCK_SIZE; u32bit blocks = length / cipher->BLOCK_SIZE; @@ -200,14 +200,14 @@ void CBC_Decryption::cbc_decrypt(const byte input[], u32bit length) /* * Finish encrypting in CBC mode */ -void CBC_Decryption::cbc_final(const byte input[], u32bit length) +void CBC_Decryption::buffered_final(const byte input[], u32bit length) { if(length == 0 || length % cipher->BLOCK_SIZE != 0) throw Decoding_Error(name() + ": Ciphertext not multiple of block size"); size_t extra_blocks = (length - 1) / cipher->BLOCK_SIZE; - cbc_decrypt(input, extra_blocks * cipher->BLOCK_SIZE); + buffered_proc_block(input, extra_blocks * cipher->BLOCK_SIZE); input += extra_blocks * cipher->BLOCK_SIZE; diff --git a/src/filters/modes/cbc/cbc.h b/src/filters/modes/cbc/cbc.h index 8fa322260..f5c4e280c 100644 --- a/src/filters/modes/cbc/cbc.h +++ b/src/filters/modes/cbc/cbc.h @@ -40,8 +40,8 @@ class BOTAN_DLL CBC_Encryption : public Keyed_Filter ~CBC_Encryption() { delete padder; } private: - void cbc_encrypt(const byte input[], u32bit input_length); - void cbc_final(const byte input[], u32bit input_length); + void buffered_proc_block(const byte input[], u32bit input_length); + void buffered_final(const byte input[], u32bit input_length); void write(const byte input[], u32bit input_length); void end_msg(); @@ -77,8 +77,8 @@ class BOTAN_DLL CBC_Decryption : public Keyed_Filter ~CBC_Decryption() { delete padder; } private: - void cbc_decrypt(const byte input[], u32bit input_length); - void cbc_final(const byte input[], u32bit input_length); + void buffered_proc_block(const byte input[], u32bit input_length); + void buffered_final(const byte input[], u32bit input_length); void write(const byte[], u32bit); void end_msg(); diff --git a/src/filters/modes/xts/xts.cpp b/src/filters/modes/xts/xts.cpp index 9615d26da..265440e65 100644 --- a/src/filters/modes/xts/xts.cpp +++ b/src/filters/modes/xts/xts.cpp @@ -41,8 +41,8 @@ void poly_double(byte tweak[], u32bit size) */ XTS_Encryption::XTS_Encryption(BlockCipher* ciph) : cipher(ciph), - buf_op(std::tr1::bind(&XTS_Encryption::xts_encrypt, this, _1, _2), - std::tr1::bind(&XTS_Encryption::xts_final, this, _1, _2), + buf_op(std::tr1::bind(&XTS_Encryption::buffered_proc_block, this, _1, _2), + std::tr1::bind(&XTS_Encryption::buffered_final, this, _1, _2), 2 * cipher->BLOCK_SIZE, cipher->BLOCK_SIZE + 1) { if(cipher->BLOCK_SIZE != 8 && cipher->BLOCK_SIZE != 16) @@ -59,8 +59,8 @@ XTS_Encryption::XTS_Encryption(BlockCipher* ciph, const SymmetricKey& key, const InitializationVector& iv) : cipher(ciph), - buf_op(std::tr1::bind(&XTS_Encryption::xts_encrypt, this, _1, _2), - std::tr1::bind(&XTS_Encryption::xts_final, this, _1, _2), + buf_op(std::tr1::bind(&XTS_Encryption::buffered_proc_block, this, _1, _2), + std::tr1::bind(&XTS_Encryption::buffered_final, this, _1, _2), 2 * cipher->BLOCK_SIZE, cipher->BLOCK_SIZE + 1) { if(cipher->BLOCK_SIZE != 8 && cipher->BLOCK_SIZE != 16) @@ -130,7 +130,7 @@ void XTS_Encryption::end_msg() buf_op.final(); } -void XTS_Encryption::xts_encrypt(const byte input[], u32bit length) +void XTS_Encryption::buffered_proc_block(const byte input[], u32bit length) { const u32bit blocks_in_tweak = tweak.size() / cipher->BLOCK_SIZE; u32bit blocks = length / cipher->BLOCK_SIZE; @@ -171,14 +171,14 @@ void XTS_Encryption::xts_encrypt(const byte input[], u32bit length) /* * Finish encrypting in XTS mode */ -void XTS_Encryption::xts_final(const byte input[], u32bit length) +void XTS_Encryption::buffered_final(const byte input[], u32bit length) { if(length <= cipher->BLOCK_SIZE) throw Exception("XTS_Encryption: insufficient data to encrypt"); if(length % cipher->BLOCK_SIZE == 0) { - xts_encrypt(input, length); + buffered_proc_block(input, length); } else { // steal ciphertext diff --git a/src/filters/modes/xts/xts.h b/src/filters/modes/xts/xts.h index 4ee00efe7..b382e1abb 100644 --- a/src/filters/modes/xts/xts.h +++ b/src/filters/modes/xts/xts.h @@ -39,8 +39,8 @@ class BOTAN_DLL XTS_Encryption : public Keyed_Filter void write(const byte[], u32bit); void end_msg(); - void xts_encrypt(const byte input[], u32bit input_length); - void xts_final(const byte input[], u32bit input_length); + void buffered_proc_block(const byte input[], u32bit input_length); + void buffered_final(const byte input[], u32bit input_length); BlockCipher* cipher; BlockCipher* cipher2; |