Home
last modified time | relevance | path

Searched refs:mbedtls_mpi (Results 1 – 25 of 82) sorted by relevance

1234

/third_party/mbedtls/include/mbedtls/
Dbignum.h205 typedef struct mbedtls_mpi { struct
228 mbedtls_mpi; typedef
238 void mbedtls_mpi_init(mbedtls_mpi *X);
247 void mbedtls_mpi_free(mbedtls_mpi *X);
262 int mbedtls_mpi_grow(mbedtls_mpi *X, size_t nblimbs);
279 int mbedtls_mpi_shrink(mbedtls_mpi *X, size_t nblimbs);
294 int mbedtls_mpi_copy(mbedtls_mpi *X, const mbedtls_mpi *Y);
302 void mbedtls_mpi_swap(mbedtls_mpi *X, mbedtls_mpi *Y);
332 int mbedtls_mpi_safe_cond_assign(mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign);
361 int mbedtls_mpi_safe_cond_swap(mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char swap);
[all …]
Drsa.h98 mbedtls_mpi MBEDTLS_PRIVATE(N); /*!< The public modulus. */
99 mbedtls_mpi MBEDTLS_PRIVATE(E); /*!< The public exponent. */
101 mbedtls_mpi MBEDTLS_PRIVATE(D); /*!< The private exponent. */
102 mbedtls_mpi MBEDTLS_PRIVATE(P); /*!< The first prime factor. */
103 mbedtls_mpi MBEDTLS_PRIVATE(Q); /*!< The second prime factor. */
105 mbedtls_mpi MBEDTLS_PRIVATE(DP); /*!< <code>D % (P - 1)</code>. */
106 mbedtls_mpi MBEDTLS_PRIVATE(DQ); /*!< <code>D % (Q - 1)</code>. */
107 mbedtls_mpi MBEDTLS_PRIVATE(QP); /*!< <code>1 / (Q % P)</code>. */
109 mbedtls_mpi MBEDTLS_PRIVATE(RN); /*!< cached <code>R^2 mod N</code>. */
111 mbedtls_mpi MBEDTLS_PRIVATE(RP); /*!< cached <code>R^2 mod P</code>. */
[all …]
Decdsa.h173 int mbedtls_ecdsa_sign(mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s,
174 const mbedtls_mpi *d, const unsigned char *buf, size_t blen,
217 int mbedtls_ecdsa_sign_det_ext(mbedtls_ecp_group *grp, mbedtls_mpi *r,
218 mbedtls_mpi *s, const mbedtls_mpi *d,
282 mbedtls_mpi *r, mbedtls_mpi *s,
283 const mbedtls_mpi *d,
342 mbedtls_mpi *r, mbedtls_mpi *s,
343 const mbedtls_mpi *d, const unsigned char *buf, size_t blen,
385 const mbedtls_ecp_point *Q, const mbedtls_mpi *r,
386 const mbedtls_mpi *s);
[all …]
Ddhm.h114 mbedtls_mpi MBEDTLS_PRIVATE(P); /*!< The prime modulus. */
115 mbedtls_mpi MBEDTLS_PRIVATE(G); /*!< The generator. */
116 mbedtls_mpi MBEDTLS_PRIVATE(X); /*!< Our secret value. */
117 mbedtls_mpi MBEDTLS_PRIVATE(GX); /*!< Our public key = \c G^X mod \c P. */
118 mbedtls_mpi MBEDTLS_PRIVATE(GY); /*!< The public key of the peer = \c G^Y mod \c P. */
119 mbedtls_mpi MBEDTLS_PRIVATE(K); /*!< The shared secret = \c G^(XY) mod \c P. */
120 mbedtls_mpi MBEDTLS_PRIVATE(RP); /*!< The cached value = \c R^2 mod \c P. */
121 mbedtls_mpi MBEDTLS_PRIVATE(Vi); /*!< The blinding value. */
122 mbedtls_mpi MBEDTLS_PRIVATE(Vf); /*!< The unblinding value. */
123 mbedtls_mpi MBEDTLS_PRIVATE(pX); /*!< The previous \c X. */
[all …]
Decp.h179 mbedtls_mpi MBEDTLS_PRIVATE(X); /*!< The X coordinate of the ECP point. */
180 mbedtls_mpi MBEDTLS_PRIVATE(Y); /*!< The Y coordinate of the ECP point. */
181 mbedtls_mpi MBEDTLS_PRIVATE(Z); /*!< The Z coordinate of the ECP point. */
234 mbedtls_mpi P; /*!< The prime modulus of the base field. */
235 mbedtls_mpi A; /*!< For Short Weierstrass: \p A in the equation. For
237 mbedtls_mpi B; /*!< For Short Weierstrass: \p B in the equation.
240 mbedtls_mpi N; /*!< The order of \p G. */
248 int(*MBEDTLS_PRIVATE(modp))(mbedtls_mpi *); /*!< The function for fast pseudo-reduction
426 mbedtls_mpi MBEDTLS_PRIVATE(d); /*!< our secret value */
964 const mbedtls_mpi *m, const mbedtls_ecp_point *P,
[all …]
Decdh.h100 mbedtls_mpi MBEDTLS_PRIVATE(d); /*!< The private key. */
103 mbedtls_mpi MBEDTLS_PRIVATE(z); /*!< The shared secret. */
120 mbedtls_mpi MBEDTLS_PRIVATE(d); /*!< The private key. */
123 mbedtls_mpi MBEDTLS_PRIVATE(z); /*!< The shared secret. */
127 mbedtls_mpi MBEDTLS_PRIVATE(_d); /*!< The previous \p d. */
190 int mbedtls_ecdh_gen_public(mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q,
225 int mbedtls_ecdh_compute_shared(mbedtls_ecp_group *grp, mbedtls_mpi *z,
226 const mbedtls_ecp_point *Q, const mbedtls_mpi *d,
Decjpake.h83 mbedtls_mpi MBEDTLS_PRIVATE(xm1); /**< My private key 1 C: x1, S: x3 */
84 mbedtls_mpi MBEDTLS_PRIVATE(xm2); /**< My private key 2 C: x2, S: x4 */
86 mbedtls_mpi MBEDTLS_PRIVATE(s); /**< Pre-shared secret (passphrase) */
/third_party/mbedtls/library/
Drsa_alt_helpers.h91 int mbedtls_rsa_deduce_primes(mbedtls_mpi const *N, mbedtls_mpi const *E,
92 mbedtls_mpi const *D,
93 mbedtls_mpi *P, mbedtls_mpi *Q);
116 int mbedtls_rsa_deduce_private_exponent(mbedtls_mpi const *P,
117 mbedtls_mpi const *Q,
118 mbedtls_mpi const *E,
119 mbedtls_mpi *D);
142 int mbedtls_rsa_deduce_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q,
143 const mbedtls_mpi *D, mbedtls_mpi *DP,
144 mbedtls_mpi *DQ, mbedtls_mpi *QP);
[all …]
Drsa_alt_helpers.c62 int mbedtls_rsa_deduce_primes(mbedtls_mpi const *N, in mbedtls_rsa_deduce_primes()
63 mbedtls_mpi const *E, mbedtls_mpi const *D, in mbedtls_rsa_deduce_primes()
64 mbedtls_mpi *P, mbedtls_mpi *Q) in mbedtls_rsa_deduce_primes()
73 mbedtls_mpi T; /* Holds largest odd divisor of DE - 1 */ in mbedtls_rsa_deduce_primes()
74 mbedtls_mpi K; /* Temporary holding the current candidate */ in mbedtls_rsa_deduce_primes()
194 int mbedtls_rsa_deduce_private_exponent(mbedtls_mpi const *P, in mbedtls_rsa_deduce_private_exponent()
195 mbedtls_mpi const *Q, in mbedtls_rsa_deduce_private_exponent()
196 mbedtls_mpi const *E, in mbedtls_rsa_deduce_private_exponent()
197 mbedtls_mpi *D) in mbedtls_rsa_deduce_private_exponent()
200 mbedtls_mpi K, L; in mbedtls_rsa_deduce_private_exponent()
[all …]
Dbignum.c68 void mbedtls_mpi_init(mbedtls_mpi *X) in mbedtls_mpi_init()
80 void mbedtls_mpi_free(mbedtls_mpi *X) in mbedtls_mpi_free()
99 int mbedtls_mpi_grow(mbedtls_mpi *X, size_t nblimbs) in mbedtls_mpi_grow()
130 int mbedtls_mpi_shrink(mbedtls_mpi *X, size_t nblimbs) in mbedtls_mpi_shrink()
174 static int mbedtls_mpi_resize_clear(mbedtls_mpi *X, size_t limbs) in mbedtls_mpi_resize_clear()
198 int mbedtls_mpi_copy(mbedtls_mpi *X, const mbedtls_mpi *Y) in mbedtls_mpi_copy()
242 void mbedtls_mpi_swap(mbedtls_mpi *X, mbedtls_mpi *Y) in mbedtls_mpi_swap()
244 mbedtls_mpi T; in mbedtls_mpi_swap()
248 memcpy(&T, X, sizeof(mbedtls_mpi)); in mbedtls_mpi_swap()
249 memcpy(X, Y, sizeof(mbedtls_mpi)); in mbedtls_mpi_swap()
[all …]
Decdsa.c50 mbedtls_mpi u1, u2; /* intermediate values */
88 mbedtls_mpi k; /* per-signature random */
89 mbedtls_mpi r; /* r value */
215 static int derive_mpi(const mbedtls_ecp_group *grp, mbedtls_mpi *x, in derive_mpi()
243 mbedtls_mpi *r, mbedtls_mpi *s, in mbedtls_ecdsa_sign_restartable()
244 const mbedtls_mpi *d, const unsigned char *buf, size_t blen, in mbedtls_ecdsa_sign_restartable()
253 mbedtls_mpi k, e, t; in mbedtls_ecdsa_sign_restartable()
254 mbedtls_mpi *pk = &k, *pr = r; in mbedtls_ecdsa_sign_restartable()
392 int mbedtls_ecdsa_sign(mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, in mbedtls_ecdsa_sign()
393 const mbedtls_mpi *d, const unsigned char *buf, size_t blen, in mbedtls_ecdsa_sign()
[all …]
Decp.c323 static void mpi_init_many(mbedtls_mpi *arr, size_t size) in mpi_init_many()
330 static void mpi_free_many(mbedtls_mpi *arr, size_t size) in mpi_free_many()
761 const mbedtls_mpi *X,
762 mbedtls_mpi *Y,
1000 static int ecp_modp(mbedtls_mpi *N, const mbedtls_ecp_group *grp) in ecp_modp()
1057 mbedtls_mpi *X, in mbedtls_mpi_mul_mod()
1058 const mbedtls_mpi *A, in mbedtls_mpi_mul_mod()
1059 const mbedtls_mpi *B) in mbedtls_mpi_mul_mod()
1086 mbedtls_mpi *X, in mbedtls_mpi_sub_mod()
1087 const mbedtls_mpi *A, in mbedtls_mpi_sub_mod()
[all …]
Ddhm.c53 static int dhm_read_bignum(mbedtls_mpi *X, in dhm_read_bignum()
91 static int dhm_check_range(const mbedtls_mpi *param, const mbedtls_mpi *P) in dhm_check_range()
93 mbedtls_mpi U; in dhm_check_range()
127 mbedtls_mpi *dest) in mbedtls_dhm_get_value()
129 const mbedtls_mpi *src = NULL; in mbedtls_dhm_get_value()
180 static int dhm_random_below(mbedtls_mpi *R, const mbedtls_mpi *M, in dhm_random_below()
285 const mbedtls_mpi *P, in mbedtls_dhm_set_group()
286 const mbedtls_mpi *G) in mbedtls_dhm_set_group()
359 mbedtls_mpi R; in dhm_update_blinding()
423 mbedtls_mpi GYb; in mbedtls_dhm_calc_secret()
[all …]
Decjpake.c242 mbedtls_mpi *h) in ecjpake_hash()
297 mbedtls_mpi r, h; in ecjpake_zkp_read()
360 const mbedtls_mpi *x, in ecjpake_zkp_write()
370 mbedtls_mpi v; in ecjpake_zkp_write()
371 mbedtls_mpi h; /* later recycled to hold r */ in ecjpake_zkp_write()
458 mbedtls_mpi *x, in ecjpake_kkp_write()
530 mbedtls_mpi *xm1, in ecjpake_kkpp_write()
532 mbedtls_mpi *xm2, in ecjpake_kkpp_write()
592 mbedtls_mpi one; in ecjpake_ecp_add3()
664 static int ecjpake_mul_secret(mbedtls_mpi *R, int sign, in ecjpake_mul_secret()
[all …]
Drsa.c75 const mbedtls_mpi *N, in mbedtls_rsa_import()
76 const mbedtls_mpi *P, const mbedtls_mpi *Q, in mbedtls_rsa_import()
77 const mbedtls_mpi *D, const mbedtls_mpi *E) in mbedtls_rsa_import()
375 mbedtls_mpi *N, mbedtls_mpi *P, mbedtls_mpi *Q, in mbedtls_rsa_export()
376 mbedtls_mpi *D, mbedtls_mpi *E) in mbedtls_rsa_export()
418 mbedtls_mpi *DP, mbedtls_mpi *DQ, mbedtls_mpi *QP) in mbedtls_rsa_export_crt()
545 mbedtls_mpi H, G, L; in mbedtls_rsa_gen_key()
731 mbedtls_mpi T; in mbedtls_rsa_public()
782 mbedtls_mpi R; in rsa_prepare_blinding()
840 static int rsa_unblind(mbedtls_mpi *T, mbedtls_mpi *Vf, const mbedtls_mpi *N) in rsa_unblind()
[all …]
Decp_invasive.h46 void mbedtls_ecp_fix_negative(mbedtls_mpi *N, signed char c, size_t bits);
72 mbedtls_mpi *d,
Decdh.c67 mbedtls_mpi *d, mbedtls_ecp_point *Q, in ecdh_gen_public_restartable()
93 int mbedtls_ecdh_gen_public(mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, in mbedtls_ecdh_gen_public()
106 mbedtls_mpi *z, in ecdh_compute_shared_restartable()
107 const mbedtls_ecp_point *Q, const mbedtls_mpi *d, in ecdh_compute_shared_restartable()
136 int mbedtls_ecdh_compute_shared(mbedtls_ecp_group *grp, mbedtls_mpi *z, in mbedtls_ecdh_compute_shared()
137 const mbedtls_ecp_point *Q, const mbedtls_mpi *d, in mbedtls_ecdh_compute_shared()
Dconstant_time.c744 int mbedtls_mpi_safe_cond_assign(mbedtls_mpi *X, in mbedtls_mpi_safe_cond_assign()
745 const mbedtls_mpi *Y, in mbedtls_mpi_safe_cond_assign()
775 int mbedtls_mpi_safe_cond_swap(mbedtls_mpi *X, in mbedtls_mpi_safe_cond_swap()
776 mbedtls_mpi *Y, in mbedtls_mpi_safe_cond_swap()
847 int mbedtls_mpi_lt_mpi_ct(const mbedtls_mpi *X, in mbedtls_mpi_lt_mpi_ct()
848 const mbedtls_mpi *Y, in mbedtls_mpi_lt_mpi_ct()
/third_party/mbedtls/tests/suites/
Dtest_suite_bignum.function15 static int sign_is_valid(const mbedtls_mpi *X)
102 mbedtls_mpi X, Y, Z;
123 mbedtls_mpi X;
149 mbedtls_mpi X;
169 mbedtls_mpi X;
190 mbedtls_mpi X;
221 mbedtls_mpi X;
251 mbedtls_mpi X;
285 mbedtls_mpi X, Y;
315 mbedtls_mpi X;
[all …]
Dtest_suite_debug.data40 Debug print mbedtls_mpi: 0 (empty representation)
43 Debug print mbedtls_mpi: 0 (non-empty representation)
46 Debug print mbedtls_mpi #2: 3 bits
49 Debug print mbedtls_mpi: 49 bits
52 Debug print mbedtls_mpi: 759 bits
55 Debug print mbedtls_mpi: 764 bits #1
58 Debug print mbedtls_mpi: 764 bits #2
Dtest_suite_dhm.function6 const mbedtls_mpi *expected)
8 mbedtls_mpi actual;
24 static int check_dhm_param_output(const mbedtls_mpi *expected,
30 mbedtls_mpi actual;
235 mbedtls_mpi P, G;
266 mbedtls_mpi P, G;
Dtest_suite_pkcs1_v21.function19 mbedtls_mpi N, E;
69 mbedtls_mpi N, P, Q, E;
130 mbedtls_mpi N, P, Q, E;
191 mbedtls_mpi N, E;
228 mbedtls_mpi N, E;
Dtest_suite_bignum_random.function47 static int sign_is_valid(const mbedtls_mpi *X)
154 mbedtls_mpi max_legacy;
157 mbedtls_mpi R_legacy;
315 mbedtls_mpi B = { 1, limbs, upper_bound };
316 mbedtls_mpi R = { 1, limbs, result };
376 mbedtls_mpi upper_bound;
377 mbedtls_mpi result;
464 mbedtls_mpi upper_bound;
465 mbedtls_mpi result;
/third_party/mbedtls/tests/include/alt-dummy/
Decp_alt.h24 const mbedtls_mpi P;
25 const mbedtls_mpi A;
26 const mbedtls_mpi B;
28 const mbedtls_mpi N;
/third_party/rust/crates/bindgen/bindgen-tests/tests/expectations/tests/
Dconvert-cpp-comment-to-rust.rs12 pub struct mbedtls_mpi { struct
20 impl Default for mbedtls_mpi { argument

1234