summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2018-02-06 04:39:39 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-02-06 06:15:56 +0100
commitefe97d3fe89430d1494e8aebd5404173b6c80f0a (patch)
treed3f5e372bc7de2825695de0c036869eae66182a9
parent176aa191380e5d63a981f08f537deffdd78f491a (diff)
downloadgnutls-efe97d3fe89430d1494e8aebd5404173b6c80f0a.tar.gz
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 <nmav@gnutls.org>
-rw-r--r--lib/accelerated/x86/aes-gcm-x86-ssse3.c8
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 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<blocks;i++) {
+ vpaes_encrypt(src, dst, ctx);
+ dst += 16;
+ src += 16;
+ }
}
static void x86_aes_128_set_encrypt_key(void *_ctx,