Lines Matching refs:grp
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()
64 static TEE_Result sm2_bytes_to_point(const mbedtls_ecp_group *grp, in sm2_bytes_to_point() argument
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()
140 mres = mbedtls_ecp_group_load(&grp, MBEDTLS_ECP_DP_SM2); in sm2_mbedtls_pke_decrypt()
148 res = sm2_bytes_to_point(&grp, &C1, src, src_len, &C1_len); in sm2_mbedtls_pke_decrypt()
160 mres = mbedtls_ecp_mul(&grp, &x2y2p, (mbedtls_mpi *)key->d, &C1, 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()
326 mres = mbedtls_ecp_group_load(&grp, MBEDTLS_ECP_DP_SM2); 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()
357 mres = mbedtls_ecp_mul(&grp, &x2y2p, &k, &PB, mbd_rand, NULL); in sm2_mbedtls_pke_encrypt()
449 mbedtls_ecp_group_free(&grp); in sm2_mbedtls_pke_encrypt()