mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Refactored RSA to have random generator in every RSA operation
Primarily so that rsa_private() receives an RNG for blinding purposes.
This commit is contained in:
parent
ca174fef80
commit
548957dd49
11 changed files with 132 additions and 49 deletions
|
|
@ -197,7 +197,7 @@ int main( int argc, char *argv[] )
|
|||
printf( " . Generating the RSA decrypted value for OpenSSL (PUBLIC) with PolarSSL (PRIVATE) ..." );
|
||||
fflush( stdout );
|
||||
|
||||
if( ( ret = rsa_pkcs1_decrypt( &p_rsa, RSA_PRIVATE, &olen, o_pub_encrypted, p_pub_decrypted, 1024 ) ) != 0 )
|
||||
if( ( ret = rsa_pkcs1_decrypt( &p_rsa, ctr_drbg_random, &ctr_drbg, RSA_PRIVATE, &olen, o_pub_encrypted, p_pub_decrypted, 1024 ) ) != 0 )
|
||||
{
|
||||
printf( " failed\n ! rsa_pkcs1_decrypt returned %d\n\n", ret );
|
||||
}
|
||||
|
|
@ -221,7 +221,7 @@ int main( int argc, char *argv[] )
|
|||
printf( " . Generating the RSA decrypted value for OpenSSL (PRIVATE) with PolarSSL (PUBLIC) ..." );
|
||||
fflush( stdout );
|
||||
|
||||
if( ( ret = rsa_pkcs1_decrypt( &p_rsa, RSA_PUBLIC, &olen, o_priv_encrypted, p_priv_decrypted, 1024 ) ) != 0 )
|
||||
if( ( ret = rsa_pkcs1_decrypt( &p_rsa, NULL, NULL, RSA_PUBLIC, &olen, o_priv_encrypted, p_priv_decrypted, 1024 ) ) != 0 )
|
||||
{
|
||||
printf( " failed\n ! rsa_pkcs1_decrypt returned %d\n\n", ret );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue