I code the following code from https://github.com/openssl/openssl/blob/master/demos/evp/aesgcm.c
I compiled it giving this command: cc aesg.c -lmcrypt I got this error:
aesg.c:66:30: error: ‘EVP_CTRL_AEAD_SET_IVLEN’ undeclared (first use in this function)
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, sizeof(gcm_iv), NULL);
^
aesg.c:66:30: note: each undeclared identifier is reported only once for each function it appears in
aesg.c:79:30: error: ‘EVP_CTRL_AEAD_GET_TAG’ undeclared (first use in this function)
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, 16, outbuf);
^
aesg.c: In function ‘aes_gcm_decrypt’:
aesg.c:98:30: error: ‘EVP_CTRL_AEAD_SET_IVLEN’ undeclared (first use in this function)
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, sizeof(gcm_iv), NULL);
^
aesg.c:109:30: error: ‘EVP_CTRL_AEAD_SET_TAG’ undeclared (first use in this function)
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag),
^
What will be the problem?