Lines Matching refs:mres
29 int mres = 0; in sm2_uncompressed_bytes_to_point() local
34 mres = mbedtls_mpi_read_binary(&p->X, ptr, SM2_INT_SIZE_BYTES); in sm2_uncompressed_bytes_to_point()
35 if (mres) in sm2_uncompressed_bytes_to_point()
40 mres = mbedtls_mpi_read_binary(&p->Y, ptr, SM2_INT_SIZE_BYTES); in sm2_uncompressed_bytes_to_point()
41 if (mres) in sm2_uncompressed_bytes_to_point()
44 mres = mbedtls_mpi_lset(&p->Z, 1); in sm2_uncompressed_bytes_to_point()
45 if (mres) in sm2_uncompressed_bytes_to_point()
48 mres = mbedtls_ecp_check_pubkey(grp, p); in sm2_uncompressed_bytes_to_point()
49 if (mres) in sm2_uncompressed_bytes_to_point()
121 int mres = 0; in sm2_mbedtls_pke_decrypt() local
140 mres = mbedtls_ecp_group_load(&grp, MBEDTLS_ECP_DP_SM2); in sm2_mbedtls_pke_decrypt()
141 if (mres) { in sm2_mbedtls_pke_decrypt()
160 mres = mbedtls_ecp_mul(&grp, &x2y2p, (mbedtls_mpi *)key->d, &C1, in sm2_mbedtls_pke_decrypt()
162 if (mres) { in sm2_mbedtls_pke_decrypt()
173 mres = mbedtls_mpi_write_binary(&x2y2p.X, x2y2, SM2_INT_SIZE_BYTES); in sm2_mbedtls_pke_decrypt()
174 if (mres) { in sm2_mbedtls_pke_decrypt()
178 mres = mbedtls_mpi_write_binary(&x2y2p.Y, x2y2 + SM2_INT_SIZE_BYTES, in sm2_mbedtls_pke_decrypt()
180 if (mres) { in sm2_mbedtls_pke_decrypt()
277 int mres = 0; in sm2_point_to_bytes() local
285 mres = mbedtls_mpi_write_binary(&p->X, buf + 1, SM2_INT_SIZE_BYTES); in sm2_point_to_bytes()
286 if (mres) in sm2_point_to_bytes()
288 mres = mbedtls_mpi_write_binary(&p->Y, buf + 1 + SM2_INT_SIZE_BYTES, in sm2_point_to_bytes()
290 if (mres) in sm2_point_to_bytes()
313 int mres = 0; in sm2_mbedtls_pke_encrypt() local
326 mres = mbedtls_ecp_group_load(&grp, MBEDTLS_ECP_DP_SM2); in sm2_mbedtls_pke_encrypt()
327 if (mres) { in sm2_mbedtls_pke_encrypt()
340 mres = mbedtls_ecp_mul(&grp, &C1, &k, &grp.G, mbd_rand, NULL); in sm2_mbedtls_pke_encrypt()
341 if (mres) { in sm2_mbedtls_pke_encrypt()
357 mres = mbedtls_ecp_mul(&grp, &x2y2p, &k, &PB, mbd_rand, NULL); in sm2_mbedtls_pke_encrypt()
358 if (mres) { in sm2_mbedtls_pke_encrypt()
369 mres = mbedtls_mpi_write_binary(&x2y2p.X, x2y2, SM2_INT_SIZE_BYTES); in sm2_mbedtls_pke_encrypt()
370 if (mres) { in sm2_mbedtls_pke_encrypt()
374 mres = mbedtls_mpi_write_binary(&x2y2p.Y, x2y2 + SM2_INT_SIZE_BYTES, in sm2_mbedtls_pke_encrypt()
376 if (mres) { in sm2_mbedtls_pke_encrypt()