diff --git a/module/icp/algs/modes/gcm.c b/module/icp/algs/modes/gcm.c index 21f4301d5..8a65a4066 100644 --- a/module/icp/algs/modes/gcm.c +++ b/module/icp/algs/modes/gcm.c @@ -1426,7 +1426,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, @@ -1455,6 +1454,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);