Adapt gen_key example program to new RSA interface

This commit is contained in:
Hanno Becker 2017-08-23 06:45:10 +01:00
parent c95fad3566
commit 83aad1fa86
2 changed files with 31 additions and 11 deletions

View file

@ -894,6 +894,9 @@ int mbedtls_rsa_gen_key( mbedtls_rsa_context *ctx,
ctx->len = ( mbedtls_mpi_bitlen( &ctx->N ) + 7 ) >> 3;
/* Double-check */
MBEDTLS_MPI_CHK( mbedtls_rsa_check_privkey( ctx ) );
cleanup:
mbedtls_mpi_free( &P1 ); mbedtls_mpi_free( &Q1 ); mbedtls_mpi_free( &H ); mbedtls_mpi_free( &G );