I’m trying to upgrade from 2.16.0 to 3 and it worked fine except one issue. I have compiled with GCM. I’m calling mbedtls_cipher_crypt()
and it gives different result from previously. Looking deeper I see that the function calls mbedtls_cipher_set_iv()
and that have added this piece of code:
if( MBEDTLS_MODE_GCM == ctx->cipher_info->mode )
{
return( mbedtls_gcm_starts( (mbedtls_gcm_context *) ctx->cipher_ctx,
ctx->operation,
iv, iv_len ) );
}
So that is the reason. But reading the upgrade guide from 2 to 3 it says:
“mbedtls_cipher_xxx or psa_aead_xxx interfaces do not require any changes”
So this seems strange.
Is this a bug? What can I do to make the mbedtls_cipher_crypt()
call behave as before? I am using using GCM in other parts of the code, so removing that is not an option.