diff --git a/module/icp/algs/modes/gcm.c b/module/icp/algs/modes/gcm.c index 0a14be5a7..953afd885 100644 --- a/module/icp/algs/modes/gcm.c +++ b/module/icp/algs/modes/gcm.c @@ -1427,7 +1427,6 @@ gcm_init_avx(gcm_ctx_t *ctx, const uint8_t *iv, size_t iv_len, B_FALSE); /* Init H (encrypt zero block) and create the initial counter block. */ - memset(ctx->gcm_ghash, 0, sizeof (ctx->gcm_ghash)); memset(H, 0, sizeof (ctx->gcm_H)); kfpu_begin(); aes_encrypt_intel(keysched, aes_rounds, @@ -1456,6 +1455,8 @@ gcm_init_avx(gcm_ctx_t *ctx, const uint8_t *iv, size_t iv_len, kfpu_begin(); } + memset(ctx->gcm_ghash, 0, sizeof (ctx->gcm_ghash)); + /* Openssl post increments the counter, adjust for that. */ gcm_incr_counter_block(ctx);