I'm using OpenSSL EVP_Encrypt APIs, with AES_ctr_128 mode. I'm trying to retrieve the updated (incremented counter) In OpenSSL 1.1.0 we CANNOT simply do:
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
/*
EVP_EncryptInit(ctx, ...);
EVP_EncryptUpdate(ctx, ...);
EVP_EncryptFinal(ctx, ...);
*/
memcpy(iv, ctx->iv, sizeof(ctx->iv);
since the ctx structure is hidden (getting incomplete type error with the above code).
Also there is no any get API for this field.
Is there any way to get the updated IV buffer stored in EVP_CIPHER_ctx structure (Incremented IV)?