Enable multiple XTS encryption or decryption

multiple xts_encrypt() cannot be performed because the
tweak is not updated. That means that
  xts_encrypt(buffer1, tweak)
  xts_encrypt(buffer2, tweak)
is not the same as
  xts_encrypt(concat(buffer1, buffer2), tweak)

Current patch enables such functionalities by
updating the tweak as output of the encryption.
Note that the tweak is no more constant.

The very same modification is performed
on xts_decrypt()

Signed-off-by: Pascal Brand <pascal.brand@st.com>
This commit is contained in:
Pascal Brand
2014-09-18 01:42:54 +02:00
committed by Steffen Jaeckel
parent 824c7bf16a
commit adc54d08d0
4 changed files with 19 additions and 7 deletions
+2 -2
View File
@@ -884,12 +884,12 @@ int xts_start( int cipher,
int xts_encrypt(
const unsigned char *pt, unsigned long ptlen,
unsigned char *ct,
const unsigned char *tweak,
unsigned char *tweak,
symmetric_xts *xts);
int xts_decrypt(
const unsigned char *ct, unsigned long ptlen,
unsigned char *pt,
const unsigned char *tweak,
unsigned char *tweak,
symmetric_xts *xts);
void xts_done(symmetric_xts *xts);