I am trying to use AES GCM encryption mechanism provided by OpenSSL in C++ and using example on this link as reference: https://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption
However, following statement gives me error:
/* Set IV length if default 12 bytes (96 bits) is not appropriate */
if(1 != EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 16, NULL))
handleErrors();
The error that I get is:
error: ‘EVP_CTRL_GCM_SET_IVLEN’ was not declared in this scope".
I do not understand, why I cannot set IVLEN to 16 bytes? I do not want to use the default value of 12 bytes. Any pointers will be great.