Skip to content

Commit

Permalink
CRYPTO_gcm128_decrypt: fix mac or tag calculation
Browse files Browse the repository at this point in the history
The incorrect code is in #ifdef branch that is normally
not compiled in.

Signed-off-by: Zhang Jinde <zjd5536@163.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl#12968)
  • Loading branch information
zjd87 authored and t8m committed Feb 19, 2021
1 parent 3352dc1 commit 1d724b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/modes/gcm128.c
Expand Up @@ -1359,8 +1359,8 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
else
ctx->Yi.d[3] = ctr;
for (i = 0; i < 16 / sizeof(size_t); ++i) {
size_t c = in[i];
out[i] = c ^ ctx->EKi.t[i];
size_t c = in_t[i];
out_t[i] = c ^ ctx->EKi.t[i];
ctx->Xi.t[i] ^= c;
}
GCM_MUL(ctx);
Expand Down

0 comments on commit 1d724b5

Please sign in to comment.