/optee_os/lib/libmbedtls/mbedtls/library/ |
A D | ecp.c | 700 grp->pbits = 0; in mbedtls_ecp_group_init() 701 grp->nbits = 0; in mbedtls_ecp_group_init() 702 grp->h = 0; in mbedtls_ecp_group_init() 707 grp->T = NULL; in mbedtls_ecp_group_init() 708 grp->T_size = 0; in mbedtls_ecp_group_init() 2330 T = grp->T; in ecp_mul_comb() 3051 return( ecp_check_bad_points_mx( &pt->X, &grp->P, grp->id ) ); in ecp_check_pubkey_mx() 3369 pub->grp.id != prv->grp.id || in mbedtls_ecp_check_pub_priv() 3381 mbedtls_ecp_group_copy( &grp, &prv->grp ); in mbedtls_ecp_check_pub_priv() 3551 &grp, &R, &m, &grp.G, in mbedtls_ecp_self_test() [all …]
|
A D | ecjpake.c | 62 mbedtls_ecp_group_init( &ctx->grp ); in mbedtls_ecjpake_init() 85 mbedtls_ecp_group_free( &ctx->grp ); in mbedtls_ecjpake_free() 139 ctx->grp.id == MBEDTLS_ECP_DP_NONE || in mbedtls_ecjpake_check() 164 ret = mbedtls_ecp_point_write_binary( grp, P, pf, in ecjpake_write_len_point() 519 &ctx->grp.G, in mbedtls_ecjpake_read_round_one() 538 &ctx->grp.G, in mbedtls_ecjpake_write_round_one() 576 mbedtls_ecp_group grp; in mbedtls_ecjpake_read_round_two() local 582 mbedtls_ecp_group_init( &grp ); in mbedtls_ecjpake_read_round_two() 603 if( grp.id != ctx->grp.id ) in mbedtls_ecjpake_read_round_two() 621 mbedtls_ecp_group_free( &grp ); in mbedtls_ecjpake_read_round_two() [all …]
|
A D | ecdsa.c | 231 size_t n_size = ( grp->nbits + 7 ) / 8; in derive_mpi() 235 if( use_size * 8 > grp->nbits ) in derive_mpi() 267 if( ! mbedtls_ecdsa_can_do( grp->id ) || grp->N.p == NULL ) in ecdsa_sign_restartable() 326 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, &R, pk, &grp->G, in ecdsa_sign_restartable() 407 ECDSA_VALIDATE_RET( grp != NULL ); in mbedtls_ecdsa_sign() 436 size_t grp_len = ( grp->nbits + 7 ) / 8; in ecdsa_sign_det_restartable() 562 ECDSA_VALIDATE_RET( grp != NULL ); in mbedtls_ecdsa_sign_det() 581 ECDSA_VALIDATE_RET( grp != NULL ); in mbedtls_ecdsa_sign_det_ext() 614 if( ! mbedtls_ecdsa_can_do( grp->id ) || grp->N.p == NULL ) in ecdsa_verify_restartable() 712 ECDSA_VALIDATE_RET( grp != NULL ); in mbedtls_ecdsa_verify() [all …]
|
A D | ecp_curves.c | 623 grp->pbits = mbedtls_mpi_bitlen( &grp->P ); in ecp_group_load() 624 grp->nbits = mbedtls_mpi_bitlen( &grp->N ); in ecp_group_load() 626 grp->h = 1; in ecp_group_load() 711 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &grp->P, &grp->P, 19 ) ); in ecp_use_curve25519() 712 grp->pbits = mbedtls_mpi_bitlen( &grp->P ); in ecp_use_curve25519() 726 grp->nbits = 254; in ecp_use_curve25519() 762 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &grp->P, &grp->P, 1 ) ); in ecp_use_curve448() 764 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &grp->P, &grp->P, 1 ) ); in ecp_use_curve448() 765 grp->pbits = mbedtls_mpi_bitlen( &grp->P ); in ecp_use_curve448() 777 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &grp->N, &grp->N, &Ns ) ); in ecp_use_curve448() [all …]
|
A D | ecdh.c | 51 return( ctx->grp.id ); in mbedtls_ecdh_grp_id() 86 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, Q, d, &grp->G, in ecdh_gen_public_restartable() 100 ECDH_VALIDATE_RET( grp != NULL ); in mbedtls_ecdh_gen_public() 149 ECDH_VALIDATE_RET( grp != NULL ); in mbedtls_ecdh_compute_shared() 160 mbedtls_ecp_group_init( &ctx->grp ); in ecdh_init_internal() 199 ret = mbedtls_ecp_group_load( &ctx->grp, grp_id ); in ecdh_setup_internal() 239 mbedtls_ecp_group_free( &ctx->grp ); in ecdh_free_internal() 311 if( ctx->grp.pbits == 0 ) in ecdh_make_params_internal() 533 if( ctx->grp.pbits == 0 ) in ecdh_make_public_internal() 655 if( ctx == NULL || ctx->grp.pbits == 0 ) in ecdh_calc_secret_internal() [all …]
|
A D | pkparse.c | 290 grp->pbits = mbedtls_mpi_bitlen( &grp->P ); in pk_group_from_specified() 345 if( ( ret = mbedtls_ecp_point_read_binary( grp, &grp->G, in pk_group_from_specified() 357 mbedtls_mpi_lset( &grp->G.Z, 1 ) != 0 ) in pk_group_from_specified() 371 grp->nbits = mbedtls_mpi_bitlen( &grp->N ); in pk_group_from_specified() 399 if( grp->pbits == ref.pbits && grp->nbits == ref.nbits && in pk_group_id_from_group() 432 mbedtls_ecp_group grp; in pk_group_id_from_specified() local 434 mbedtls_ecp_group_init( &grp ); in pk_group_id_from_specified() 439 ret = pk_group_id_from_group( &grp, grp_id ); in pk_group_id_from_specified() 442 mbedtls_ecp_group_free( &grp ); in pk_group_id_from_specified() 479 if( grp->id != MBEDTLS_ECP_DP_NONE && grp->id != grp_id ) in pk_use_ecparams() [all …]
|
/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ |
A D | ecp_internal.h | 79 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 …]
|
A D | ecp.h | 400 int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp, 406 MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, rs_ctx, \ 598 void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); 621 void mbedtls_ecp_group_free( mbedtls_ecp_group *grp ); 804 int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp, 871 int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, 1073 mbedtls_ecp_group *grp, mbedtls_ecp_point *R, 1106 int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp, 1128 int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp, 1146 int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp, [all …]
|
A D | ecdh.h | 86 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,
|
/optee_os/out/arm/export-ta_arm64/include/mbedtls/ |
A D | ecp_internal.h | 79 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 …]
|
A D | ecp.h | 400 int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp, 406 MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, rs_ctx, \ 598 void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); 621 void mbedtls_ecp_group_free( mbedtls_ecp_group *grp ); 804 int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp, 871 int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, 1073 mbedtls_ecp_group *grp, mbedtls_ecp_point *R, 1106 int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp, 1128 int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp, 1146 int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp, [all …]
|
A D | ecdh.h | 86 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,
|
/optee_os/out/arm/export-ta_arm32/host_include/mbedtls/ |
A D | ecp_internal.h | 79 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 …]
|
A D | ecp.h | 400 int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp, 406 MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, rs_ctx, \ 598 void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); 621 void mbedtls_ecp_group_free( mbedtls_ecp_group *grp ); 804 int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp, 871 int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, 1073 mbedtls_ecp_group *grp, mbedtls_ecp_point *R, 1106 int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp, 1128 int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp, 1146 int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp, [all …]
|
A D | ecdh.h | 86 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,
|
/optee_os/out/arm/export-ta_arm32/include/mbedtls/ |
A D | ecp_internal.h | 79 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 …]
|
A D | ecp.h | 400 int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp, 406 MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, rs_ctx, \ 598 void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); 621 void mbedtls_ecp_group_free( mbedtls_ecp_group *grp ); 804 int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp, 871 int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, 1073 mbedtls_ecp_group *grp, mbedtls_ecp_point *R, 1106 int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp, 1128 int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp, 1146 int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp, [all …]
|
A D | ecdh.h | 86 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,
|
/optee_os/out/arm/export-ta_arm64/host_include/mbedtls/ |
A D | ecp_internal.h | 79 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 …]
|
A D | ecp.h | 400 int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp, 406 MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, rs_ctx, \ 598 void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); 621 void mbedtls_ecp_group_free( mbedtls_ecp_group *grp ); 804 int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp, 871 int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, 1073 mbedtls_ecp_group *grp, mbedtls_ecp_point *R, 1106 int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp, 1128 int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp, 1146 int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp, [all …]
|
A D | ecdh.h | 86 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,
|
/optee_os/lib/libmbedtls/core/ |
A D | sm2-dsa.c | 30 mbedtls_ecp_group grp = { }; in sm2_mbedtls_dsa_sign() local 52 mbedtls_ecp_group_init(&grp); in sm2_mbedtls_dsa_sign() 67 res = mbed_gen_random_upto(&k, &grp.N); in sm2_mbedtls_dsa_sign() 75 mres = mbedtls_ecp_mul(&grp, &x1y1p, &k, &grp.G, mbd_rand, in sm2_mbedtls_dsa_sign() 96 !mbedtls_mpi_cmp_mpi(&tmp, &grp.N)); in sm2_mbedtls_dsa_sign() 103 mres = mbedtls_mpi_inv_mod(&s, &s, &grp.N); in sm2_mbedtls_dsa_sign() 142 mbedtls_ecp_group_free(&grp); in sm2_mbedtls_dsa_sign() 155 mbedtls_ecp_group grp = { }; in sm2_mbedtls_dsa_verify() local 177 mbedtls_ecp_group_init(&grp); in sm2_mbedtls_dsa_verify() 237 mres = mbedtls_ecp_muladd(&grp, &x1y1p, &sprime, &grp.G, &t, &PA); in sm2_mbedtls_dsa_verify() [all …]
|
A D | sm2-pke.c | 24 sm2_uncompressed_bytes_to_point(const mbedtls_ecp_group *grp, in sm2_uncompressed_bytes_to_point() argument 48 mres = mbedtls_ecp_check_pubkey(grp, p); in sm2_uncompressed_bytes_to_point() 82 return sm2_uncompressed_bytes_to_point(grp, p, buf + 1, in sm2_bytes_to_point() 119 mbedtls_ecp_group grp = { }; in sm2_mbedtls_pke_decrypt() local 139 mbedtls_ecp_group_init(&grp); in sm2_mbedtls_pke_decrypt() 263 mbedtls_ecp_group_free(&grp); in sm2_mbedtls_pke_decrypt() 307 mbedtls_ecp_group grp = { }; in sm2_mbedtls_pke_encrypt() local 325 mbedtls_ecp_group_init(&grp); in sm2_mbedtls_pke_encrypt() 334 res = mbed_gen_random_upto(&k, &grp.N); in sm2_mbedtls_pke_encrypt() 340 mres = mbedtls_ecp_mul(&grp, &C1, &k, &grp.G, mbd_rand, NULL); in sm2_mbedtls_pke_encrypt() [all …]
|
A D | sm2-kep.c | 65 mres = mbedtls_mpi_write_binary(&grp->A, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z() 74 mres = mbedtls_mpi_write_binary(&grp->B, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z() 292 mbedtls_ecp_group grp = { }; in crypto_acipher_sm2_kep_derive() local 327 mbedtls_ecp_group_init(&grp); in crypto_acipher_sm2_kep_derive() 328 mres = mbedtls_ecp_group_load(&grp, MBEDTLS_ECP_DP_SM2); in crypto_acipher_sm2_kep_derive() 353 mres = mbedtls_mpi_mod_mpi(&tA, &tA, &grp.N); in crypto_acipher_sm2_kep_derive() 359 mres = mbedtls_mpi_mod_mpi(&tA, &tA, &grp.N); in crypto_acipher_sm2_kep_derive() 368 mres = mbedtls_ecp_check_pubkey(&grp, &RB); in crypto_acipher_sm2_kep_derive() 399 mres = mbedtls_ecp_muladd(&grp, &U, &one, &PB, &x2bar, &RB); in crypto_acipher_sm2_kep_derive() 404 mres = mbedtls_ecp_mul(&grp, &U, &tA, &U, mbd_rand, NULL); in crypto_acipher_sm2_kep_derive() [all …]
|
A D | ecc.c | 106 static void ecc_clear_precomputed(mbedtls_ecp_group *grp) in ecc_clear_precomputed() argument 110 if (grp->T) { in ecc_clear_precomputed() 111 for (i = 0; i < grp->T_size; i++) in ecc_clear_precomputed() 112 mbedtls_ecp_point_free(&grp->T[i]); in ecc_clear_precomputed() 113 free(grp->T); in ecc_clear_precomputed() 115 grp->T = NULL; in ecc_clear_precomputed() 116 grp->T_size = 0; in ecc_clear_precomputed() 145 ecc_clear_precomputed(&ecdsa.grp); in ecc_generate_keypair() 198 lmd_res = mbedtls_ecp_group_load(&ecdsa.grp, key->curve); in ecc_sign() 217 lmd_res = mbedtls_ecdsa_sign(&ecdsa.grp, &r, &s, &ecdsa.d, msg, in ecc_sign() [all …]
|