Home
last modified time | relevance | path

Searched refs:grp (Results 1 – 25 of 36) sorted by relevance

12

/openthread-3.5.0/third_party/mbedtls/repo/library/
Decp.c432 int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp, in mbedtls_ecp_check_budget() argument
436 ECP_VALIDATE_RET( grp != NULL ); in mbedtls_ecp_check_budget()
442 if( grp->pbits >= 512 ) in mbedtls_ecp_check_budget()
444 else if( grp->pbits >= 384 ) in mbedtls_ecp_check_budget()
660 mbedtls_ecp_curve_type mbedtls_ecp_get_type( const mbedtls_ecp_group *grp ) in mbedtls_ecp_get_type() argument
662 if( grp->G.X.p == NULL ) in mbedtls_ecp_get_type()
665 if( grp->G.Y.p == NULL ) in mbedtls_ecp_get_type()
686 void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ) in mbedtls_ecp_group_init() argument
688 ECP_VALIDATE( grp != NULL ); in mbedtls_ecp_group_init()
690 grp->id = MBEDTLS_ECP_DP_NONE; in mbedtls_ecp_group_init()
[all …]
Decjpake.c62 mbedtls_ecp_group_init( &ctx->grp ); in mbedtls_ecjpake_init()
85 mbedtls_ecp_group_free( &ctx->grp ); in mbedtls_ecjpake_free()
120 MBEDTLS_MPI_CHK( mbedtls_ecp_group_load( &ctx->grp, curve ) ); in mbedtls_ecjpake_setup()
139 ctx->grp.id == MBEDTLS_ECP_DP_NONE || in mbedtls_ecjpake_check()
153 const mbedtls_ecp_group *grp, in ecjpake_write_len_point() argument
164 ret = mbedtls_ecp_point_write_binary( grp, P, pf, in ecjpake_write_len_point()
186 const mbedtls_ecp_group *grp, in ecjpake_hash() argument
202 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, G ) ); in ecjpake_hash()
203 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, V ) ); in ecjpake_hash()
204 MBEDTLS_MPI_CHK( ecjpake_write_len_point( &p, end, grp, pf, X ) ); in ecjpake_hash()
[all …]
Decdsa.c174 MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, ECDSA_RS_ECP, ops ) );
227 static int derive_mpi( const mbedtls_ecp_group *grp, mbedtls_mpi *x, in derive_mpi() argument
231 size_t n_size = ( grp->nbits + 7 ) / 8; in derive_mpi()
235 if( use_size * 8 > grp->nbits ) in derive_mpi()
236 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( x, use_size * 8 - grp->nbits ) ); in derive_mpi()
239 if( mbedtls_mpi_cmp_mpi( x, &grp->N ) >= 0 ) in derive_mpi()
240 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( x, x, &grp->N ) ); in derive_mpi()
252 static int ecdsa_sign_restartable( mbedtls_ecp_group *grp, in ecdsa_sign_restartable() argument
267 if( ! mbedtls_ecdsa_can_do( grp->id ) || grp->N.p == NULL ) in ecdsa_sign_restartable()
271 if( mbedtls_mpi_cmp_int( d, 1 ) < 0 || mbedtls_mpi_cmp_mpi( d, &grp->N ) >= 0 ) in ecdsa_sign_restartable()
[all …]
Decp_curves.c564 static int ecp_group_load( mbedtls_ecp_group *grp, in ecp_group_load() argument
572 ecp_mpi_load( &grp->P, p, plen ); in ecp_group_load()
574 ecp_mpi_load( &grp->A, a, alen ); in ecp_group_load()
575 ecp_mpi_load( &grp->B, b, blen ); in ecp_group_load()
576 ecp_mpi_load( &grp->N, n, nlen ); in ecp_group_load()
578 ecp_mpi_load( &grp->G.X, gx, gxlen ); in ecp_group_load()
579 ecp_mpi_load( &grp->G.Y, gy, gylen ); in ecp_group_load()
580 ecp_mpi_set1( &grp->G.Z ); in ecp_group_load()
582 grp->pbits = mbedtls_mpi_bitlen( &grp->P ); in ecp_group_load()
583 grp->nbits = mbedtls_mpi_bitlen( &grp->N ); in ecp_group_load()
[all …]
Decdh.c51 return( ctx->grp.id ); in mbedtls_ecdh_grp_id()
72 static int ecdh_gen_public_restartable( mbedtls_ecp_group *grp, in ecdh_gen_public_restartable() argument
84 MBEDTLS_MPI_CHK( mbedtls_ecp_gen_privkey( grp, d, f_rng, p_rng ) ); in ecdh_gen_public_restartable()
86 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, Q, d, &grp->G, in ecdh_gen_public_restartable()
96 int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, in mbedtls_ecdh_gen_public() argument
100 ECDH_VALIDATE_RET( grp != NULL ); in mbedtls_ecdh_gen_public()
104 return( ecdh_gen_public_restartable( grp, d, Q, f_rng, p_rng, NULL ) ); in mbedtls_ecdh_gen_public()
112 static int ecdh_compute_shared_restartable( mbedtls_ecp_group *grp, in ecdh_compute_shared_restartable() argument
124 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, &P, d, Q, in ecdh_compute_shared_restartable()
144 int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z, in mbedtls_ecdh_compute_shared() argument
[all …]
Dpsa_crypto_ecp.c115 mbedtls_ecp_group_load( &ecp->grp, grp_id ) ); in mbedtls_psa_ecp_load_representation()
124 mbedtls_ecp_point_read_binary( &ecp->grp, &ecp->Q, in mbedtls_psa_ecp_load_representation()
132 mbedtls_ecp_check_pubkey( &ecp->grp, &ecp->Q ) ); in mbedtls_psa_ecp_load_representation()
140 mbedtls_ecp_read_key( ecp->grp.id, in mbedtls_psa_ecp_load_representation()
187 *bits = ecp->grp.nbits + 1; in mbedtls_psa_ecp_import_key()
189 *bits = ecp->grp.nbits; in mbedtls_psa_ecp_import_key()
222 mbedtls_ecp_mul( &ecp->grp, &ecp->Q, &ecp->d, &ecp->grp.G, in mbedtls_psa_ecp_export_key()
230 mbedtls_ecp_point_write_binary( &ecp->grp, &ecp->Q, in mbedtls_psa_ecp_export_key()
242 if( data_size < PSA_BITS_TO_BYTES( ecp->grp.nbits ) ) in mbedtls_psa_ecp_export_key()
248 PSA_BITS_TO_BYTES( ecp->grp.nbits ) ) ); in mbedtls_psa_ecp_export_key()
[all …]
Dpkparse.c239 static int pk_group_from_specified( const mbedtls_asn1_buf *params, mbedtls_ecp_group *grp ) in pk_group_from_specified() argument
287 if( ( ret = mbedtls_asn1_get_mpi( &p, end_field, &grp->P ) ) != 0 ) in pk_group_from_specified()
290 grp->pbits = mbedtls_mpi_bitlen( &grp->P ); in pk_group_from_specified()
316 ( ret = mbedtls_mpi_read_binary( &grp->A, p, len ) ) != 0 ) in pk_group_from_specified()
324 ( ret = mbedtls_mpi_read_binary( &grp->B, p, len ) ) != 0 ) in pk_group_from_specified()
345 if( ( ret = mbedtls_ecp_point_read_binary( grp, &grp->G, in pk_group_from_specified()
354 len != mbedtls_mpi_size( &grp->P ) + 1 || in pk_group_from_specified()
355 mbedtls_mpi_read_binary( &grp->G.X, p + 1, len - 1 ) != 0 || in pk_group_from_specified()
356 mbedtls_mpi_lset( &grp->G.Y, p[0] - 2 ) != 0 || in pk_group_from_specified()
357 mbedtls_mpi_lset( &grp->G.Z, 1 ) != 0 ) in pk_group_from_specified()
[all …]
Dpk_wrap.c228 return( ((mbedtls_ecp_keypair *) ctx)->grp.pbits ); in eckey_get_bitlen()
346 if( rs->ecdsa_ctx.grp.pbits == 0 ) in eckey_verify_rs_wrap()
371 if( rs->ecdsa_ctx.grp.pbits == 0 ) in eckey_sign_rs_wrap()
557 mbedtls_ecc_group_to_psa( ctx->grp.id, &curve_bits ); in ecdsa_verify_wrap()
558 const size_t signature_part_size = ( ctx->grp.nbits + 7 ) / 8; in ecdsa_verify_wrap()
Dpkwrite.c118 if( ( ret = mbedtls_ecp_point_write_binary( &ec->grp, &ec->Q, in pk_write_ec_pubkey()
147 if( ( ret = mbedtls_oid_get_oid_by_ec_grp( ec->grp.id, &oid, &oid_len ) ) != 0 ) in pk_write_ec_param()
162 size_t byte_length = ( ec->grp.pbits + 7 ) / 8; in pk_write_ec_private()
/openthread-3.5.0/third_party/mbedtls/repo/tests/suites/
Dtest_suite_ecp.function45 mbedtls_ecp_group grp;
75 mbedtls_ecp_group_copy( NULL, &grp ) );
77 mbedtls_ecp_group_copy( &grp, NULL ) );
85 mbedtls_ecp_gen_privkey( &grp,
90 mbedtls_ecp_gen_privkey( &grp,
121 mbedtls_ecp_point_write_binary( &grp, NULL,
126 mbedtls_ecp_point_write_binary( &grp, &P,
131 mbedtls_ecp_point_write_binary( &grp, &P,
136 mbedtls_ecp_point_write_binary( &grp, &P,
145 mbedtls_ecp_point_read_binary( &grp, NULL, buf,
[all …]
Dtest_suite_ecdsa.function15 mbedtls_ecp_group grp;
37 mbedtls_ecdsa_sign( &grp, NULL, &m, &m,
42 mbedtls_ecdsa_sign( &grp, &m, NULL, &m,
47 mbedtls_ecdsa_sign( &grp, &m, &m, NULL,
52 mbedtls_ecdsa_sign( &grp, &m, &m, &m,
57 mbedtls_ecdsa_sign( &grp, &m, &m, &m,
69 mbedtls_ecdsa_sign_det_ext( &grp, NULL, &m, &m,
75 mbedtls_ecdsa_sign_det_ext( &grp, &m, NULL, &m,
81 mbedtls_ecdsa_sign_det_ext( &grp, &m, &m, NULL,
87 mbedtls_ecdsa_sign_det_ext( &grp, &m, &m, &m,
[all …]
Dtest_suite_ecdh.function8 TEST_ASSERT( mbedtls_ecp_group_load( &ecp->grp, grp_id ) == 0 );
9 TEST_ASSERT( mbedtls_ecp_point_read_binary( &ecp->grp,
13 TEST_ASSERT( mbedtls_ecp_check_pubkey( &ecp->grp,
28 TEST_ASSERT( mbedtls_ecp_check_privkey( &ecp->grp, &ecp->d ) == 0 );
30 TEST_ASSERT( mbedtls_ecp_mul( &ecp->grp, &ecp->Q, &ecp->d,
31 &ecp->grp.G,
56 mbedtls_ecp_group grp;
79 mbedtls_ecdh_gen_public( &grp, NULL, &P,
83 mbedtls_ecdh_gen_public( &grp, &m, NULL,
87 mbedtls_ecdh_gen_public( &grp, &m, &P,
[all …]
Dtest_suite_random.function179 mbedtls_ecp_group grp;
183 mbedtls_ecp_group_init( &grp );
189 TEST_EQUAL( 0, mbedtls_ecp_group_load( &grp, curve ) );
191 TEST_EQUAL( 0, mbedtls_ecdsa_sign( &grp, &r, &s, &d,
199 mbedtls_ecp_group_free( &grp );
Dtest_suite_pkparse.function83 TEST_ASSERT( mbedtls_ecp_check_pubkey( &eckey->grp, &eckey->Q ) == 0 );
108 TEST_ASSERT( mbedtls_ecp_check_privkey( &eckey->grp, &eckey->d ) == 0 );
Dtest_suite_ecjpake.function79 MBEDTLS_MPI_CHK( mbedtls_ecp_point_read_binary( &ctx->grp,
81 MBEDTLS_MPI_CHK( mbedtls_ecp_point_read_binary( &ctx->grp,
83 MBEDTLS_MPI_CHK( mbedtls_ecp_point_read_binary( &ctx->grp,
85 MBEDTLS_MPI_CHK( mbedtls_ecp_point_read_binary( &ctx->grp,
/openthread-3.5.0/third_party/mbedtls/repo/include/mbedtls/
Decp_internal.h79 unsigned char mbedtls_internal_ecp_grp_capable( const mbedtls_ecp_group *grp );
96 int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp );
104 void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp );
124 int mbedtls_internal_ecp_randomize_jac( const mbedtls_ecp_group *grp,
169 int mbedtls_internal_ecp_add_mixed( const mbedtls_ecp_group *grp,
194 int mbedtls_internal_ecp_double_jac( const mbedtls_ecp_group *grp,
224 int mbedtls_internal_ecp_normalize_jac_many( const mbedtls_ecp_group *grp,
242 int mbedtls_internal_ecp_normalize_jac( const mbedtls_ecp_group *grp,
251 int mbedtls_internal_ecp_double_add_mxz( const mbedtls_ecp_group *grp,
272 int mbedtls_internal_ecp_randomize_mxz( const mbedtls_ecp_group *grp,
[all …]
Decp.h406 int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp,
412 MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, rs_ctx, \
434 mbedtls_ecp_group grp; /*!< Elliptic curve and base point */ member
523 mbedtls_ecp_curve_type mbedtls_ecp_get_type( const mbedtls_ecp_group *grp );
604 void mbedtls_ecp_group_init( mbedtls_ecp_group *grp );
627 void mbedtls_ecp_group_free( mbedtls_ecp_group *grp );
761 int mbedtls_ecp_point_write_binary( const mbedtls_ecp_group *grp,
788 int mbedtls_ecp_point_read_binary( const mbedtls_ecp_group *grp,
810 int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp,
836 int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp,
[all …]
Decdh.h86 mbedtls_ecp_group grp; /*!< The elliptic curve used. */ member
107 mbedtls_ecp_group grp; /*!< The elliptic curve used. */ member
179 int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q,
217 int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z,
Decdsa.h172 int mbedtls_ecdsa_sign( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s,
231 int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r,
277 int mbedtls_ecdsa_sign_det_ext( mbedtls_ecp_group *grp, mbedtls_mpi *r,
317 int mbedtls_ecdsa_verify( mbedtls_ecp_group *grp,
Decjpake.h77 mbedtls_ecp_group grp; /**< Elliptic curve */ member
/openthread-3.5.0/third_party/mbedtls/repo/programs/pkey/
Decdh_curve25519.c94 ret = mbedtls_ecp_group_load( &ctx_cli.grp, MBEDTLS_ECP_DP_CURVE25519 ); in main()
101 ret = mbedtls_ecdh_gen_public( &ctx_cli.grp, &ctx_cli.d, &ctx_cli.Q, in main()
124 ret = mbedtls_ecp_group_load( &ctx_srv.grp, MBEDTLS_ECP_DP_CURVE25519 ); in main()
131 ret = mbedtls_ecdh_gen_public( &ctx_srv.grp, &ctx_srv.d, &ctx_srv.Q, in main()
168 ret = mbedtls_ecdh_compute_shared( &ctx_srv.grp, &ctx_srv.z, in main()
199 ret = mbedtls_ecdh_compute_shared( &ctx_cli.grp, &ctx_cli.z, in main()
Decdsa.c87 if( mbedtls_ecp_point_write_binary( &key->grp, &key->Q, in dump_pubkey()
159 mbedtls_printf( " ok (key size: %d bits)\n", (int) ctx_sign.grp.pbits ); in main()
207 if( ( ret = mbedtls_ecp_group_copy( &ctx_verify.grp, &ctx_sign.grp ) ) != 0 ) in main()
/openthread-3.5.0/third_party/mbedtls/repo/programs/test/
Dbenchmark.c253 void ecp_clear_precomputed( mbedtls_ecp_group *grp ) in ecp_clear_precomputed() argument
255 if( grp->T != NULL ) in ecp_clear_precomputed()
258 for( i = 0; i < grp->T_size; i++ ) in ecp_clear_precomputed()
259 mbedtls_ecp_point_free( &grp->T[i] ); in ecp_clear_precomputed()
260 mbedtls_free( grp->T ); in ecp_clear_precomputed()
262 grp->T = NULL; in ecp_clear_precomputed()
263 grp->T_size = 0; in ecp_clear_precomputed()
891 ecp_clear_precomputed( &ecdsa.grp ); in main()
917 ecp_clear_precomputed( &ecdsa.grp ); in main()
951 mbedtls_ecp_group grp; in main() local
[all …]
/openthread-3.5.0/third_party/mbedtls/repo/programs/fuzz/
Dfuzz_privkey.c51 mbedtls_ecp_group_id grp_id = ecp->grp.id; in LLVMFuzzerTestOneInput()
Dfuzz_pubkey.c46 mbedtls_ecp_group_id grp_id = ecp->grp.id; in LLVMFuzzerTestOneInput()

12