diff --git a/gost_grasshopper_cipher.c b/gost_grasshopper_cipher.c index c6817ba2..5896bea9 100644 --- a/gost_grasshopper_cipher.c +++ b/gost_grasshopper_cipher.c @@ -215,7 +215,7 @@ static int gost_grasshopper_cipher_init(EVP_CIPHER_CTX *ctx, EVP_CIPHER_CTX_set_app_data(ctx, EVP_CIPHER_CTX_get_cipher_data(ctx)); if (enc && c->type == GRASSHOPPER_CIPHER_CTRACPKM) { gost_grasshopper_cipher_ctx_ctr *ctr = EVP_CIPHER_CTX_get_cipher_data(ctx); - if (!ctr->has_kdf_seed && init_zero_kdf_seed(ctr->kdf_seed) == 0) + if (init_zero_kdf_seed(ctr->kdf_seed) == 0) return -1; } } diff --git a/gost_grasshopper_cipher.h b/gost_grasshopper_cipher.h index 6fda4b99..ecaf1c7a 100644 --- a/gost_grasshopper_cipher.h +++ b/gost_grasshopper_cipher.h @@ -33,7 +33,6 @@ typedef struct { unsigned char kdf_seed[8]; unsigned char tag[16]; EVP_MD_CTX *omac_ctx; - int has_kdf_seed; } gost_grasshopper_cipher_ctx_ctr; static void gost_grasshopper_cipher_key(gost_grasshopper_cipher_ctx* c, const uint8_t* k);