xts128.c: fix bug introduced in commit#20704. Bug affected encryption of
authorAndy Polyakov <appro@openssl.org>
Sat, 23 Apr 2011 09:15:03 +0000 (09:15 +0000)
committerAndy Polyakov <appro@openssl.org>
Sat, 23 Apr 2011 09:15:03 +0000 (09:15 +0000)
vectors whose lenght was not multiples of 16 bytes.

crypto/modes/xts128.c

index ebdc5ea649d7e8b9c9c3be33ebd85126be411d3d..e7f1641070f3b58fb201c12e999989ee4dc45fa8 100644 (file)
@@ -89,8 +89,8 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16],
                scratch.u[1] ^= tweak.u[1];
                memcpy(out,scratch.c,16);
 #else
-               ((u64*)out)[0] = scratch.u[0]^tweak.u[0];
-               ((u64*)out)[1] = scratch.u[1]^tweak.u[1];
+               ((u64*)out)[0] = scratch.u[0]^=tweak.u[0];
+               ((u64*)out)[1] = scratch.u[1]^=tweak.u[1];
 #endif
                inp += 16;
                out += 16;