I am a new tried to make some test with mbedtls; I want to call some basic function from library as a result I wrote a script to call mbedtls_gen_key functions from library.
Now I am trying to generate an RSA key pair :
mbedtls_rsa_context ctx; mbedtls_ctr_drbg_context ctr_drbg; mbedtls_ctr_drbg_init( &ctr_drbg ); mbedtls_rsa_init(&ctx, MBEDTLS_RSA_PKCS_V15, 0); mbedtls_rsa_gen_key(&ctx, mbedtls_ctr_drbg_random, &ctr_drbg,2048, 65537);
I could compile the code however when I try to run the code it will said
“Segmentation fault (core dumped)”
in the command line.
Is something wrong with the pointer when I tried to called the function mbedtls_rsa_gen_key?