Lines Matching refs:mbedtls_mpi

82 void mbedtls_mpi_init( mbedtls_mpi *X )  in mbedtls_mpi_init()
95 void mbedtls_mpi_free( mbedtls_mpi *X ) in mbedtls_mpi_free()
114 int mbedtls_mpi_grow( mbedtls_mpi *X, size_t nblimbs ) in mbedtls_mpi_grow()
144 int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs ) in mbedtls_mpi_shrink()
180 int mbedtls_mpi_copy( mbedtls_mpi *X, const mbedtls_mpi *Y ) in mbedtls_mpi_copy()
214 void mbedtls_mpi_swap( mbedtls_mpi *X, mbedtls_mpi *Y ) in mbedtls_mpi_swap()
216 mbedtls_mpi T; in mbedtls_mpi_swap()
218 memcpy( &T, X, sizeof( mbedtls_mpi ) ); in mbedtls_mpi_swap()
219 memcpy( X, Y, sizeof( mbedtls_mpi ) ); in mbedtls_mpi_swap()
220 memcpy( Y, &T, sizeof( mbedtls_mpi ) ); in mbedtls_mpi_swap()
228 int mbedtls_mpi_safe_cond_assign( mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign ) in mbedtls_mpi_safe_cond_assign()
256 int mbedtls_mpi_safe_cond_swap( mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char swap ) in mbedtls_mpi_safe_cond_swap()
290 int mbedtls_mpi_lset( mbedtls_mpi *X, mbedtls_mpi_sint z ) in mbedtls_mpi_lset()
308 int mbedtls_mpi_get_bit( const mbedtls_mpi *X, size_t pos ) in mbedtls_mpi_get_bit()
319 int mbedtls_mpi_set_bit( mbedtls_mpi *X, size_t pos, unsigned char val ) in mbedtls_mpi_set_bit()
347 size_t mbedtls_mpi_lsb( const mbedtls_mpi *X ) in mbedtls_mpi_lsb()
380 size_t mbedtls_mpi_bitlen( const mbedtls_mpi *X ) in mbedtls_mpi_bitlen()
399 size_t mbedtls_mpi_size( const mbedtls_mpi *X ) in mbedtls_mpi_size()
424 int mbedtls_mpi_read_string( mbedtls_mpi *X, int radix, const char *s ) in mbedtls_mpi_read_string()
429 mbedtls_mpi T; in mbedtls_mpi_read_string()
496 static int mpi_write_hlp( mbedtls_mpi *X, int radix, char **p ) in mpi_write_hlp()
523 int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix, in mbedtls_mpi_write_string()
529 mbedtls_mpi T; in mbedtls_mpi_write_string()
595 int mbedtls_mpi_read_file( mbedtls_mpi *X, int radix, FILE *fin ) in mbedtls_mpi_read_file()
628 int mbedtls_mpi_write_file( const char *p, const mbedtls_mpi *X, int radix, FILE *fout ) in mbedtls_mpi_write_file()
667 int mbedtls_mpi_read_binary( mbedtls_mpi *X, const unsigned char *buf, size_t buflen ) in mbedtls_mpi_read_binary()
690 int mbedtls_mpi_write_binary( const mbedtls_mpi *X, unsigned char *buf, size_t buflen ) in mbedtls_mpi_write_binary()
710 int mbedtls_mpi_shift_l( mbedtls_mpi *X, size_t count ) in mbedtls_mpi_shift_l()
760 int mbedtls_mpi_shift_r( mbedtls_mpi *X, size_t count ) in mbedtls_mpi_shift_r()
803 int mbedtls_mpi_cmp_abs( const mbedtls_mpi *X, const mbedtls_mpi *Y ) in mbedtls_mpi_cmp_abs()
833 int mbedtls_mpi_cmp_mpi( const mbedtls_mpi *X, const mbedtls_mpi *Y ) in mbedtls_mpi_cmp_mpi()
866 int mbedtls_mpi_cmp_int( const mbedtls_mpi *X, mbedtls_mpi_sint z ) in mbedtls_mpi_cmp_int()
868 mbedtls_mpi Y; in mbedtls_mpi_cmp_int()
882 int mbedtls_mpi_add_abs( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ) in mbedtls_mpi_add_abs()
890 const mbedtls_mpi *T = A; A = X; B = T; in mbedtls_mpi_add_abs()
959 int mbedtls_mpi_sub_abs( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ) in mbedtls_mpi_sub_abs()
961 mbedtls_mpi TB; in mbedtls_mpi_sub_abs()
1002 int mbedtls_mpi_add_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ) in mbedtls_mpi_add_mpi()
1033 int mbedtls_mpi_sub_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ) in mbedtls_mpi_sub_mpi()
1064 int mbedtls_mpi_add_int( mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_sint b ) in mbedtls_mpi_add_int()
1066 mbedtls_mpi _B; in mbedtls_mpi_add_int()
1080 int mbedtls_mpi_sub_int( mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_sint b ) in mbedtls_mpi_sub_int()
1082 mbedtls_mpi _B; in mbedtls_mpi_sub_int()
1168 int mbedtls_mpi_mul_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B ) in mbedtls_mpi_mul_mpi()
1172 mbedtls_mpi TA, TB; in mbedtls_mpi_mul_mpi()
1205 int mbedtls_mpi_mul_int( mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_uint b ) in mbedtls_mpi_mul_int()
1207 mbedtls_mpi _B; in mbedtls_mpi_mul_int()
1317 int mbedtls_mpi_div_mpi( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, const mbedtls_mpi *B… in mbedtls_mpi_div_mpi()
1321 mbedtls_mpi X, Y, Z, T1, T2; in mbedtls_mpi_div_mpi()
1432 int mbedtls_mpi_div_int( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, mbedtls_mpi_sint b ) in mbedtls_mpi_div_int()
1434 mbedtls_mpi _B; in mbedtls_mpi_div_int()
1448 int mbedtls_mpi_mod_mpi( mbedtls_mpi *R, const mbedtls_mpi *A, const mbedtls_mpi *B ) in mbedtls_mpi_mod_mpi()
1471 int mbedtls_mpi_mod_int( mbedtls_mpi_uint *r, const mbedtls_mpi *A, mbedtls_mpi_sint b ) in mbedtls_mpi_mod_int()
1528 static void mpi_montg_init( mbedtls_mpi_uint *mm, const mbedtls_mpi *N ) in mpi_montg_init()
1545 static int mpi_montmul( mbedtls_mpi *A, const mbedtls_mpi *B, const mbedtls_mpi *N, mbedtls_mpi_uin… in mpi_montmul()
1546 const mbedtls_mpi *T ) in mpi_montmul()
1588 static int mpi_montred( mbedtls_mpi *A, const mbedtls_mpi *N, mbedtls_mpi_uint mm, const mbedtls_mp… in mpi_montred()
1591 mbedtls_mpi U; in mpi_montred()
1602 int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *E, const mbedtls_… in mbedtls_mpi_exp_mod()
1609 mbedtls_mpi RR, T, W[ 2 << MBEDTLS_MPI_WINDOW_SIZE ], Apos; in mbedtls_mpi_exp_mod()
1660 memcpy( _RR, &RR, sizeof( mbedtls_mpi ) ); in mbedtls_mpi_exp_mod()
1663 memcpy( &RR, _RR, sizeof( mbedtls_mpi ) ); in mbedtls_mpi_exp_mod()
1810 int mbedtls_mpi_gcd( mbedtls_mpi *G, const mbedtls_mpi *A, const mbedtls_mpi *B ) in mbedtls_mpi_gcd()
1814 mbedtls_mpi TG, TA, TB; in mbedtls_mpi_gcd()
1866 int mbedtls_mpi_fill_random( mbedtls_mpi *X, size_t size, in mbedtls_mpi_fill_random()
1886 int mbedtls_mpi_inv_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *N ) in mbedtls_mpi_inv_mod()
1889 mbedtls_mpi G, TA, TU, U1, U2, TB, TV, V1, V2; in mbedtls_mpi_inv_mod()
2014 static int mpi_check_small_factors( const mbedtls_mpi *X ) in mpi_check_small_factors()
2041 static int mpi_miller_rabin( const mbedtls_mpi *X, in mpi_miller_rabin()
2047 mbedtls_mpi W, R, T, A, RR; in mpi_miller_rabin()
2145 int mbedtls_mpi_is_prime( const mbedtls_mpi *X, in mbedtls_mpi_is_prime()
2150 mbedtls_mpi XX; in mbedtls_mpi_is_prime()
2177 int mbedtls_mpi_gen_prime( mbedtls_mpi *X, size_t nbits, int dh_flag, in mbedtls_mpi_gen_prime()
2184 mbedtls_mpi Y; in mbedtls_mpi_gen_prime()
2285 mbedtls_mpi A, E, N, X, Y, U, V; in mbedtls_mpi_self_test()