From: Andy Polyakov Date: Sat, 23 Apr 2011 09:15:03 +0000 (+0000) Subject: xts128.c: fix bug introduced in commit#20704. Bug affected encryption of X-Git-Tag: OpenSSL-fips-2_0-rc1~511 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e5fe439b4e8fb4198f241f2ba16a029a480d5f5;p=openssl xts128.c: fix bug introduced in commit#20704. Bug affected encryption of vectors whose lenght was not multiples of 16 bytes. --- diff --git a/crypto/modes/xts128.c b/crypto/modes/xts128.c index ebdc5ea649..e7f1641070 100644 --- a/crypto/modes/xts128.c +++ b/crypto/modes/xts128.c @@ -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;