Lines Matching refs:MBEDTLS_MPI_CHK

123     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()
421 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, off + 1)); in mbedtls_mpi_set_bit()
545 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, n)); in mbedtls_mpi_read_string()
546 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(X, 0)); in mbedtls_mpi_read_string()
549 MBEDTLS_MPI_CHK(mpi_get_digit(&d, radix, s[i - 1])); in mbedtls_mpi_read_string()
553 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(X, 0)); in mbedtls_mpi_read_string()
556 MBEDTLS_MPI_CHK(mpi_get_digit(&d, radix, s[i])); in mbedtls_mpi_read_string()
557 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_int(&T, X, radix)); in mbedtls_mpi_read_string()
558 MBEDTLS_MPI_CHK(mbedtls_mpi_add_int(X, &T, d)); in mbedtls_mpi_read_string()
589 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_int(&r, X, radix)); in mpi_write_hlp()
590 MBEDTLS_MPI_CHK(mbedtls_mpi_div_int(X, NULL, X, radix)); in mpi_write_hlp()
676 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&T, X)); in mbedtls_mpi_write_string()
682 MBEDTLS_MPI_CHK(mpi_write_hlp(&T, radix, &p, buflen)); in mbedtls_mpi_write_string()
760 MBEDTLS_MPI_CHK(mbedtls_mpi_write_string(X, radix, s, sizeof(s) - 2, &n)); in mbedtls_mpi_write_file()
799 MBEDTLS_MPI_CHK(mbedtls_mpi_resize_clear(X, limbs)); in mbedtls_mpi_read_binary_le()
801 MBEDTLS_MPI_CHK(mbedtls_mpi_core_read_le(X->p, X->n, buf, buflen)); in mbedtls_mpi_read_binary_le()
825 MBEDTLS_MPI_CHK(mbedtls_mpi_resize_clear(X, limbs)); in mbedtls_mpi_read_binary()
827 MBEDTLS_MPI_CHK(mbedtls_mpi_core_read_be(X->p, X->n, buf, buflen)); in mbedtls_mpi_read_binary()
868 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, BITS_TO_LIMBS(i))); in mbedtls_mpi_shift_l()
1011 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(X, A)); in mbedtls_mpi_add_abs()
1031 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, j)); in mbedtls_mpi_add_abs()
1045 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, j + 1)); in mbedtls_mpi_add_abs()
1077 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, A->n)); in mbedtls_mpi_sub_abs()
1121 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_abs(X, A, B)); in add_sub_mpi()
1127 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_abs(X, B, A)); in add_sub_mpi()
1132 MBEDTLS_MPI_CHK(mbedtls_mpi_add_abs(X, A, B)); in add_sub_mpi()
1203 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&TA, A)); A = &TA; in mbedtls_mpi_mul_mpi()
1206 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&TB, B)); B = &TB; in mbedtls_mpi_mul_mpi()
1227 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, i + j)); in mbedtls_mpi_mul_mpi()
1228 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(X, 0)); in mbedtls_mpi_mul_mpi()
1277 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, n + 1)); in mbedtls_mpi_mul_int()
1278 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(X, A)); in mbedtls_mpi_mul_int()
1419 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(Q, 0)); in mbedtls_mpi_div_mpi()
1422 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(R, A)); in mbedtls_mpi_div_mpi()
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()
1431 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(&Z, A->n + 2)); in mbedtls_mpi_div_mpi()
1432 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&Z, 0)); in mbedtls_mpi_div_mpi()
1433 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(&T1, A->n + 2)); in mbedtls_mpi_div_mpi()
1438 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_l(&X, k)); in mbedtls_mpi_div_mpi()
1439 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_l(&Y, k)); in mbedtls_mpi_div_mpi()
1446 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_l(&Y, biL * (n - t))); in mbedtls_mpi_div_mpi()
1450 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&X, &X, &Y)); in mbedtls_mpi_div_mpi()
1452 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&Y, biL * (n - t))); in mbedtls_mpi_div_mpi()
1470 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&T1, 0)); in mbedtls_mpi_div_mpi()
1473 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_int(&T1, &T1, Z.p[i - t - 1])); in mbedtls_mpi_div_mpi()
1476 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_int(&T1, &Y, Z.p[i - t - 1])); in mbedtls_mpi_div_mpi()
1477 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_l(&T1, biL * (i - t - 1))); in mbedtls_mpi_div_mpi()
1478 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&X, &X, &T1)); in mbedtls_mpi_div_mpi()
1481 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&T1, &Y)); in mbedtls_mpi_div_mpi()
1482 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_l(&T1, biL * (i - t - 1))); in mbedtls_mpi_div_mpi()
1483 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&X, &X, &T1)); in mbedtls_mpi_div_mpi()
1489 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(Q, &Z)); in mbedtls_mpi_div_mpi()
1494 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&X, k)); in mbedtls_mpi_div_mpi()
1496 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(R, &X)); in mbedtls_mpi_div_mpi()
1541 MBEDTLS_MPI_CHK(mbedtls_mpi_div_mpi(NULL, R, A, B)); in mbedtls_mpi_mod_mpi()
1544 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(R, R, B)); in mbedtls_mpi_mod_mpi()
1548 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(R, R, B)); in mbedtls_mpi_mod_mpi()
1656 MBEDTLS_MPI_CHK(mbedtls_mpi_core_get_mont_r2_unsafe(&RR, N)); in mbedtls_mpi_exp_mod()
1662 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(prec_RR, N->n)); in mbedtls_mpi_exp_mod()
1670 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(X, A)); in mbedtls_mpi_exp_mod()
1688 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(X, X, N)); in mbedtls_mpi_exp_mod()
1690 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, N->n)); in mbedtls_mpi_exp_mod()
1709 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(X, N, X)); in mbedtls_mpi_exp_mod()
1734 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&TA, A)); in mbedtls_mpi_gcd()
1735 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&TB, B)); in mbedtls_mpi_gcd()
1790 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&TA, mbedtls_mpi_lsb(&TA))); in mbedtls_mpi_gcd()
1791 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&TB, mbedtls_mpi_lsb(&TB))); in mbedtls_mpi_gcd()
1801 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_abs(&TA, &TA, &TB)); in mbedtls_mpi_gcd()
1802 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&TA, 1)); in mbedtls_mpi_gcd()
1804 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_abs(&TB, &TB, &TA)); in mbedtls_mpi_gcd()
1805 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&TB, 1)); in mbedtls_mpi_gcd()
1819 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_l(&TB, lz)); in mbedtls_mpi_gcd()
1820 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(G, &TB)); in mbedtls_mpi_gcd()
1843 MBEDTLS_MPI_CHK(mbedtls_mpi_resize_clear(X, limbs)); in mbedtls_mpi_fill_random()
1894 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(&G, A, N)); in mbedtls_mpi_inv_mod()
1901 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(&TA, A, N)); in mbedtls_mpi_inv_mod()
1902 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&TU, &TA)); in mbedtls_mpi_inv_mod()
1903 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&TB, N)); in mbedtls_mpi_inv_mod()
1904 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&TV, N)); in mbedtls_mpi_inv_mod()
1906 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&U1, 1)); in mbedtls_mpi_inv_mod()
1907 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&U2, 0)); in mbedtls_mpi_inv_mod()
1908 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&V1, 0)); in mbedtls_mpi_inv_mod()
1909 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&V2, 1)); in mbedtls_mpi_inv_mod()
1913 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&TU, 1)); in mbedtls_mpi_inv_mod()
1916 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&U1, &U1, &TB)); in mbedtls_mpi_inv_mod()
1917 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&U2, &U2, &TA)); in mbedtls_mpi_inv_mod()
1920 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&U1, 1)); in mbedtls_mpi_inv_mod()
1921 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&U2, 1)); in mbedtls_mpi_inv_mod()
1925 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&TV, 1)); in mbedtls_mpi_inv_mod()
1928 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&V1, &V1, &TB)); in mbedtls_mpi_inv_mod()
1929 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&V2, &V2, &TA)); in mbedtls_mpi_inv_mod()
1932 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&V1, 1)); in mbedtls_mpi_inv_mod()
1933 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&V2, 1)); in mbedtls_mpi_inv_mod()
1937 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&TU, &TU, &TV)); in mbedtls_mpi_inv_mod()
1938 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&U1, &U1, &V1)); in mbedtls_mpi_inv_mod()
1939 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&U2, &U2, &V2)); in mbedtls_mpi_inv_mod()
1941 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&TV, &TV, &TU)); in mbedtls_mpi_inv_mod()
1942 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&V1, &V1, &U1)); in mbedtls_mpi_inv_mod()
1943 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&V2, &V2, &U2)); in mbedtls_mpi_inv_mod()
1948 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&V1, &V1, N)); in mbedtls_mpi_inv_mod()
1952 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&V1, &V1, N)); in mbedtls_mpi_inv_mod()
1955 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(X, &V1)); in mbedtls_mpi_inv_mod()
2015 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_int(&r, X, p)); in mpi_check_small_factors()
2048 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&W, X, 1)); in mpi_miller_rabin()
2050 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&R, &W)); in mpi_miller_rabin()
2051 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&R, s)); in mpi_miller_rabin()
2059 MBEDTLS_MPI_CHK(mbedtls_mpi_fill_random(&A, X->n * ciL, f_rng, p_rng)); in mpi_miller_rabin()
2078 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&A, &A, &R, X, &RR)); in mpi_miller_rabin()
2090 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&T, &A, &A)); in mpi_miller_rabin()
2091 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(&A, &T, X)); in mpi_miller_rabin()
2203 MBEDTLS_MPI_CHK(mbedtls_mpi_fill_random(X, n * ciL, f_rng, p_rng)); in mbedtls_mpi_gen_prime()
2211 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(X, k - nbits)); in mbedtls_mpi_gen_prime()
2230 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_int(&r, X, 3)); in mbedtls_mpi_gen_prime()
2232 MBEDTLS_MPI_CHK(mbedtls_mpi_add_int(X, X, 8)); in mbedtls_mpi_gen_prime()
2234 MBEDTLS_MPI_CHK(mbedtls_mpi_add_int(X, X, 4)); in mbedtls_mpi_gen_prime()
2238 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&Y, X)); in mbedtls_mpi_gen_prime()
2239 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&Y, 1)); in mbedtls_mpi_gen_prime()
2264 MBEDTLS_MPI_CHK(mbedtls_mpi_add_int(X, X, 12)); in mbedtls_mpi_gen_prime()
2265 MBEDTLS_MPI_CHK(mbedtls_mpi_add_int(&Y, &Y, 6)); in mbedtls_mpi_gen_prime()
2301 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&A, 16, in mbedtls_mpi_self_test()
2307 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&E, 16, in mbedtls_mpi_self_test()
2313 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&N, 16, in mbedtls_mpi_self_test()
2318 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&X, &A, &N)); in mbedtls_mpi_self_test()
2320 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&U, 16, in mbedtls_mpi_self_test()
2346 MBEDTLS_MPI_CHK(mbedtls_mpi_div_mpi(&X, &Y, &A, &N)); in mbedtls_mpi_self_test()
2348 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&U, 16, in mbedtls_mpi_self_test()
2351 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&V, 16, in mbedtls_mpi_self_test()
2374 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&X, &A, &E, &N, NULL)); in mbedtls_mpi_self_test()
2376 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&U, 16, in mbedtls_mpi_self_test()
2398 MBEDTLS_MPI_CHK(mbedtls_mpi_inv_mod(&X, &A, &N)); in mbedtls_mpi_self_test()
2400 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&U, 16, in mbedtls_mpi_self_test()
2427 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&X, gcd_pairs[i][0])); in mbedtls_mpi_self_test()
2428 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&Y, gcd_pairs[i][1])); in mbedtls_mpi_self_test()
2430 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(&A, &X, &Y)); in mbedtls_mpi_self_test()