/mbedtls-development/library/ |
A D | psa_crypto_rsa.c | 189 mbedtls_rsa_free( rsa ); in rsa_import_key() 190 mbedtls_free( rsa ); in rsa_import_key() 208 pk.pk_ctx = rsa; in mbedtls_psa_rsa_export_key() 243 (void) rsa; in mbedtls_psa_rsa_export_key() 270 mbedtls_rsa_free( rsa ); in rsa_export_public_key() 271 mbedtls_free( rsa ); in rsa_export_public_key() 311 mbedtls_rsa_context rsa; in rsa_generate_key() local 450 mbedtls_rsa_free( rsa ); in rsa_sign_hash() 451 mbedtls_free( rsa ); in rsa_sign_hash() 552 mbedtls_rsa_free( rsa ); in rsa_verify_hash() [all …]
|
A D | pkwrite.c | 73 mbedtls_rsa_context *rsa ) in pk_write_rsa_pubkey() argument 82 if ( ( ret = mbedtls_rsa_export( rsa, NULL, NULL, NULL, NULL, &T ) ) != 0 || in pk_write_rsa_pubkey() 330 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( *key ); in mbedtls_pk_write_key_der() local 339 if( ( ret = mbedtls_rsa_export_crt( rsa, NULL, NULL, &T ) ) != 0 || in mbedtls_pk_write_key_der() 345 if( ( ret = mbedtls_rsa_export_crt( rsa, NULL, &T, NULL ) ) != 0 || in mbedtls_pk_write_key_der() 351 if( ( ret = mbedtls_rsa_export_crt( rsa, &T, NULL, NULL ) ) != 0 || in mbedtls_pk_write_key_der() 357 if ( ( ret = mbedtls_rsa_export( rsa, NULL, NULL, in mbedtls_pk_write_key_der() 364 if ( ( ret = mbedtls_rsa_export( rsa, NULL, &T, in mbedtls_pk_write_key_der() 371 if ( ( ret = mbedtls_rsa_export( rsa, NULL, NULL, in mbedtls_pk_write_key_der() 378 if ( ( ret = mbedtls_rsa_export( rsa, NULL, NULL, in mbedtls_pk_write_key_der() [all …]
|
A D | pk_wrap.c | 74 return( 8 * mbedtls_rsa_get_len( rsa ) ); in rsa_get_bitlen() 82 mbedtls_rsa_context * rsa = (mbedtls_rsa_context *) ctx; in rsa_verify_wrap() local 83 size_t rsa_len = mbedtls_rsa_get_len( rsa ); in rsa_verify_wrap() 93 if( ( ret = mbedtls_rsa_pkcs1_verify( rsa, md_alg, in rsa_verify_wrap() 114 mbedtls_rsa_context * rsa = (mbedtls_rsa_context *) ctx; in rsa_sign_wrap() local 121 *sig_len = mbedtls_rsa_get_len( rsa ); in rsa_sign_wrap() 125 return( mbedtls_rsa_pkcs1_sign( rsa, f_rng, p_rng, in rsa_sign_wrap() 137 if( ilen != mbedtls_rsa_get_len( rsa ) ) in rsa_decrypt_wrap() 140 return( mbedtls_rsa_pkcs1_decrypt( rsa, f_rng, p_rng, in rsa_decrypt_wrap() 150 *olen = mbedtls_rsa_get_len( rsa ); in rsa_encrypt_wrap() [all …]
|
A D | pkparse.c | 525 mbedtls_rsa_context *rsa ) in pk_get_rsapubkey() argument 558 if( mbedtls_rsa_complete( rsa ) != 0 || in pk_get_rsapubkey() 559 mbedtls_rsa_check_pubkey( rsa ) != 0 ) in pk_get_rsapubkey() 755 ( ret = mbedtls_rsa_import( rsa, &T, NULL, NULL, in pk_parse_key_pkcs1_der() 773 ( ret = mbedtls_rsa_import( rsa, NULL, &T, NULL, in pk_parse_key_pkcs1_der() 779 ( ret = mbedtls_rsa_import( rsa, NULL, NULL, &T, in pk_parse_key_pkcs1_der() 797 ( ret = mbedtls_mpi_copy( &rsa->DP, &T ) ) != 0 ) in pk_parse_key_pkcs1_der() 802 ( ret = mbedtls_mpi_copy( &rsa->DQ, &T ) ) != 0 ) in pk_parse_key_pkcs1_der() 827 if( ( ret = mbedtls_rsa_complete( rsa ) ) != 0 || in pk_parse_key_pkcs1_der() 828 ( ret = mbedtls_rsa_check_pubkey( rsa ) ) != 0 ) in pk_parse_key_pkcs1_der() [all …]
|
A D | psa_crypto.c | 1136 const mbedtls_rsa_context *rsa, in psa_get_rsa_public_exponent() argument 1220 &rsa ); in psa_get_key_attributes() 1226 mbedtls_rsa_free( rsa ); in psa_get_key_attributes() 1227 mbedtls_free( rsa ); in psa_get_key_attributes() 1851 mbedtls_rsa_free( rsa ); in psa_validate_optional_attributes() 1852 mbedtls_free( rsa ); in psa_validate_optional_attributes() 3078 mbedtls_rsa_context *rsa = NULL; in psa_asymmetric_encrypt() local 3131 mbedtls_rsa_free( rsa ); in psa_asymmetric_encrypt() 3132 mbedtls_free( rsa ); in psa_asymmetric_encrypt() 3239 mbedtls_rsa_free( rsa ); in psa_asymmetric_decrypt() [all …]
|
A D | rsa.c | 2585 mbedtls_rsa_context rsa; in mbedtls_rsa_self_test() local 2596 mbedtls_rsa_init( &rsa ); in mbedtls_rsa_self_test() 2599 MBEDTLS_MPI_CHK( mbedtls_rsa_import( &rsa, &K, NULL, NULL, NULL, NULL ) ); in mbedtls_rsa_self_test() 2609 MBEDTLS_MPI_CHK( mbedtls_rsa_complete( &rsa ) ); in mbedtls_rsa_self_test() 2614 if( mbedtls_rsa_check_pubkey( &rsa ) != 0 || in mbedtls_rsa_self_test() 2615 mbedtls_rsa_check_privkey( &rsa ) != 0 ) in mbedtls_rsa_self_test() 2629 if( mbedtls_rsa_pkcs1_encrypt( &rsa, myrand, NULL, in mbedtls_rsa_self_test() 2643 if( mbedtls_rsa_pkcs1_decrypt( &rsa, myrand, NULL, in mbedtls_rsa_self_test() 2678 if( mbedtls_rsa_pkcs1_sign( &rsa, myrand, NULL, in mbedtls_rsa_self_test() 2692 if( mbedtls_rsa_pkcs1_verify( &rsa, MBEDTLS_MD_SHA1, 20, in mbedtls_rsa_self_test() [all …]
|
/mbedtls-development/programs/pkey/ |
A D | rsa_verify.c | 60 mbedtls_rsa_context rsa; in main() local 65 mbedtls_rsa_init( &rsa ); in main() 88 if( ( ret = mbedtls_mpi_read_file( &rsa.MBEDTLS_PRIVATE(N), 16, f ) ) != 0 || in main() 89 ( ret = mbedtls_mpi_read_file( &rsa.MBEDTLS_PRIVATE(E), 16, f ) ) != 0 ) in main() 96 rsa.MBEDTLS_PRIVATE(len) = ( mbedtls_mpi_bitlen( &rsa.MBEDTLS_PRIVATE(N) ) + 7 ) >> 3; in main() 118 if( i != rsa.MBEDTLS_PRIVATE(len) ) in main() 139 if( ( ret = mbedtls_rsa_pkcs1_verify( &rsa, MBEDTLS_MD_SHA256, in main() 152 mbedtls_rsa_free( &rsa ); in main()
|
A D | rsa_sign.c | 60 mbedtls_rsa_context rsa; in main() local 66 mbedtls_rsa_init( &rsa ); in main() 108 if( ( ret = mbedtls_rsa_import( &rsa, &N, &P, &Q, &D, &E ) ) != 0 ) in main() 115 if( ( ret = mbedtls_rsa_complete( &rsa ) ) != 0 ) in main() 124 if( ( ret = mbedtls_rsa_check_privkey( &rsa ) ) != 0 ) in main() 145 if( ( ret = mbedtls_rsa_pkcs1_sign( &rsa, NULL, NULL, MBEDTLS_MD_SHA256, in main() 163 for( i = 0; i < rsa.MBEDTLS_PRIVATE(len); i++ ) in main() 175 mbedtls_rsa_free( &rsa ); in main()
|
A D | dh_client.c | 86 mbedtls_rsa_context rsa; in main() local 123 mbedtls_rsa_init( &rsa ); in main() 125 if( ( ret = mbedtls_mpi_read_file( &rsa.MBEDTLS_PRIVATE(N), 16, f ) ) != 0 || in main() 126 ( ret = mbedtls_mpi_read_file( &rsa.MBEDTLS_PRIVATE(E), 16, f ) ) != 0 ) in main() 133 rsa.MBEDTLS_PRIVATE(len) = ( mbedtls_mpi_bitlen( &rsa.MBEDTLS_PRIVATE(N) ) + 7 ) >> 3; in main() 207 if( ( n = (size_t) ( end - p ) ) != rsa.MBEDTLS_PRIVATE(len) ) in main() 219 if( ( ret = mbedtls_rsa_pkcs1_verify( &rsa, MBEDTLS_MD_SHA256, in main() 298 mbedtls_rsa_free( &rsa ); in main()
|
A D | rsa_encrypt.c | 63 mbedtls_rsa_context rsa; in main() local 86 mbedtls_rsa_init( &rsa ); in main() 120 if( ( ret = mbedtls_rsa_import( &rsa, &N, NULL, NULL, NULL, &E ) ) != 0 ) in main() 141 ret = mbedtls_rsa_pkcs1_encrypt( &rsa, mbedtls_ctr_drbg_random, in main() 159 for( i = 0; i < rsa.MBEDTLS_PRIVATE(len); i++ ) in main() 173 mbedtls_rsa_free( &rsa ); in main()
|
A D | rsa_decrypt.c | 64 mbedtls_rsa_context rsa; in main() local 89 mbedtls_rsa_init( &rsa ); in main() 132 if( ( ret = mbedtls_rsa_import( &rsa, &N, &P, &Q, &D, &E ) ) != 0 ) in main() 139 if( ( ret = mbedtls_rsa_complete( &rsa ) ) != 0 ) in main() 163 if( i != rsa.MBEDTLS_PRIVATE(len) ) in main() 175 ret = mbedtls_rsa_pkcs1_decrypt( &rsa, mbedtls_ctr_drbg_random, in main() 194 mbedtls_rsa_free( &rsa ); in main()
|
A D | dh_server.c | 86 mbedtls_rsa_context rsa; in main() local 129 mbedtls_rsa_init( &rsa ); in main() 144 if( ( ret = mbedtls_rsa_import( &rsa, &N, &P, &Q, &D, &E ) ) != 0 ) in main() 151 if( ( ret = mbedtls_rsa_complete( &rsa ) ) != 0 ) in main() 224 buf[n ] = (unsigned char)( rsa.MBEDTLS_PRIVATE(len) >> 8 ); in main() 225 buf[n + 1] = (unsigned char)( rsa.MBEDTLS_PRIVATE(len) ); in main() 227 if( ( ret = mbedtls_rsa_pkcs1_sign( &rsa, NULL, NULL, MBEDTLS_MD_SHA256, in main() 234 buflen = n + 2 + rsa.MBEDTLS_PRIVATE(len); in main() 320 mbedtls_rsa_free( &rsa ); in main()
|
A D | rsa_genkey.c | 65 mbedtls_rsa_context rsa; in main() local 74 mbedtls_rsa_init( &rsa ); in main() 94 if( ( ret = mbedtls_rsa_gen_key( &rsa, mbedtls_ctr_drbg_random, &ctr_drbg, KEY_SIZE, in main() 104 if( ( ret = mbedtls_rsa_export ( &rsa, &N, &P, &Q, &D, &E ) ) != 0 || in main() 105 ( ret = mbedtls_rsa_export_crt( &rsa, &DP, &DQ, &QP ) ) != 0 ) in main() 160 mbedtls_rsa_free( &rsa ); in main()
|
A D | key_app.c | 218 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk ); in main() local 220 if( ( ret = mbedtls_rsa_export ( rsa, &N, &P, &Q, &D, &E ) ) != 0 || in main() 221 ( ret = mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP ) ) != 0 ) in main() 276 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk ); in main() local 278 if( ( ret = mbedtls_rsa_export( rsa, &N, NULL, NULL, in main()
|
A D | key_app_writer.c | 337 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( key ); in main() local 339 if( ( ret = mbedtls_rsa_export ( rsa, &N, &P, &Q, &D, &E ) ) != 0 || in main() 340 ( ret = mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP ) ) != 0 ) in main() 397 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( key ); in main() local 399 if( ( ret = mbedtls_rsa_export( rsa, &N, NULL, NULL, in main()
|
A D | gen_key.c | 369 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( key ); in main() local 371 if( ( ret = mbedtls_rsa_export ( rsa, &N, &P, &Q, &D, &E ) ) != 0 || in main() 372 ( ret = mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP ) ) != 0 ) in main()
|
/mbedtls-development/programs/fuzz/ |
A D | fuzz_pubkey.c | 19 mbedtls_rsa_context *rsa; in LLVMFuzzerTestOneInput() local 25 rsa = mbedtls_pk_rsa( pk ); in LLVMFuzzerTestOneInput() 26 if ( mbedtls_rsa_export( rsa, &N, NULL, NULL, NULL, &E ) != 0 ) { in LLVMFuzzerTestOneInput() 29 if ( mbedtls_rsa_export( rsa, &N, &P, &Q, &D, &E ) != MBEDTLS_ERR_RSA_BAD_INPUT_DATA ) { in LLVMFuzzerTestOneInput() 32 if ( mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP ) != MBEDTLS_ERR_RSA_BAD_INPUT_DATA ) { in LLVMFuzzerTestOneInput()
|
A D | fuzz_privkey.c | 30 mbedtls_rsa_context *rsa; in LLVMFuzzerTestOneInput() local 36 rsa = mbedtls_pk_rsa( pk ); in LLVMFuzzerTestOneInput() 37 if ( mbedtls_rsa_export( rsa, &N, &P, &Q, &D, &E ) != 0 ) { in LLVMFuzzerTestOneInput() 40 if ( mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP ) != 0 ) { in LLVMFuzzerTestOneInput()
|
/mbedtls-development/tests/suites/ |
A D | test_suite_pkparse.function | 31 mbedtls_rsa_context *rsa; 33 rsa = mbedtls_pk_rsa( ctx ); 34 TEST_ASSERT( mbedtls_rsa_check_privkey( rsa ) == 0 ); 56 mbedtls_rsa_context *rsa; 58 rsa = mbedtls_pk_rsa( ctx ); 59 TEST_ASSERT( mbedtls_rsa_check_pubkey( rsa ) == 0 );
|
A D | test_suite_pk.function | 8 #include "mbedtls/rsa.h" 386 mbedtls_rsa_context *rsa; 403 rsa = mbedtls_pk_rsa( pk ); 405 rsa->len = mod / 8; 435 mbedtls_rsa_context *rsa; 446 rsa = mbedtls_pk_rsa( pk ); 448 rsa->len = mod / 8; 716 mbedtls_rsa_context *rsa; 728 rsa->len = mod / 8; 752 mbedtls_rsa_context *rsa; [all …]
|
/mbedtls-development/tests/data_files/ |
A D | .gitignore | 1 cli-rsa.csr 2 server2-rsa.csr
|
A D | Makefile | 193 cli_crt_key_file_rsa = cli-rsa.key 196 cli-rsa.csr: $(cli_crt_key_file_rsa) 198 all_intermediate += cli-rsa.csr 200 cli-rsa-sha1.crt: cli-rsa.csr 203 cli-rsa-sha256.crt: cli-rsa.csr 205 all_final += cli-rsa-sha256.crt 207 cli-rsa-sha256.crt.der: cli-rsa-sha256.crt 209 all_final += cli-rsa-sha256.crt.der 211 cli-rsa-sha256-badalg.crt.der: cli-rsa-sha256.crt.der 215 cli-rsa.key.der: $(cli_crt_key_file_rsa) [all …]
|
A D | cli.opensslconf | 1 [cli-rsa]
|
A D | Readme-x509.txt | 60 - cli-rsa.key, cli-rsa-*.crt: RSA key used for test clients, signed by 113 - crl-rsa-pss-*.pem: (1) server9{,badsign,with-ca}.crt + cert_sha384.crt + unknown 118 rsa = crl.pem, rsabadpem = same with pem error, rsaexp = crl_expired.pem 121 crl-rsa-pss* would revoke server6.crt if signed by CA 2
|
/mbedtls-development/programs/test/ |
A D | benchmark.c | 543 rsa, dhm, ecdsa, ecdh; member 619 todo.rsa = 1; in main() 983 if( todo.rsa ) in main() 986 mbedtls_rsa_context rsa; in main() local 991 mbedtls_rsa_init( &rsa ); in main() 992 mbedtls_rsa_gen_key( &rsa, myrand, NULL, keysize, 65537 ); in main() 996 ret = mbedtls_rsa_public( &rsa, buf, buf ) ); in main() 1000 ret = mbedtls_rsa_private( &rsa, myrand, NULL, buf, buf ) ); in main() 1002 mbedtls_rsa_free( &rsa ); in main()
|