Home
last modified time | relevance | path

Searched refs:MBEDTLS_MPI_CHK (Results 1 – 25 of 26) sorted by relevance

12

/mbedtls/library/
A Drsa_alt_helpers.c95 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&T, D, E)); in mbedtls_rsa_deduce_primes()
96 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&T, &T, 1)); in mbedtls_rsa_deduce_primes()
104 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&T, order)); in mbedtls_rsa_deduce_primes()
120 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(P, &K, N)); in mbedtls_rsa_deduce_primes()
139 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(P, &K, N)); in mbedtls_rsa_deduce_primes()
204 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&K, P, 1)); in mbedtls_rsa_deduce_private_exponent()
205 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&L, Q, 1)); in mbedtls_rsa_deduce_private_exponent()
208 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(D, &K, &L)); in mbedtls_rsa_deduce_private_exponent()
211 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&K, &K, &L)); in mbedtls_rsa_deduce_private_exponent()
215 MBEDTLS_MPI_CHK(mbedtls_mpi_inv_mod(D, E, &K)); in mbedtls_rsa_deduce_private_exponent()
[all …]
A Dbignum.c123 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, Y->n)); in mbedtls_mpi_safe_cond_assign()
161 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, Y->n)); in mbedtls_mpi_safe_cond_swap()
162 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(Y, X->n)); in mbedtls_mpi_safe_cond_swap()
333 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, i)); in mbedtls_mpi_copy()
380 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, 1)); in mbedtls_mpi_lset()
1031 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, j)); in mbedtls_mpi_add_abs()
1228 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(X, 0)); in mbedtls_mpi_mul_mpi()
1278 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(X, A)); in mbedtls_mpi_mul_int()
1427 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&X, A)); in mbedtls_mpi_div_mpi()
1428 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&Y, B)); in mbedtls_mpi_div_mpi()
[all …]
A Decp.c682 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&P->Z, 1)); in mbedtls_ecp_point_read_string()
1013 MBEDTLS_MPI_CHK(grp->modp(N)); in ecp_modp()
1179 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(X, A))
1185 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(X, c))
1275 MBEDTLS_MPI_CHK(ecp_sw_rhs(grp, Y, X)); in mbedtls_ecp_sw_derive_y()
2143 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&M, m)); in ecp_comb_recode_scalar()
3254 MBEDTLS_MPI_CHK( in mbedtls_ecp_read_key()
3260 MBEDTLS_MPI_CHK( in mbedtls_ecp_read_key()
3276 MBEDTLS_MPI_CHK( in mbedtls_ecp_read_key()
3505 MBEDTLS_MPI_CHK( in self_test_adjust_exponent()
[all …]
A Decjpake.c232 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(h, hash, in ecjpake_hash()
553 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&one, 1)); in ecjpake_ecp_add3()
585 MBEDTLS_MPI_CHK(ecjpake_ecp_add3(&ctx->grp, &G, in mbedtls_ecjpake_read_round_two()
635 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&b, &b, N)); in ecjpake_mul_secret()
636 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&b, &b, S)); in ecjpake_mul_secret()
639 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(R, X, &b)); in ecjpake_mul_secret()
641 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(R, R, N)); in ecjpake_mul_secret()
676 MBEDTLS_MPI_CHK(ecjpake_ecp_add3(&ctx->grp, &G, in mbedtls_ecjpake_write_round_two()
737 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&one, 1)); in mbedtls_ecjpake_derive_k()
1130 MBEDTLS_MPI_CHK(ecjpake_test_load(&cli, in mbedtls_ecjpake_self_test()
[all …]
A Drsa.c1081 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&ctx->E, exponent)); in mbedtls_rsa_gen_key()
1143 MBEDTLS_MPI_CHK(mbedtls_rsa_check_privkey(ctx)); in mbedtls_rsa_gen_key()
1361 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(&M_T, tlimbs)); in rsa_unblind()
1363 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(T, nlimbs)); in rsa_unblind()
1364 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(Vf, nlimbs)); in rsa_unblind()
1545 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&T, &TP, &TQ)); in mbedtls_rsa_private()
1553 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&T, &TQ, &TP)); in mbedtls_rsa_private()
1568 MBEDTLS_MPI_CHK(rsa_unblind(&T, &ctx->Vf, &ctx->N)); in mbedtls_rsa_private()
2778 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&dst->N, &src->N)); in mbedtls_rsa_copy()
2779 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&dst->E, &src->E)); in mbedtls_rsa_copy()
[all …]
A Ddhm.c86 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&U, P, 2)); in dhm_check_range()
173 MBEDTLS_MPI_CHK(mbedtls_mpi_random(R, 3, M, f_rng, p_rng)); in dhm_random_below()
174 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(R, R, 1)); in dhm_random_below()
356 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&ctx->pX, &ctx->X)); in dhm_update_blinding()
357 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&ctx->Vi, 1)); in dhm_update_blinding()
358 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&ctx->Vf, 1)); in dhm_update_blinding()
387 MBEDTLS_MPI_CHK(dhm_random_below(&R, &ctx->P, f_rng, p_rng)); in dhm_update_blinding()
388 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&ctx->Vf, &ctx->Vi, &R)); in dhm_update_blinding()
428 MBEDTLS_MPI_CHK(dhm_update_blinding(ctx, f_rng, p_rng)); in mbedtls_dhm_calc_secret()
430 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(&GYb, &GYb, &ctx->P)); in mbedtls_dhm_calc_secret()
[all …]
A Decdsa.c340 MBEDTLS_MPI_CHK(derive_mpi(grp, &e, buf, blen)); in mbedtls_ecdsa_sign_restartable()
352 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(s, pr, d)); in mbedtls_ecdsa_sign_restartable()
353 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&e, &e, s)); in mbedtls_ecdsa_sign_restartable()
354 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&e, &e, &t)); in mbedtls_ecdsa_sign_restartable()
355 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(pk, pk, &t)); in mbedtls_ecdsa_sign_restartable()
358 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(s, s, &e)); in mbedtls_ecdsa_sign_restartable()
364 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(r, pr)); in mbedtls_ecdsa_sign_restartable()
436 MBEDTLS_MPI_CHK(derive_mpi(grp, &h, buf, blen)); in mbedtls_ecdsa_sign_det_restartable()
536 MBEDTLS_MPI_CHK(derive_mpi(grp, &e, buf, blen)); in mbedtls_ecdsa_verify_restartable()
548 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(pu2, r, &s_inv)); in mbedtls_ecdsa_verify_restartable()
[all …]
A Dpsa_crypto_ffdh.c121 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(P, dhm_P, in mbedtls_psa_ffdh_set_prime_generator()
125 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(G, dhm_G, in mbedtls_psa_ffdh_set_prime_generator()
178 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&X, key_buffer, in mbedtls_psa_ffdh_export_public_key()
181 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&GX, &G, &X, &P, NULL)); in mbedtls_psa_ffdh_export_public_key()
182 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&GX, data, key_len)); in mbedtls_psa_ffdh_export_public_key()
220 MBEDTLS_MPI_CHK(mbedtls_mpi_random(&X, 3, &P, mbedtls_psa_get_random, in mbedtls_psa_ffdh_generate_key()
222 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&X, &X, 1)); in mbedtls_psa_ffdh_generate_key()
292 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&X, key_buffer, in mbedtls_psa_ffdh_key_agreement()
295 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&GY, peer_key, in mbedtls_psa_ffdh_key_agreement()
299 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&K, &GY, &X, &P, NULL)); in mbedtls_psa_ffdh_key_agreement()
[all …]
A Decp_curves.c4630 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&grp->P, 1)); in ecp_use_curve25519()
4682 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&grp->P, 1)); in ecp_use_curve448()
4697 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&Ns, in ecp_use_curve448()
5177 MBEDTLS_MPI_CHK(mbedtls_mpi_add_abs(N, N, &M)); in ecp_mod_p521()
5276 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(N, N, &M)); in ecp_mod_p448()
5282 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&Q, 224)); in ecp_mod_p448()
5283 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(N, N, &Q)); in ecp_mod_p448()
5294 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_l(&M, 224)); in ecp_mod_p448()
5295 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(N, N, &M)); in ecp_mod_p448()
5357 MBEDTLS_MPI_CHK(mbedtls_mpi_add_abs(N, N, &M)); in ecp_mod_koblitz()
[all …]
A Dbignum_core.c587 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(X, 1)); in mbedtls_mpi_core_get_mont_r2_unsafe()
588 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_l(X, N->n * 2 * biL)); in mbedtls_mpi_core_get_mont_r2_unsafe()
589 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(X, X, N)); in mbedtls_mpi_core_get_mont_r2_unsafe()
590 MBEDTLS_MPI_CHK(mbedtls_mpi_shrink(X, N->n)); in mbedtls_mpi_core_get_mont_r2_unsafe()
630 MBEDTLS_MPI_CHK(f_rng(p_rng, (unsigned char *) X + overhead, n_bytes)); in mbedtls_mpi_core_fill_random()
677 MBEDTLS_MPI_CHK(mbedtls_mpi_core_fill_random(X, limbs, in mbedtls_mpi_core_random()
A Dpsa_crypto_ecp.c399 MBEDTLS_MPI_CHK(mbedtls_ecdsa_sign_det_ext( in mbedtls_psa_ecdsa_sign_hash()
411 MBEDTLS_MPI_CHK(mbedtls_ecdsa_sign(&ecp->grp, &r, &s, &ecp->d, in mbedtls_psa_ecdsa_sign_hash()
417 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&r, in mbedtls_psa_ecdsa_sign_hash()
420 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&s, in mbedtls_psa_ecdsa_sign_hash()
A Decdh.c68 MBEDTLS_MPI_CHK(mbedtls_ecp_gen_privkey(grp, d, f_rng, p_rng)); in ecdh_gen_public_restartable()
71 MBEDTLS_MPI_CHK(mbedtls_ecp_mul_restartable(grp, Q, d, &grp->G, in ecdh_gen_public_restartable()
105 MBEDTLS_MPI_CHK(mbedtls_ecp_mul_restartable(grp, &P, d, Q, in ecdh_compute_shared_restartable()
113 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(z, &P.X)); in ecdh_compute_shared_restartable()
A Decp_curves_new.c4679 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&grp->G.X, 9)); in ecp_use_curve25519()
4680 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&grp->G.Z, 1)); in ecp_use_curve25519()
4738 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&grp->G.X, 5)); in ecp_use_curve448()
4739 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&grp->G.Z, 1)); in ecp_use_curve448()
4910 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(N, expected_width)); in ecp_mod_p192()
5070 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(N, expected_width)); in ecp_mod_p224()
5123 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(N, expected_width)); in ecp_mod_p256()
5203 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(N, expected_width)); in ecp_mod_p384()
5325 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(N, expected_width)); in ecp_mod_p521()
5411 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(N, expected_width)); in ecp_mod_p255()
[all …]
A Dpk_wrap.c891 MBEDTLS_MPI_CHK(mbedtls_ecdsa_from_keypair(&rs->ecdsa_ctx, pk->pk_ctx)); in eckey_verify_rs_wrap()
894 MBEDTLS_MPI_CHK(ecdsa_verify_rs_wrap(pk, in eckey_verify_rs_wrap()
918 MBEDTLS_MPI_CHK(mbedtls_ecdsa_from_keypair(&rs->ecdsa_ctx, pk->pk_ctx)); in eckey_sign_rs_wrap()
921 MBEDTLS_MPI_CHK(ecdsa_sign_rs_wrap(pk, md_alg, in eckey_sign_rs_wrap()
A Dasn1write.c119 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(X, *p, len)); in mbedtls_asn1_write_mpi()
A Dbignum_mod.c227 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_modulus_setup(&Nmont, N->p, N->limbs)); in mbedtls_mpi_mod_inv_non_mont()
A Dpsa_crypto.c6176 MBEDTLS_MPI_CHK(mbedtls_ecp_group_load(&ecp_group, grp_id)); in psa_generate_derived_ecc_key_weierstrass_helper()
6185 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&diff_N_2, &ecp_group.N, 2)); in psa_generate_derived_ecc_key_weierstrass_helper()
6214 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&k, *data, m_bytes)); in psa_generate_derived_ecc_key_weierstrass_helper()
6220 MBEDTLS_MPI_CHK(mbedtls_mpi_lt_mpi_ct(&diff_N_2, &k, &key_out_of_range)); in psa_generate_derived_ecc_key_weierstrass_helper()
6224 MBEDTLS_MPI_CHK(mbedtls_mpi_add_int(&k, &k, 1)); in psa_generate_derived_ecc_key_weierstrass_helper()
6225 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&k, *data, m_bytes)); in psa_generate_derived_ecc_key_weierstrass_helper()
A Dpkparse.c271 MBEDTLS_MPI_CHK(mbedtls_ecp_group_load(&ref, *id)); in pk_group_id_from_group()
/mbedtls/programs/pkey/
A Dmpi_demo.c37 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&P, 10, "2789")); in main()
38 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&Q, 10, "3203")); in main()
39 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&E, 10, "257")); in main()
40 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&N, &P, &Q)); in main()
51 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&P, &P, 1)); in main()
52 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&Q, &Q, 1)); in main()
53 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&H, &P, &Q)); in main()
54 MBEDTLS_MPI_CHK(mbedtls_mpi_inv_mod(&D, &E, &H)); in main()
61 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&X, 10, "55555")); in main()
62 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&Y, &X, &E, &N, NULL)); in main()
[all …]
A Dkey_app.c75 MBEDTLS_MPI_CHK(mbedtls_ecp_export(ecp, &grp, in show_ecp_key()
81 MBEDTLS_MPI_CHK(mbedtls_ecp_point_write_binary( in show_ecp_key()
91 MBEDTLS_MPI_CHK( in show_ecp_key()
93 MBEDTLS_MPI_CHK( in show_ecp_key()
99 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&X, point_bin, len)); in show_ecp_key()
275 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file("N: ", &N, 16, NULL)); in main()
276 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file("E: ", &E, 16, NULL)); in main()
277 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file("D: ", &D, 16, NULL)); in main()
278 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file("P: ", &P, 16, NULL)); in main()
279 MBEDTLS_MPI_CHK(mbedtls_mpi_write_file("Q: ", &Q, 16, NULL)); in main()
[all …]
A Dgen_key.c179 MBEDTLS_MPI_CHK(mbedtls_ecp_export(ecp, &grp, in show_ecp_key()
185 MBEDTLS_MPI_CHK(mbedtls_ecp_point_write_binary( in show_ecp_key()
195 MBEDTLS_MPI_CHK( in show_ecp_key()
197 MBEDTLS_MPI_CHK( in show_ecp_key()
203 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&X, point_bin, len)); in show_ecp_key()
A Dkey_app_writer.c195 MBEDTLS_MPI_CHK(mbedtls_ecp_export(ecp, &grp, in show_ecp_key()
201 MBEDTLS_MPI_CHK(mbedtls_ecp_point_write_binary( in show_ecp_key()
211 MBEDTLS_MPI_CHK( in show_ecp_key()
213 MBEDTLS_MPI_CHK( in show_ecp_key()
219 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&X, point_bin, len)); in show_ecp_key()
/mbedtls/tests/suites/
A Dtest_suite_ecjpake.function76 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&ctx->xm1, xm1, len_xm1));
77 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&ctx->xm2, xm2, len_xm2));
79 MBEDTLS_MPI_CHK(mbedtls_ecp_point_read_binary(&ctx->grp,
81 MBEDTLS_MPI_CHK(mbedtls_ecp_point_read_binary(&ctx->grp,
83 MBEDTLS_MPI_CHK(mbedtls_ecp_point_read_binary(&ctx->grp,
85 MBEDTLS_MPI_CHK(mbedtls_ecp_point_read_binary(&ctx->grp,
/mbedtls/include/mbedtls/
A Dbignum.h40 #define MBEDTLS_MPI_CHK(f) \ macro
A Decp.h408 MBEDTLS_MPI_CHK(mbedtls_ecp_check_budget(grp, rs_ctx, \

Completed in 99 milliseconds

12