Home
last modified time | relevance | path

Searched refs:rsa (Results 1 – 25 of 42) sorted by relevance

12

/mbedtls-3.5.0/library/
Dpsa_crypto_rsa.c55 const mbedtls_rsa_context *rsa) in psa_check_rsa_key_byte_aligned() argument
61 mbedtls_rsa_export(rsa, &n, NULL, NULL, NULL, NULL)); in psa_check_rsa_key_byte_aligned()
139 mbedtls_rsa_context *rsa = NULL; in mbedtls_psa_rsa_import_key() local
145 &rsa); in mbedtls_psa_rsa_import_key()
150 *bits = (psa_key_bits_t) PSA_BYTES_TO_BITS(mbedtls_rsa_get_len(rsa)); in mbedtls_psa_rsa_import_key()
157 rsa, in mbedtls_psa_rsa_import_key()
163 mbedtls_rsa_free(rsa); in mbedtls_psa_rsa_import_key()
164 mbedtls_free(rsa); in mbedtls_psa_rsa_import_key()
170 mbedtls_rsa_context *rsa, in mbedtls_psa_rsa_export_key() argument
181 pk.pk_ctx = rsa; in mbedtls_psa_rsa_export_key()
[all …]
Dpkwrite.c64 mbedtls_rsa_context *rsa) in pk_write_rsa_pubkey() argument
73 if ((ret = mbedtls_rsa_export(rsa, NULL, NULL, NULL, NULL, &T)) != 0 || in pk_write_rsa_pubkey()
80 if ((ret = mbedtls_rsa_export(rsa, &T, NULL, NULL, NULL, NULL)) != 0 || in pk_write_rsa_pubkey()
324 mbedtls_rsa_context *rsa = mbedtls_pk_rsa(*key); in mbedtls_pk_write_key_der() local
333 if ((ret = mbedtls_rsa_export_crt(rsa, NULL, NULL, &T)) != 0 || in mbedtls_pk_write_key_der()
340 if ((ret = mbedtls_rsa_export_crt(rsa, NULL, &T, NULL)) != 0 || in mbedtls_pk_write_key_der()
347 if ((ret = mbedtls_rsa_export_crt(rsa, &T, NULL, NULL)) != 0 || in mbedtls_pk_write_key_der()
354 if ((ret = mbedtls_rsa_export(rsa, NULL, NULL, in mbedtls_pk_write_key_der()
362 if ((ret = mbedtls_rsa_export(rsa, NULL, &T, in mbedtls_pk_write_key_der()
370 if ((ret = mbedtls_rsa_export(rsa, NULL, NULL, in mbedtls_pk_write_key_der()
[all …]
Dpk_wrap.c196 const mbedtls_rsa_context *rsa = (const mbedtls_rsa_context *) ctx; in rsa_get_bitlen() local
197 return 8 * mbedtls_rsa_get_len(rsa); in rsa_get_bitlen()
205 mbedtls_rsa_context *rsa = (mbedtls_rsa_context *) ctx; in rsa_verify_wrap() local
215 size_t rsa_len = mbedtls_rsa_get_len(rsa); in rsa_verify_wrap()
268 mbedtls_rsa_context *rsa = (mbedtls_rsa_context *) ctx; in rsa_verify_wrap() local
269 size_t rsa_len = mbedtls_rsa_get_len(rsa); in rsa_verify_wrap()
279 if ((ret = mbedtls_rsa_pkcs1_verify(rsa, md_alg, in rsa_verify_wrap()
382 mbedtls_rsa_context *rsa = (mbedtls_rsa_context *) ctx; in rsa_sign_wrap() local
388 *sig_len = mbedtls_rsa_get_len(rsa); in rsa_sign_wrap()
393 return mbedtls_rsa_pkcs1_sign(rsa, f_rng, p_rng, in rsa_sign_wrap()
[all …]
Dpkparse.c525 mbedtls_rsa_context *rsa) in pk_get_rsapubkey() argument
545 if ((ret = mbedtls_rsa_import_raw(rsa, *p, len, NULL, 0, NULL, 0, in pk_get_rsapubkey()
557 if ((ret = mbedtls_rsa_import_raw(rsa, NULL, 0, NULL, 0, NULL, 0, in pk_get_rsapubkey()
564 if (mbedtls_rsa_complete(rsa) != 0 || in pk_get_rsapubkey()
565 mbedtls_rsa_check_pubkey(rsa) != 0) { in pk_get_rsapubkey()
714 static int pk_parse_key_pkcs1_der(mbedtls_rsa_context *rsa, in pk_parse_key_pkcs1_der() argument
761 (ret = mbedtls_rsa_import(rsa, &T, NULL, NULL, in pk_parse_key_pkcs1_der()
768 (ret = mbedtls_rsa_import(rsa, NULL, NULL, NULL, in pk_parse_key_pkcs1_der()
775 (ret = mbedtls_rsa_import(rsa, NULL, NULL, NULL, in pk_parse_key_pkcs1_der()
782 (ret = mbedtls_rsa_import(rsa, NULL, &T, NULL, in pk_parse_key_pkcs1_der()
[all …]
Drsa.c2436 mbedtls_rsa_context rsa; in mbedtls_rsa_self_test() local
2447 mbedtls_rsa_init(&rsa); in mbedtls_rsa_self_test()
2450 MBEDTLS_MPI_CHK(mbedtls_rsa_import(&rsa, &K, NULL, NULL, NULL, NULL)); in mbedtls_rsa_self_test()
2452 MBEDTLS_MPI_CHK(mbedtls_rsa_import(&rsa, NULL, &K, NULL, NULL, NULL)); in mbedtls_rsa_self_test()
2454 MBEDTLS_MPI_CHK(mbedtls_rsa_import(&rsa, NULL, NULL, &K, NULL, NULL)); in mbedtls_rsa_self_test()
2456 MBEDTLS_MPI_CHK(mbedtls_rsa_import(&rsa, NULL, NULL, NULL, &K, NULL)); in mbedtls_rsa_self_test()
2458 MBEDTLS_MPI_CHK(mbedtls_rsa_import(&rsa, NULL, NULL, NULL, NULL, &K)); in mbedtls_rsa_self_test()
2460 MBEDTLS_MPI_CHK(mbedtls_rsa_complete(&rsa)); in mbedtls_rsa_self_test()
2466 if (mbedtls_rsa_check_pubkey(&rsa) != 0 || in mbedtls_rsa_self_test()
2467 mbedtls_rsa_check_privkey(&rsa) != 0) { in mbedtls_rsa_self_test()
[all …]
/mbedtls-3.5.0/programs/pkey/
Drsa_verify.c50 mbedtls_rsa_context rsa; in main() local
55 mbedtls_rsa_init(&rsa); in main()
76 if ((ret = mbedtls_mpi_read_file(&rsa.MBEDTLS_PRIVATE(N), 16, f)) != 0 || in main()
77 (ret = mbedtls_mpi_read_file(&rsa.MBEDTLS_PRIVATE(E), 16, f)) != 0) { in main()
83 rsa.MBEDTLS_PRIVATE(len) = (mbedtls_mpi_bitlen(&rsa.MBEDTLS_PRIVATE(N)) + 7) >> 3; in main()
105 if (i != rsa.MBEDTLS_PRIVATE(len)) { in main()
124 if ((ret = mbedtls_rsa_pkcs1_verify(&rsa, MBEDTLS_MD_SHA256, in main()
137 mbedtls_rsa_free(&rsa); in main()
Drsa_sign.c49 mbedtls_rsa_context rsa; in main() local
55 mbedtls_rsa_init(&rsa); in main()
94 if ((ret = mbedtls_rsa_import(&rsa, &N, &P, &Q, &D, &E)) != 0) { in main()
100 if ((ret = mbedtls_rsa_complete(&rsa)) != 0) { in main()
108 if ((ret = mbedtls_rsa_check_privkey(&rsa)) != 0) { in main()
128 if ((ret = mbedtls_rsa_pkcs1_sign(&rsa, NULL, NULL, MBEDTLS_MD_SHA256, in main()
145 for (i = 0; i < rsa.MBEDTLS_PRIVATE(len); i++) { in main()
158 mbedtls_rsa_free(&rsa); in main()
Ddh_client.c76 mbedtls_rsa_context rsa; in main() local
111 mbedtls_rsa_init(&rsa); in main()
113 if ((ret = mbedtls_mpi_read_file(&rsa.MBEDTLS_PRIVATE(N), 16, f)) != 0 || in main()
114 (ret = mbedtls_mpi_read_file(&rsa.MBEDTLS_PRIVATE(E), 16, f)) != 0) { in main()
120 rsa.MBEDTLS_PRIVATE(len) = (mbedtls_mpi_bitlen(&rsa.MBEDTLS_PRIVATE(N)) + 7) >> 3; in main()
188 if ((n = (size_t) (end - p)) != rsa.MBEDTLS_PRIVATE(len)) { in main()
198 if ((ret = mbedtls_rsa_pkcs1_verify(&rsa, MBEDTLS_MD_SHA256, in main()
275 mbedtls_rsa_free(&rsa); in main()
Ddh_server.c76 mbedtls_rsa_context rsa; in main() local
117 mbedtls_rsa_init(&rsa); in main()
131 if ((ret = mbedtls_rsa_import(&rsa, &N, &P, &Q, &D, &E)) != 0) { in main()
137 if ((ret = mbedtls_rsa_complete(&rsa)) != 0) { in main()
204 buf[n] = (unsigned char) (rsa.MBEDTLS_PRIVATE(len) >> 8); in main()
205 buf[n + 1] = (unsigned char) (rsa.MBEDTLS_PRIVATE(len)); in main()
207 if ((ret = mbedtls_rsa_pkcs1_sign(&rsa, NULL, NULL, MBEDTLS_MD_SHA256, in main()
213 buflen = n + 2 + rsa.MBEDTLS_PRIVATE(len); in main()
297 mbedtls_rsa_free(&rsa); in main()
Drsa_decrypt.c55 mbedtls_rsa_context rsa; in main() local
79 mbedtls_rsa_init(&rsa); in main()
119 if ((ret = mbedtls_rsa_import(&rsa, &N, &P, &Q, &D, &E)) != 0) { in main()
125 if ((ret = mbedtls_rsa_complete(&rsa)) != 0) { in main()
148 if (i != rsa.MBEDTLS_PRIVATE(len)) { in main()
159 ret = mbedtls_rsa_pkcs1_decrypt(&rsa, mbedtls_ctr_drbg_random, in main()
177 mbedtls_rsa_free(&rsa); in main()
Drsa_encrypt.c53 mbedtls_rsa_context rsa; in main() local
75 mbedtls_rsa_init(&rsa); in main()
106 if ((ret = mbedtls_rsa_import(&rsa, &N, NULL, NULL, NULL, &E)) != 0) { in main()
125 ret = mbedtls_rsa_pkcs1_encrypt(&rsa, mbedtls_ctr_drbg_random, in main()
141 for (i = 0; i < rsa.MBEDTLS_PRIVATE(len); i++) { in main()
156 mbedtls_rsa_free(&rsa); in main()
Drsa_genkey.c56 mbedtls_rsa_context rsa; in main() local
65 mbedtls_rsa_init(&rsa); in main()
84 if ((ret = mbedtls_rsa_gen_key(&rsa, mbedtls_ctr_drbg_random, &ctr_drbg, KEY_SIZE, in main()
93 if ((ret = mbedtls_rsa_export(&rsa, &N, &P, &Q, &D, &E)) != 0 || in main()
94 (ret = mbedtls_rsa_export_crt(&rsa, &DP, &DQ, &QP)) != 0) { in main()
146 mbedtls_rsa_free(&rsa); in main()
Dkey_app.c205 mbedtls_rsa_context *rsa = mbedtls_pk_rsa(pk); in main() local
207 if ((ret = mbedtls_rsa_export(rsa, &N, &P, &Q, &D, &E)) != 0 || in main()
208 (ret = mbedtls_rsa_export_crt(rsa, &DP, &DQ, &QP)) != 0) { in main()
262 mbedtls_rsa_context *rsa = mbedtls_pk_rsa(pk); in main() local
264 if ((ret = mbedtls_rsa_export(rsa, &N, NULL, NULL, in main()
Dkey_app_writer.c320 mbedtls_rsa_context *rsa = mbedtls_pk_rsa(key); in main() local
322 if ((ret = mbedtls_rsa_export(rsa, &N, &P, &Q, &D, &E)) != 0 || in main()
323 (ret = mbedtls_rsa_export_crt(rsa, &DP, &DQ, &QP)) != 0) { in main()
373 mbedtls_rsa_context *rsa = mbedtls_pk_rsa(key); in main() local
375 if ((ret = mbedtls_rsa_export(rsa, &N, NULL, NULL, in main()
Dgen_key.c348 mbedtls_rsa_context *rsa = mbedtls_pk_rsa(key); in main() local
350 if ((ret = mbedtls_rsa_export(rsa, &N, &P, &Q, &D, &E)) != 0 || in main()
351 (ret = mbedtls_rsa_export_crt(rsa, &DP, &DQ, &QP)) != 0) { in main()
/mbedtls-3.5.0/tests/data_files/
DMakefile243 cli_crt_key_file_rsa = cli-rsa.key
246 cli-rsa.csr: $(cli_crt_key_file_rsa)
248 all_intermediate += cli-rsa.csr
250 cli-rsa-sha1.crt: cli-rsa.csr
253 cli-rsa-sha256.crt: cli-rsa.csr
255 all_final += cli-rsa-sha256.crt
257 cli-rsa-sha256.crt.der: cli-rsa-sha256.crt
259 all_final += cli-rsa-sha256.crt.der
261 cli-rsa-sha256-badalg.crt.der: cli-rsa-sha256.crt.der
263 all_final += cli-rsa-sha256-badalg.crt.der
[all …]
D.gitignore1 cli-rsa.csr
2 server2-rsa.csr
DReadme-x509.txt60 - 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
Dcli.opensslconf1 [cli-rsa]
/mbedtls-3.5.0/programs/fuzz/
Dfuzz_pubkey.c19 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()
Dfuzz_privkey.c46 mbedtls_rsa_context *rsa; in LLVMFuzzerTestOneInput() local
52 rsa = mbedtls_pk_rsa(pk); in LLVMFuzzerTestOneInput()
53 if (mbedtls_rsa_export(rsa, &N, &P, &Q, &D, &E) != 0) { in LLVMFuzzerTestOneInput()
56 if (mbedtls_rsa_export_crt(rsa, &DP, &DQ, &QP) != 0) { in LLVMFuzzerTestOneInput()
/mbedtls-3.5.0/tests/suites/
Dtest_suite_pkparse.function34 mbedtls_rsa_context *rsa;
36 rsa = mbedtls_pk_rsa(ctx);
37 TEST_ASSERT(mbedtls_rsa_check_privkey(rsa) == 0);
60 mbedtls_rsa_context *rsa;
62 rsa = mbedtls_pk_rsa(ctx);
63 TEST_ASSERT(mbedtls_rsa_check_pubkey(rsa) == 0);
Dtest_suite_pk.function8 #include "mbedtls/rsa.h"
525 mbedtls_rsa_context *rsa;
543 rsa = mbedtls_pk_rsa(pk);
545 rsa->len = mod / 8;
546 TEST_ASSERT(mbedtls_test_read_mpi(&rsa->N, input_N) == 0);
547 TEST_ASSERT(mbedtls_test_read_mpi(&rsa->E, input_E) == 0);
573 mbedtls_rsa_context *rsa;
583 rsa = mbedtls_pk_rsa(pk);
585 rsa->len = mod / 8;
586 TEST_ASSERT(mbedtls_test_read_mpi(&rsa->N, input_N) == 0);
[all …]
/mbedtls-3.5.0/programs/test/
Dbenchmark.c515 rsa, dhm, ecdsa, ecdh; member
587 todo.rsa = 1; in main()
950 if (todo.rsa) { in main()
952 mbedtls_rsa_context rsa; in main() local
956 mbedtls_rsa_init(&rsa); in main()
957 mbedtls_rsa_gen_key(&rsa, myrand, NULL, keysize, 65537); in main()
961 ret = mbedtls_rsa_public(&rsa, buf, buf)); in main()
965 ret = mbedtls_rsa_private(&rsa, myrand, NULL, buf, buf)); in main()
967 mbedtls_rsa_free(&rsa); in main()
/mbedtls-3.5.0/docs/architecture/psa-migration/
Dpsa-limitations.md253 crl-rsa-pss-sha1-badsign.pem
257 crl-rsa-pss-sha1.pem
261 crl-rsa-pss-sha224.pem
265 crl-rsa-pss-sha256.pem
269 crl-rsa-pss-sha384.pem
273 crl-rsa-pss-sha512.pem

12