From: Nikos Mavrogiannopoulos Date: Tue, 6 Feb 2018 03:39:39 +0000 (+0100) Subject: accelerated: fix use of SSSE3 vpaes_encrypt X-Git-Tag: gnutls_3_6_2~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efe97d3fe89430d1494e8aebd5404173b6c80f0a;p=thirdparty%2Fgnutls.git accelerated: fix use of SSSE3 vpaes_encrypt Previously we assumed that the nettle GCM internal functions will use the provided ECB function for single block encryption. Newer versions no longer operate that way. Ensure that we are compatible with them. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/lib/accelerated/x86/aes-gcm-x86-ssse3.c b/lib/accelerated/x86/aes-gcm-x86-ssse3.c index 512a8cffd7..52759f9b63 100644 --- a/lib/accelerated/x86/aes-gcm-x86-ssse3.c +++ b/lib/accelerated/x86/aes-gcm-x86-ssse3.c @@ -47,8 +47,14 @@ static void x86_aes_encrypt(const void *_ctx, const uint8_t * src) { AES_KEY *ctx = (void*)_ctx; + unsigned i; + unsigned blocks = (length+15) / 16; - vpaes_encrypt(src, dst, ctx); + for (i=0;i