diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-02-06 04:39:39 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-02-06 06:18:28 +0100 |
commit | a89544226aee7d3fee1646feb779c0e04dda66e5 (patch) | |
tree | 4752ae97a01995f10858027d76013092be46ca4c | |
parent | 8ca2010beb7efc5778a673a11b14fb982dc8f114 (diff) | |
download | gnutls-a89544226aee7d3fee1646feb779c0e04dda66e5.tar.gz |
accelerated: fix use of SSSE3 vpaes_encrypttmp-gnutls_3_3_x-aesni-fix
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 <nmav@gnutls.org>
-rw-r--r-- | lib/accelerated/x86/aes-gcm-x86-ssse3.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/accelerated/x86/aes-gcm-x86-ssse3.c b/lib/accelerated/x86/aes-gcm-x86-ssse3.c index 1ca54164a9..f828f0a3b1 100644 --- a/lib/accelerated/x86/aes-gcm-x86-ssse3.c +++ b/lib/accelerated/x86/aes-gcm-x86-ssse3.c @@ -53,8 +53,14 @@ static void x86_aes_encrypt(void *_ctx, #endif { AES_KEY *ctx = (void*)_ctx; + unsigned i; + unsigned blocks = (length+15) / 16; - vpaes_encrypt(src, dst, ctx); + for (i=0;i<blocks;i++) { + vpaes_encrypt(src, dst, ctx); + dst += 16; + src += 16; + } } #ifdef USE_NETTLE3 |