From eddf0d75e60740017de20301bcf5dffef9dfbb95 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 4 Aug 2015 22:06:44 -0400 Subject: For CBC, ECB, and XTS the output length of a zero length input is well defined, so don't fail. Fix XTS, as XTS always uses ciphertext stealing the value of output_length had been incorrect in rounding up to the block size. --- src/lib/modes/xts/xts.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/lib/modes/xts/xts.cpp') diff --git a/src/lib/modes/xts/xts.cpp b/src/lib/modes/xts/xts.cpp index 4eaf03fe5..046de216f 100644 --- a/src/lib/modes/xts/xts.cpp +++ b/src/lib/modes/xts/xts.cpp @@ -135,8 +135,7 @@ void XTS_Mode::update_tweak(size_t which) size_t XTS_Encryption::output_length(size_t input_length) const { - BOTAN_ASSERT(input_length != 0, "XTS_Encryption::output_length() call"); - return round_up(input_length, cipher().block_size()); + return input_length; } void XTS_Encryption::update(secure_vector& buffer, size_t offset) @@ -214,7 +213,6 @@ void XTS_Encryption::finish(secure_vector& buffer, size_t offset) size_t XTS_Decryption::output_length(size_t input_length) const { - // might be less return input_length; } -- cgit v1.2.3