Home
last modified time | relevance | path

Searched refs:G (Results 1 – 25 of 32) sorted by relevance

12

/mbedtls-latest/library/
Decjpake.c195 const mbedtls_ecp_point *G, in ecjpake_hash() argument
209 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, G)); in ecjpake_hash()
246 const mbedtls_ecp_point *G, in ecjpake_zkp_read() argument
292 MBEDTLS_MPI_CHK(ecjpake_hash(md_type, grp, pf, G, &V, X, id, &h)); in ecjpake_zkp_read()
294 &VV, &h, X, &r, G)); in ecjpake_zkp_read()
316 const mbedtls_ecp_point *G, in ecjpake_zkp_write() argument
341 G, &v, &V, f_rng, p_rng)); in ecjpake_zkp_write()
342 MBEDTLS_MPI_CHK(ecjpake_hash(md_type, grp, pf, G, &V, X, id, &h)); in ecjpake_zkp_write()
377 const mbedtls_ecp_point *G, in ecjpake_kkp_read() argument
401 MBEDTLS_MPI_CHK(ecjpake_zkp_read(md_type, grp, pf, G, X, id, p, end)); in ecjpake_kkp_read()
[all …]
Dpsa_crypto_ffdh.c32 mbedtls_mpi *G) in mbedtls_psa_ffdh_set_prime_generator() argument
40 if (P == NULL && G == NULL) { in mbedtls_psa_ffdh_set_prime_generator()
124 if (G != NULL) { 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()
153 mbedtls_mpi GX, G, X, P; in mbedtls_psa_ffdh_export_public_key() local
167 mbedtls_mpi_init(&GX); mbedtls_mpi_init(&G); in mbedtls_psa_ffdh_export_public_key()
172 status = mbedtls_psa_ffdh_set_prime_generator(key_len, &P, &G); 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()
188 mbedtls_mpi_free(&P); mbedtls_mpi_free(&G); in mbedtls_psa_ffdh_export_public_key()
269 mbedtls_mpi P, G, X, GY, K; in mbedtls_psa_ffdh_key_agreement() local
[all …]
Ddhm.c123 src = &ctx->G; in mbedtls_dhm_get_value()
153 (ret = dhm_read_bignum(&ctx->G, p, end)) != 0 || in mbedtls_dhm_read_params()
209 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&ctx->GX, &ctx->G, &ctx->X, in dhm_make_common()
252 n2 = mbedtls_mpi_size(&ctx->G); in mbedtls_dhm_make_params()
257 DHM_MPI_EXPORT(&ctx->G, n2); in mbedtls_dhm_make_params()
274 const mbedtls_mpi *G) in mbedtls_dhm_set_group() argument
279 (ret = mbedtls_mpi_copy(&ctx->G, G)) != 0) { in mbedtls_dhm_set_group()
472 mbedtls_mpi_free(&ctx->G); in mbedtls_dhm_free()
536 (ret = mbedtls_asn1_get_mpi(&p, end, &dhm->G)) != 0) { in mbedtls_dhm_parse_dhm()
Dpkparse.c222 if ((ret = mbedtls_ecp_point_read_binary(grp, &grp->G, in pk_group_from_specified()
231 mbedtls_mpi_read_binary(&grp->G.X, p + 1, len - 1) != 0 || in pk_group_from_specified()
232 mbedtls_mpi_lset(&grp->G.Y, p[0] - 2) != 0 || in pk_group_from_specified()
233 mbedtls_mpi_lset(&grp->G.Z, 1) != 0) { in pk_group_from_specified()
279 mbedtls_mpi_cmp_mpi(&grp->G.X, &ref.G.X) == 0 && in pk_group_id_from_group()
280 mbedtls_mpi_cmp_mpi(&grp->G.Z, &ref.G.Z) == 0 && in pk_group_id_from_group()
282 mbedtls_mpi_get_bit(&grp->G.Y, 0) == mbedtls_mpi_get_bit(&ref.G.Y, 0)) { in pk_group_id_from_group()
328 mbedtls_ecp_point_free(&grp.G); in pk_ecc_group_id_from_specified()
Decp_curves.c4530 ecp_mpi_load(&grp->G.X, gx, gxlen); in ecp_group_load()
4531 ecp_mpi_load(&grp->G.Y, gy, gylen); in ecp_group_load()
4532 ecp_mpi_set1(&grp->G.Z); in ecp_group_load()
4590 #define LOAD_GROUP_A(G) ecp_group_load(grp, \ argument
4591 G ## _p, sizeof(G ## _p), \
4592 G ## _a, sizeof(G ## _a), \
4593 G ## _b, sizeof(G ## _b), \
4594 G ## _gx, sizeof(G ## _gx), \
4595 G ## _gy, sizeof(G ## _gy), \
4596 G ## _n, sizeof(G ## _n), \
[all …]
Decp_curves_new.c4540 ecp_mpi_load(&grp->G.X, gx, gxlen); in ecp_group_load()
4541 ecp_mpi_load(&grp->G.Y, gy, gylen); in ecp_group_load()
4542 ecp_mpi_set1(&grp->G.Z); in ecp_group_load()
4620 #define LOAD_GROUP_A(G) ecp_group_load(grp, \ argument
4621 G ## _p, sizeof(G ## _p), \
4622 G ## _a, sizeof(G ## _a), \
4623 G ## _b, sizeof(G ## _b), \
4624 G ## _gx, sizeof(G ## _gx), \
4625 G ## _gy, sizeof(G ## _gy), \
4626 G ## _n, sizeof(G ## _n), \
[all …]
Decp.c488 if (grp->G.X.p == NULL) { in mbedtls_ecp_get_type()
492 if (grp->G.Y.p == NULL) { in mbedtls_ecp_get_type()
518 mbedtls_ecp_point_init(&grp->G); in mbedtls_ecp_group_init()
582 mbedtls_ecp_point_free(&grp->G); in mbedtls_ecp_group_free()
2305 p_eq_g = (MPI_ECP_CMP(&P->Y, &grp->G.Y) == 0 && in ecp_mul_comb()
2306 MPI_ECP_CMP(&P->X, &grp->G.X) == 0); in ecp_mul_comb()
3162 const mbedtls_ecp_point *G, in mbedtls_ecp_gen_keypair_base() argument
3169 MBEDTLS_MPI_CHK(mbedtls_ecp_mul(grp, Q, d, G, f_rng, p_rng)); in mbedtls_ecp_gen_keypair_base()
3183 return mbedtls_ecp_gen_keypair_base(grp, &grp->G, d, Q, f_rng, p_rng); in mbedtls_ecp_gen_keypair()
3408 MBEDTLS_MPI_CHK(mbedtls_ecp_mul(&grp, &Q, &prv->d, &prv->grp.G, f_rng, p_rng)); in mbedtls_ecp_check_pub_priv()
[all …]
Dbignum.c1749 int mbedtls_mpi_gcd(mbedtls_mpi *G, const mbedtls_mpi *A, const mbedtls_mpi *B) in mbedtls_mpi_gcd() argument
1768 ret = mbedtls_mpi_copy(G, A); in mbedtls_mpi_gcd()
1843 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(G, &TB)); in mbedtls_mpi_gcd()
1907 mbedtls_mpi G, TA, TU, U1, U2, TB, TV, V1, V2; in mbedtls_mpi_inv_mod() local
1914 mbedtls_mpi_init(&G); mbedtls_mpi_init(&TB); mbedtls_mpi_init(&TV); in mbedtls_mpi_inv_mod()
1917 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(&G, A, N)); in mbedtls_mpi_inv_mod()
1919 if (mbedtls_mpi_cmp_int(&G, 1) != 0) { in mbedtls_mpi_inv_mod()
1983 mbedtls_mpi_free(&G); mbedtls_mpi_free(&TB); mbedtls_mpi_free(&TV); in mbedtls_mpi_inv_mod()
Drsa.c1050 mbedtls_mpi H, G, L; in mbedtls_rsa_gen_key() local
1063 mbedtls_mpi_init(&G); in mbedtls_rsa_gen_key()
1108 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(&G, &ctx->E, &H)); in mbedtls_rsa_gen_key()
1109 if (mbedtls_mpi_cmp_int(&G, 1) != 0) { in mbedtls_rsa_gen_key()
1114 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(&G, &ctx->P, &ctx->Q)); in mbedtls_rsa_gen_key()
1115 MBEDTLS_MPI_CHK(mbedtls_mpi_div_mpi(&L, NULL, &H, &G)); in mbedtls_rsa_gen_key()
1149 mbedtls_mpi_free(&G); in mbedtls_rsa_gen_key()
Dpsa_crypto_ecp.c264 mbedtls_ecp_mul(&ecp->grp, &ecp->Q, &ecp->d, &ecp->grp.G, in mbedtls_psa_ecp_export_key()
443 &ecp->d, &ecp->grp.G, in mbedtls_psa_ecp_load_public_part()
Decdsa.c317 MBEDTLS_MPI_CHK(mbedtls_ecp_mul_restartable(grp, &R, pk, &grp->G, in mbedtls_ecdsa_sign_restartable()
562 &R, pu1, &grp->G, pu2, Q, ECDSA_RS_ECP)); in mbedtls_ecdsa_verify_restartable()
Dpk_ecc.c140 return mbedtls_ecp_mul(&eck->grp, &eck->Q, &eck->d, &eck->grp.G, f_rng, p_rng); in mbedtls_pk_ecc_set_pubkey_from_prv()
/mbedtls-latest/tests/suites/
Dtest_suite_dhm.function68 /* Check ske: it must contain P, G and G^X, each prefixed with a
73 if (!check_dhm_param_output(&ctx->G, ske, ske_len, &offset)) {
123 TEST_ASSERT(mbedtls_test_read_mpi(&ctx_srv.G, input_G) == 0);
126 TEST_ASSERT(check_get_value(&ctx_srv, MBEDTLS_DHM_PARAM_G, &ctx_srv.G));
147 TEST_ASSERT(check_get_value(&ctx_cli, MBEDTLS_DHM_PARAM_G, &ctx_srv.G));
235 mbedtls_mpi P, G;
240 mbedtls_mpi_init(&G);
247 TEST_ASSERT(mbedtls_test_read_mpi(&G, input_G) == 0);
249 TEST_ASSERT(mbedtls_dhm_set_group(&ctx, &P, &G) == 0);
257 mbedtls_mpi_free(&G);
[all …]
Dtest_suite_dhm.data79 Diffie-Hellman with G=0
82 Diffie-Hellman with G=1
85 Diffie-Hellman with G=-1
88 Diffie-Hellman with G=P-1
91 Diffie-Hellman with G=P-2
94 Diffie-Hellman with G=P
97 Diffie-Hellman with G=P+1
100 Diffie-Hellman with G=P+2
Dtest_suite_ecp.function34 if (mbedtls_ecp_point_cmp(&grp1->G, &grp2->G) != 0) {
207 ret = mbedtls_ecp_mul_restartable(&grp, &R, &dA, &grp.G,
258 * Compute R = u1 * G + u2 * Q
294 &u1, &grp.G, &u2, &Q, &ctx);
308 &u1, &grp.G, &u2, &Q, &ctx);
339 TEST_ASSERT(mbedtls_ecp_check_pubkey(&grp, &grp.G) == 0);
350 TEST_ASSERT(mbedtls_ecp_mul(&grp, &R, &dA, &grp.G,
361 TEST_ASSERT(mbedtls_ecp_mul(&grp, &R, &dB, &grp.G,
396 TEST_ASSERT(mbedtls_ecp_check_pubkey(&grp, &grp.G) == 0);
404 TEST_ASSERT(mbedtls_ecp_mul(&grp, &R, &dA, &grp.G,
[all …]
Dtest_suite_ecdsa.function128 /* Invalid signature: wrong public key (G instead of Q) */
130 &grp.G, &r_check, &s_check), MBEDTLS_ERR_ECP_VERIFY_FAILED);
/mbedtls-latest/programs/pkey/
Ddh_genprime.c49 mbedtls_mpi G, P, Q; in main() local
58 mbedtls_mpi_init(&G); mbedtls_mpi_init(&P); mbedtls_mpi_init(&Q); in main()
85 if ((ret = mbedtls_mpi_read_string(&G, 10, GENERATOR)) != 0) { in main()
141 ((ret = mbedtls_mpi_write_file("G = ", &G, 16, fout)) != 0)) { in main()
154 mbedtls_mpi_free(&G); mbedtls_mpi_free(&P); mbedtls_mpi_free(&Q); in main()
Ddh_prime.txt2 G = 02
/mbedtls-latest/include/mbedtls/
Ddhm.h103 mbedtls_mpi MBEDTLS_PRIVATE(G); /*!< The generator. */
206 const mbedtls_mpi *G);
Decp.h243 mbedtls_ecp_point G; /*!< The generator of the subgroup used. */ member
1213 const mbedtls_ecp_point *G,
Dbignum.h983 int mbedtls_mpi_gcd(mbedtls_mpi *G, const mbedtls_mpi *A,
/mbedtls-latest/programs/test/
Dbenchmark.c1090 mbedtls_mpi P, G; in main() local
1091 mbedtls_mpi_init(&P); mbedtls_mpi_init(&G); in main()
1098 mbedtls_mpi_read_binary(&G, dhm_G[i], in main()
1100 mbedtls_dhm_set_group(&dhm, &P, &G) != 0) { in main()
1124 mbedtls_mpi_free(&P), mbedtls_mpi_free(&G); in main()
/mbedtls-latest/tests/include/alt-dummy/
Decp_alt.h15 const mbedtls_ecp_point G; member
/mbedtls-latest/tests/
Dcompat.sh154 print_test_case m G "$G_CIPHERS"
155 print_test_case G m "$G_CIPHERS"
/mbedtls-latest/docs/architecture/
Dalternative-implementations.md50 * DHM: if `MBEDTLS_DEBUG_C` is enabled, `mbedtls_dhm_context` must have the fields `P`, `Q`, `G`, `…
51 * ECP: `mbedtls_ecp_group` must have the fields `id`, `P`, `A`, `B`, `G`, `N`, `pbits` and `nbits`.

12