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:17:56 +0100 |
commit | a46a56808a23c7fda7cd75f72aa6e8f1e9001844 (patch) | |
tree | 4afa43b4d98f30f697760c11cf2a8118097c1980 | |
parent | 6cc63d65d0d50e26004958f13ce80c8890fa7a8a (diff) | |
download | gnutls-tmp-gnutls_3_5_x-aesni-fix.tar.gz |
accelerated: fix use of SSSE3 vpaes_encrypttmp-gnutls_3_5_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 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, |