Lines Matching refs:P
22 if (mbedtls_mpi_cmp_mpi(&grp1->P, &grp2->P) != 0) {
82 mbedtls_ecp_point P;
88 mbedtls_ecp_point_init(&P);
91 mbedtls_ecp_point_write_binary(&grp, &P,
96 mbedtls_ecp_tls_write_point(&grp, &P,
133 mbedtls_ecp_point P;
136 mbedtls_ecp_point_init(&P);
140 TEST_ASSERT(mbedtls_test_read_mpi(&P.X, x_hex) == 0);
141 TEST_ASSERT(mbedtls_test_read_mpi(&P.Y, y_hex) == 0);
142 TEST_ASSERT(mbedtls_test_read_mpi(&P.Z, z_hex) == 0);
144 TEST_ASSERT(mbedtls_ecp_check_pubkey(&grp, &P) == ret);
148 mbedtls_ecp_point_free(&P);
169 * For reference, with Mbed TLS 2.4 and default settings, for P-256:
178 mbedtls_ecp_point R, P;
186 mbedtls_ecp_point_init(&R); mbedtls_ecp_point_init(&P);
219 mbedtls_ecp_copy(&P, &R);
223 ret = mbedtls_ecp_mul_restartable(&grp, &R, &dB, &P,
237 ret = mbedtls_ecp_mul_restartable(&grp, &R, &dB, &P,
245 mbedtls_ecp_point_free(&R); mbedtls_ecp_point_free(&P);
439 mbedtls_ecp_point P, nP, R;
444 mbedtls_ecp_point_init(&P); mbedtls_ecp_point_init(&nP);
454 TEST_ASSERT(mbedtls_mpi_read_binary(&P.X, Px_hex->x, Px_hex->len) == 0);
455 TEST_ASSERT(mbedtls_mpi_read_binary(&P.Y, Py_hex->x, Py_hex->len) == 0);
456 TEST_ASSERT(mbedtls_mpi_read_binary(&P.Z, Pz_hex->x, Pz_hex->len) == 0);
464 TEST_ASSERT(mbedtls_ecp_mul(&grp, &R, &n, &P,
476 mbedtls_ecp_point_free(&P); mbedtls_ecp_point_free(&nP);
570 TEST_ASSERT(mbedtls_mpi_mod_mpi(&R, &N, &grp.P) == 0);
578 TEST_ASSERT(mbedtls_mpi_mod_mpi(&N, &N, &grp.P) == 0);
592 mbedtls_ecp_point P;
599 mbedtls_ecp_group_init(&grp); mbedtls_ecp_point_init(&P);
604 TEST_EQUAL(mbedtls_test_read_mpi(&P.X, x), 0);
605 TEST_EQUAL(mbedtls_test_read_mpi(&P.Y, y), 0);
606 TEST_EQUAL(mbedtls_test_read_mpi(&P.Z, z), 0);
608 TEST_EQUAL(mbedtls_ecp_point_write_binary(&grp, &P, format,
617 TEST_EQUAL(mbedtls_ecp_set_public_key(grp.id, &key, &P), 0);
626 mbedtls_ecp_group_free(&grp); mbedtls_ecp_point_free(&P);
636 mbedtls_ecp_point P;
640 mbedtls_ecp_group_init(&grp); mbedtls_ecp_point_init(&P);
649 TEST_ASSERT(mbedtls_ecp_point_read_binary(&grp, &P, buf->x, buf->len) == ret);
652 TEST_ASSERT(mbedtls_mpi_cmp_mpi(&P.X, &X) == 0);
655 TEST_ASSERT(P.Y.p == NULL);
657 TEST_ASSERT(mbedtls_mpi_cmp_int(&P.Z, 1) == 0);
659 TEST_ASSERT(mbedtls_mpi_cmp_mpi(&P.Y, &Y) == 0);
660 TEST_ASSERT(mbedtls_mpi_cmp_mpi(&P.Z, &Z) == 0);
668 mbedtls_mpi_free(&P.Y);
670 TEST_ASSERT(mbedtls_ecp_point_read_binary(&grp, &P, buf->x, buf->len/2+1) == 0);
671 TEST_ASSERT(mbedtls_mpi_cmp_mpi(&P.Y, &Y) == 0);
677 mbedtls_ecp_group_free(&grp); mbedtls_ecp_point_free(&P);
687 mbedtls_ecp_point P;
692 mbedtls_ecp_group_init(&grp); mbedtls_ecp_point_init(&P);
701 TEST_ASSERT(mbedtls_ecp_tls_read_point(&grp, &P, &vbuf, buf->len) == ret);
704 TEST_ASSERT(mbedtls_mpi_cmp_mpi(&P.X, &X) == 0);
705 TEST_ASSERT(mbedtls_mpi_cmp_mpi(&P.Y, &Y) == 0);
706 TEST_ASSERT(mbedtls_mpi_cmp_mpi(&P.Z, &Z) == 0);
711 mbedtls_ecp_group_free(&grp); mbedtls_ecp_point_free(&P);
784 TEST_ASSERT(mbedtls_mpi_bitlen(&grp.P) == (size_t) bits);
825 char *P, char *A, char *B,
852 TEST_EQUAL(mbedtls_test_read_mpi(&exp_P, P), 0);
871 TEST_EQUAL(mbedtls_mpi_cmp_mpi(&exp_P, &grp.P), 0);