diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-02-06 03:59:17 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-02-06 06:33:50 +0100 |
commit | 93f3ac97e25f2503341a1a7fddd36b87e12a8b62 (patch) | |
tree | dc93895d287fc680a5c93d517d1437f5957b7090 | |
parent | efe97d3fe89430d1494e8aebd5404173b6c80f0a (diff) | |
download | gnutls-93f3ac97e25f2503341a1a7fddd36b87e12a8b62.tar.gz |
accelerated: aarch64: fix GCM counter increment
Ensure that we restrict the GCM counter to the 4 bytes assigned to it.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r-- | lib/accelerated/aarch64/aes-gcm-aarch64.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/accelerated/aarch64/aes-gcm-aarch64.c b/lib/accelerated/aarch64/aes-gcm-aarch64.c index 8d2bc1dce2..677f213f12 100644 --- a/lib/accelerated/aarch64/aes-gcm-aarch64.c +++ b/lib/accelerated/aarch64/aes-gcm-aarch64.c @@ -37,6 +37,7 @@ #include <byteswap.h> #define GCM_BLOCK_SIZE 16 +#define INC32(block) INCREMENT(4, block + GCM_BLOCK_SIZE - 4) /* GCM mode */ @@ -169,7 +170,7 @@ ctr32_encrypt_blocks_inplace(const unsigned char *in, unsigned char *out, out += 16; in += 16; - INCREMENT(16, ctr); + INC32(ctr); } } @@ -192,7 +193,7 @@ ctr32_encrypt_blocks(const unsigned char *in, unsigned char *out, out += 16; in += 16; - INCREMENT(16, ctr); + INC32(ctr); } } |