Home
last modified time | relevance | path

Searched refs:mbedtls_mpi_uint (Results 1 – 25 of 28) sorted by relevance

12

/mbedtls-3.6.0/library/
Dbignum_core.h79 #define ciL (sizeof(mbedtls_mpi_uint)) /** chars in limb */
102 size_t mbedtls_mpi_core_clz(mbedtls_mpi_uint a);
114 size_t mbedtls_mpi_core_bitlen(const mbedtls_mpi_uint *A, size_t A_limbs);
122 void mbedtls_mpi_core_bigendian_to_host(mbedtls_mpi_uint *A,
137 mbedtls_ct_condition_t mbedtls_mpi_core_uint_le_mpi(mbedtls_mpi_uint min,
138 const mbedtls_mpi_uint *A,
155 mbedtls_ct_condition_t mbedtls_mpi_core_lt_ct(const mbedtls_mpi_uint *A,
156 const mbedtls_mpi_uint *B,
176 void mbedtls_mpi_core_cond_assign(mbedtls_mpi_uint *X,
177 const mbedtls_mpi_uint *A,
[all …]
Decp_curves.c32 #define ECP_MPI_INIT(_p, _n) { .p = (mbedtls_mpi_uint *) (_p), .s = 1, .n = (_n) }
35 ECP_MPI_INIT(x, sizeof(x) / sizeof(mbedtls_mpi_uint))
55 static mbedtls_mpi_uint mpi_one[] = { 1 };
67 static const mbedtls_mpi_uint secp192r1_p[] = {
72 static const mbedtls_mpi_uint secp192r1_b[] = {
77 static const mbedtls_mpi_uint secp192r1_gx[] = {
82 static const mbedtls_mpi_uint secp192r1_gy[] = {
87 static const mbedtls_mpi_uint secp192r1_n[] = {
93 static const mbedtls_mpi_uint secp192r1_T_0_X[] = {
98 static const mbedtls_mpi_uint secp192r1_T_0_Y[] = {
[all …]
Decp_curves_new.c37 #define ECP_MPI_INIT(_p, _n) { .p = (mbedtls_mpi_uint *) (_p), .s = 1, .n = (_n) }
40 ECP_MPI_INIT(x, sizeof(x) / sizeof(mbedtls_mpi_uint))
60 static mbedtls_mpi_uint mpi_one[] = { 1 };
72 static const mbedtls_mpi_uint secp192r1_p[] = {
77 static const mbedtls_mpi_uint secp192r1_b[] = {
82 static const mbedtls_mpi_uint secp192r1_gx[] = {
87 static const mbedtls_mpi_uint secp192r1_gy[] = {
92 static const mbedtls_mpi_uint secp192r1_n[] = {
98 static const mbedtls_mpi_uint secp192r1_T_0_X[] = {
103 static const mbedtls_mpi_uint secp192r1_T_0_Y[] = {
[all …]
Dbignum_core.c24 size_t mbedtls_mpi_core_clz(mbedtls_mpi_uint a) in mbedtls_mpi_core_clz()
39 mbedtls_mpi_uint mask = (mbedtls_mpi_uint) 1 << (biL - 1); in mbedtls_mpi_core_clz()
53 size_t mbedtls_mpi_core_bitlen(const mbedtls_mpi_uint *A, size_t A_limbs) in mbedtls_mpi_core_bitlen()
68 static mbedtls_mpi_uint mpi_bigendian_to_host(mbedtls_mpi_uint a) in mpi_bigendian_to_host()
75 return (mbedtls_mpi_uint) MBEDTLS_BSWAP32(a); in mpi_bigendian_to_host()
77 return (mbedtls_mpi_uint) MBEDTLS_BSWAP64(a); in mpi_bigendian_to_host()
82 void mbedtls_mpi_core_bigendian_to_host(mbedtls_mpi_uint *A, in mbedtls_mpi_core_bigendian_to_host()
85 mbedtls_mpi_uint *cur_limb_left; in mbedtls_mpi_core_bigendian_to_host()
86 mbedtls_mpi_uint *cur_limb_right; in mbedtls_mpi_core_bigendian_to_host()
103 mbedtls_mpi_uint tmp; in mbedtls_mpi_core_bigendian_to_host()
[all …]
Dbignum_mod_raw.h100 void mbedtls_mpi_mod_raw_cond_assign(mbedtls_mpi_uint *X,
101 const mbedtls_mpi_uint *A,
126 void mbedtls_mpi_mod_raw_cond_swap(mbedtls_mpi_uint *X,
127 mbedtls_mpi_uint *Y,
150 int mbedtls_mpi_mod_raw_read(mbedtls_mpi_uint *X,
172 int mbedtls_mpi_mod_raw_write(const mbedtls_mpi_uint *A,
195 void mbedtls_mpi_mod_raw_sub(mbedtls_mpi_uint *X,
196 const mbedtls_mpi_uint *A,
197 const mbedtls_mpi_uint *B,
229 void mbedtls_mpi_mod_raw_mul(mbedtls_mpi_uint *X,
[all …]
Dbignum_mod_raw.c26 void mbedtls_mpi_mod_raw_cond_assign(mbedtls_mpi_uint *X, in mbedtls_mpi_mod_raw_cond_assign()
27 const mbedtls_mpi_uint *A, in mbedtls_mpi_mod_raw_cond_assign()
34 void mbedtls_mpi_mod_raw_cond_swap(mbedtls_mpi_uint *X, in mbedtls_mpi_mod_raw_cond_swap()
35 mbedtls_mpi_uint *Y, in mbedtls_mpi_mod_raw_cond_swap()
42 int mbedtls_mpi_mod_raw_read(mbedtls_mpi_uint *X, in mbedtls_mpi_mod_raw_read()
77 int mbedtls_mpi_mod_raw_write(const mbedtls_mpi_uint *A, in mbedtls_mpi_mod_raw_write()
95 void mbedtls_mpi_mod_raw_sub(mbedtls_mpi_uint *X, in mbedtls_mpi_mod_raw_sub()
96 const mbedtls_mpi_uint *A, in mbedtls_mpi_mod_raw_sub()
97 const mbedtls_mpi_uint *B, in mbedtls_mpi_mod_raw_sub()
100 mbedtls_mpi_uint c = mbedtls_mpi_core_sub(X, A, B, N->limbs); in mbedtls_mpi_mod_raw_sub()
[all …]
Decp_invasive.h90 int mbedtls_ecp_mod_p192_raw(mbedtls_mpi_uint *Np, size_t Nn);
112 int mbedtls_ecp_mod_p224_raw(mbedtls_mpi_uint *X, size_t X_limbs);
134 int mbedtls_ecp_mod_p256_raw(mbedtls_mpi_uint *X, size_t X_limbs);
156 int mbedtls_ecp_mod_p521_raw(mbedtls_mpi_uint *X, size_t X_limbs);
178 int mbedtls_ecp_mod_p384_raw(mbedtls_mpi_uint *X, size_t X_limbs);
202 int mbedtls_ecp_mod_p192k1_raw(mbedtls_mpi_uint *X, size_t X_limbs);
226 int mbedtls_ecp_mod_p224k1_raw(mbedtls_mpi_uint *X, size_t X_limbs);
250 int mbedtls_ecp_mod_p256k1_raw(mbedtls_mpi_uint *X, size_t X_limbs);
271 int mbedtls_ecp_mod_p255_raw(mbedtls_mpi_uint *X, size_t X_limbs);
297 int mbedtls_ecp_mod_p448_raw(mbedtls_mpi_uint *X, size_t X_limbs);
Dbignum_mod.c27 mbedtls_mpi_uint *p, in mbedtls_mpi_mod_residue_setup()
71 mbedtls_zeroize_and_free((mbedtls_mpi_uint *) N->rep.mont.rr, in mbedtls_mpi_mod_modulus_free()
72 N->limbs * sizeof(mbedtls_mpi_uint)); in mbedtls_mpi_mod_modulus_free()
90 static int set_mont_const_square(const mbedtls_mpi_uint **X, in set_mont_const_square()
91 const mbedtls_mpi_uint *A, in set_mont_const_square()
110 memcpy(N.p, A, sizeof(mbedtls_mpi_uint) * limbs); in set_mont_const_square()
127 const mbedtls_mpi_uint *p, in standard_modulus_setup()
138 const mbedtls_mpi_uint *p, in mbedtls_mpi_mod_modulus_setup()
154 const mbedtls_mpi_uint *p, in mbedtls_mpi_mod_optred_modulus_setup()
176 mbedtls_mpi_uint *T = mbedtls_calloc(N->limbs * 2 + 1, ciL); in mbedtls_mpi_mod_mul()
[all …]
Dbn_mul.h39 ((mbedtls_mpi_uint) (a) << 0) | \
40 ((mbedtls_mpi_uint) (b) << 8) | \
41 ((mbedtls_mpi_uint) (c) << 16) | \
42 ((mbedtls_mpi_uint) (d) << 24)
54 ((mbedtls_mpi_uint) (a) << 0) | \
55 ((mbedtls_mpi_uint) (b) << 8) | \
56 ((mbedtls_mpi_uint) (c) << 16) | \
57 ((mbedtls_mpi_uint) (d) << 24) | \
58 ((mbedtls_mpi_uint) (e) << 32) | \
59 ((mbedtls_mpi_uint) (f) << 40) | \
[all …]
Dbignum_mod.h106 mbedtls_mpi_uint *p;
111 mbedtls_mpi_uint const *rr; /* The residue for 2^{2*n*biL} mod N */
112 mbedtls_mpi_uint mm; /* Montgomery const for -N^{-1} mod 2^{ciL} */
115 typedef int (*mbedtls_mpi_modp_fn)(mbedtls_mpi_uint *X, size_t X_limbs);
122 const mbedtls_mpi_uint *p;
164 mbedtls_mpi_uint *p,
197 const mbedtls_mpi_uint *p,
213 const mbedtls_mpi_uint *p,
380 mbedtls_mpi_uint min,
Dbignum.c211 mbedtls_mpi_uint *p; in mbedtls_mpi_grow()
219 if ((p = (mbedtls_mpi_uint *) mbedtls_calloc(nblimbs, ciL)) == NULL) { in mbedtls_mpi_grow()
243 mbedtls_mpi_uint *p; in mbedtls_mpi_shrink()
268 if ((p = (mbedtls_mpi_uint *) mbedtls_calloc(i, ciL)) == NULL) { in mbedtls_mpi_shrink()
365 static inline mbedtls_mpi_uint mpi_sint_abs(mbedtls_mpi_sint z) in mpi_sint_abs()
374 return (mbedtls_mpi_uint) 0 - (mbedtls_mpi_uint) z; in mpi_sint_abs()
379 #define TO_SIGN(x) ((mbedtls_mpi_sint) (((mbedtls_mpi_uint) x) >> (biL - 1)) * -2 + 1)
436 X->p[off] &= ~((mbedtls_mpi_uint) 0x01 << idx); in mbedtls_mpi_set_bit()
437 X->p[off] |= (mbedtls_mpi_uint) val << idx; in mbedtls_mpi_set_bit()
501 static int mpi_get_digit(mbedtls_mpi_uint *d, int radix, char c) in mpi_get_digit()
[all …]
Dconstant_time_internal.h312 static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if(mbedtls_ct_condition_t condition, \
313 mbedtls_mpi_uint if1, \
314 mbedtls_mpi_uint if0);
383 static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if_else_0(mbedtls_ct_condition_t condition,
384 mbedtls_mpi_uint if1);
Dconstant_time_impl.h448 static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if(mbedtls_ct_condition_t condition, in mbedtls_ct_mpi_uint_if()
449 mbedtls_mpi_uint if1, in mbedtls_ct_mpi_uint_if()
450 mbedtls_mpi_uint if0) in mbedtls_ct_mpi_uint_if()
452 return (mbedtls_mpi_uint) mbedtls_ct_if(condition, in mbedtls_ct_mpi_uint_if()
477 static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if_else_0(mbedtls_ct_condition_t condition, in mbedtls_ct_mpi_uint_if_else_0()
478 mbedtls_mpi_uint if1) in mbedtls_ct_mpi_uint_if_else_0()
480 return (mbedtls_mpi_uint) (condition & if1); in mbedtls_ct_mpi_uint_if_else_0()
Dbignum_mod_raw_invasive.h29 void mbedtls_mpi_mod_raw_fix_quasi_reduction(mbedtls_mpi_uint *X,
Ddebug.c293 size_t limb_offset = n / sizeof(mbedtls_mpi_uint); in mbedtls_debug_print_mpi()
294 size_t offset_in_limb = n % sizeof(mbedtls_mpi_uint); in mbedtls_debug_print_mpi()
Decp.c1121 mbedtls_mpi_uint c) in mbedtls_mpi_mul_int_mod()
1134 mbedtls_mpi_uint c) in mbedtls_mpi_sub_int_mod()
2925 #define ECP_MPI_INIT(_p, _n) { .p = (mbedtls_mpi_uint *) (_p), .s = 1, .n = (_n) }
2927 ECP_MPI_INIT(x, sizeof(x) / sizeof(mbedtls_mpi_uint))
2933 static const mbedtls_mpi_uint x25519_bad_point_1[] = {
2939 static const mbedtls_mpi_uint x25519_bad_point_2[] = {
/mbedtls-3.6.0/tests/suites/
Dtest_suite_bignum_mod_raw.function39 if (sizeof(mbedtls_mpi_uint) == 8) {
45 mbedtls_mpi_uint X[sizeof(buf) / sizeof(mbedtls_mpi_uint)];
55 mbedtls_mpi_uint init[sizeof(X) / sizeof(X[0])];
116 mbedtls_mpi_uint *X = NULL;
117 mbedtls_mpi_uint *Y = NULL;
118 mbedtls_mpi_uint *buff_m = NULL;
130 size_t bytes = limbs * sizeof(mbedtls_mpi_uint);
131 size_t copy_bytes = copy_limbs * sizeof(mbedtls_mpi_uint);
184 mbedtls_mpi_uint *tmp_X = NULL;
185 mbedtls_mpi_uint *tmp_Y = NULL;
[all …]
Dtest_suite_bignum_core.function19 static int mpi_core_verify_add(mbedtls_mpi_uint *A,
20 mbedtls_mpi_uint *B,
22 mbedtls_mpi_uint *S,
24 mbedtls_mpi_uint *X)
95 static int mpi_core_verify_add_if(mbedtls_mpi_uint *A,
96 mbedtls_mpi_uint *B,
98 mbedtls_mpi_uint *S,
100 mbedtls_mpi_uint *X)
160 mbedtls_mpi_uint X = 0;
206 if (sizeof(mbedtls_mpi_uint) == 8) {
[all …]
Dtest_suite_bignum_mod.function10 TEST_MEMORY_COMPARE((a).p, (a).limbs * sizeof(mbedtls_mpi_uint), \
11 (b).p, (b).limbs * sizeof(mbedtls_mpi_uint))
18 mbedtls_mpi_uint *p = NULL;
46 mbedtls_mpi_uint mp[MLIMBS];
102 mbedtls_mpi_uint *X = NULL;
120 const size_t bytes = limbs * sizeof(mbedtls_mpi_uint);
174 mbedtls_free((mbedtls_mpi_uint *) m.p);
187 mbedtls_mpi_uint *X = NULL;
225 mbedtls_free((mbedtls_mpi_uint *) m.p);
241 mbedtls_mpi_uint *X_raw = NULL;
[all …]
Dtest_suite_bignum_random.function121 mbedtls_mpi_uint *lower_bound = NULL;
122 mbedtls_mpi_uint *upper_bound = NULL;
123 mbedtls_mpi_uint *result = NULL;
156 mbedtls_mpi_uint *R_core = NULL;
204 mbedtls_mpi_uint *R_core = NULL;
205 mbedtls_mpi_uint *R_mod_raw = NULL;
206 mbedtls_mpi_uint *R_mod_digits = NULL;
275 mbedtls_mpi_uint *upper_bound = NULL;
278 mbedtls_mpi_uint *result = NULL;
342 bound_bytes.len = limbs * sizeof(mbedtls_mpi_uint);
[all …]
Dtest_suite_ecp.function1276 mbedtls_mpi_uint *X = NULL;
1277 mbedtls_mpi_uint *N = NULL;
1278 mbedtls_mpi_uint *res = NULL;
1286 int (*curve_func)(mbedtls_mpi_uint *X, size_t X_limbs);
1294 bytes = limbs_N * sizeof(mbedtls_mpi_uint);
1399 mbedtls_mpi_uint *p = NULL;
1412 bytes = p_limbs * sizeof(mbedtls_mpi_uint);
1443 mbedtls_mpi_uint *rX_raw = NULL;
1444 mbedtls_mpi_uint *A_inverse = NULL;
1445 mbedtls_mpi_uint *A = NULL;
[all …]
Dtest_suite_bignum.function596 size_t used_bit_count = used * 8 * sizeof(mbedtls_mpi_uint);
931 mbedtls_mpi_uint r;
1236 mbedtls_mpi_uint most_positive_plus_1 = (mbedtls_mpi_uint) 1 << (biL - 1);
1239 TEST_EQUAL((mbedtls_mpi_uint) most_negative,
1240 (mbedtls_mpi_uint) 1 << (biL - 1));
1241 TEST_EQUAL((mbedtls_mpi_uint) most_negative << 1, 0);
1284 TEST_EQUAL(X.p[0], ~(mbedtls_mpi_uint) 0);
/mbedtls-3.6.0/tests/src/
Dbignum_helpers.c29 int mbedtls_test_read_mpi_core(mbedtls_mpi_uint **pX, size_t *plimbs, in mbedtls_test_read_mpi_core()
54 if (byte_len % sizeof(mbedtls_mpi_uint) != 0) { in mbedtls_test_read_mpi_core()
55 byte_start += sizeof(mbedtls_mpi_uint) - byte_len % sizeof(mbedtls_mpi_uint); in mbedtls_test_read_mpi_core()
82 mbedtls_mpi_uint *p = NULL; in mbedtls_test_read_mpi_modulus()
111 mbedtls_free((mbedtls_mpi_uint *) N->p); in mbedtls_test_mpi_mod_modulus_free_with_limbs()
/mbedtls-3.6.0/include/mbedtls/
Dbignum.h119 typedef uint64_t mbedtls_mpi_uint; typedef
132 typedef uint64_t mbedtls_mpi_uint; typedef
148 typedef uint64_t mbedtls_mpi_uint; typedef
158 typedef uint64_t mbedtls_mpi_uint; typedef
169 typedef uint32_t mbedtls_mpi_uint; typedef
212 mbedtls_mpi_uint *MBEDTLS_PRIVATE(p);
799 mbedtls_mpi_uint b);
879 int mbedtls_mpi_mod_int(mbedtls_mpi_uint *r, const mbedtls_mpi *A,
/mbedtls-3.6.0/tests/include/test/
Dbignum_helpers.h43 int mbedtls_test_read_mpi_core(mbedtls_mpi_uint **pX, size_t *plimbs,

12