In reference to the github project: https://github.com/majek/openssl/blob/master/demos/evp/aesgcm.c
And another StackOverflow question: Unable to set IV for aes gcm using openssl
I'm attempting to use OpenSSL to perform GCM encryption with a 128-bit IV. The default IV is 96-bits, 12 bytes. When I set this to 16-bits the value isn't updated and as a result the encrypted data and IV or not correct.
I tried verifying this using the following function which reads back a value of 12, when I was expecting it to change to 16 after setting it via the second following function:
int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 16, NULL);
And help with be awesome! Thanks!
Chris