Lines Matching refs:MBEDTLS_MPI_CHK
114 MBEDTLS_MPI_CHK(mbedtls_ecp_group_load(&ctx->grp, curve)); in mbedtls_ecjpake_setup()
116 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&ctx->s, secret, len)); in mbedtls_ecjpake_setup()
209 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, G)); in ecjpake_hash()
210 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, V)); in ecjpake_hash()
211 MBEDTLS_MPI_CHK(ecjpake_write_len_point(&p, end, grp, pf, X)); in ecjpake_hash()
228 MBEDTLS_MPI_CHK(mbedtls_ecjpake_compute_hash(md_type, in ecjpake_hash()
232 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(h, hash, in ecjpake_hash()
234 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(h, h, &grp->N)); in ecjpake_hash()
272 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_point(grp, &V, p, (size_t) (end - *p))); in ecjpake_zkp_read()
286 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&r, *p, r_len)); in ecjpake_zkp_read()
292 MBEDTLS_MPI_CHK(ecjpake_hash(md_type, grp, pf, G, &V, X, id, &h)); in ecjpake_zkp_read()
293 MBEDTLS_MPI_CHK(mbedtls_ecp_muladd((mbedtls_ecp_group *) grp, in ecjpake_zkp_read()
340 MBEDTLS_MPI_CHK(mbedtls_ecp_gen_keypair_base((mbedtls_ecp_group *) grp, in ecjpake_zkp_write()
342 MBEDTLS_MPI_CHK(ecjpake_hash(md_type, grp, pf, G, &V, X, id, &h)); in ecjpake_zkp_write()
343 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&h, &h, x)); /* x*h */ in ecjpake_zkp_write()
344 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_mpi(&h, &v, &h)); /* v - x*h */ in ecjpake_zkp_write()
345 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(&h, &h, &grp->N)); /* r */ in ecjpake_zkp_write()
348 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_write_point(grp, &V, in ecjpake_zkp_write()
359 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&h, *p, len)); /* r */ in ecjpake_zkp_write()
395 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_point(grp, X, p, (size_t) (end - *p))); in ecjpake_kkp_read()
401 MBEDTLS_MPI_CHK(ecjpake_zkp_read(md_type, grp, pf, G, X, id, p, end)); in ecjpake_kkp_read()
431 MBEDTLS_MPI_CHK(mbedtls_ecp_gen_keypair_base((mbedtls_ecp_group *) grp, G, x, X, in ecjpake_kkp_write()
433 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_write_point(grp, X, in ecjpake_kkp_write()
438 MBEDTLS_MPI_CHK(ecjpake_zkp_write(md_type, grp, pf, G, x, X, id, in ecjpake_kkp_write()
468 MBEDTLS_MPI_CHK(ecjpake_kkp_read(md_type, grp, pf, G, Xa, id, &p, end)); in ecjpake_kkpp_read()
469 MBEDTLS_MPI_CHK(ecjpake_kkp_read(md_type, grp, pf, G, Xb, id, &p, end)); in ecjpake_kkpp_read()
502 MBEDTLS_MPI_CHK(ecjpake_kkp_write(md_type, grp, pf, G, xm1, Xa, id, in ecjpake_kkpp_write()
504 MBEDTLS_MPI_CHK(ecjpake_kkp_write(md_type, grp, pf, G, xm2, Xb, id, in ecjpake_kkpp_write()
553 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&one, 1)); in ecjpake_ecp_add3()
554 MBEDTLS_MPI_CHK(mbedtls_ecp_muladd(grp, R, &one, A, &one, B)); in ecjpake_ecp_add3()
555 MBEDTLS_MPI_CHK(mbedtls_ecp_muladd(grp, R, &one, R, &one, C)); in ecjpake_ecp_add3()
585 MBEDTLS_MPI_CHK(ecjpake_ecp_add3(&ctx->grp, &G, in mbedtls_ecjpake_read_round_two()
595 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_read_group(&grp, &p, len)); in mbedtls_ecjpake_read_round_two()
602 MBEDTLS_MPI_CHK(ecjpake_kkp_read(ctx->md_type, &ctx->grp, in mbedtls_ecjpake_read_round_two()
634 MBEDTLS_MPI_CHK(mbedtls_mpi_fill_random(&b, 16, f_rng, p_rng)); in ecjpake_mul_secret()
635 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&b, &b, N)); in ecjpake_mul_secret()
636 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&b, &b, S)); in ecjpake_mul_secret()
639 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(R, X, &b)); in ecjpake_mul_secret()
641 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(R, R, N)); in ecjpake_mul_secret()
676 MBEDTLS_MPI_CHK(ecjpake_ecp_add3(&ctx->grp, &G, in mbedtls_ecjpake_write_round_two()
678 MBEDTLS_MPI_CHK(ecjpake_mul_secret(&xm, 1, &ctx->xm2, &ctx->s, in mbedtls_ecjpake_write_round_two()
680 MBEDTLS_MPI_CHK(mbedtls_ecp_mul(&ctx->grp, &Xm, &xm, &G, f_rng, p_rng)); in mbedtls_ecjpake_write_round_two()
695 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_write_group(&ctx->grp, &ec_len, in mbedtls_ecjpake_write_round_two()
704 MBEDTLS_MPI_CHK(mbedtls_ecp_tls_write_point(&ctx->grp, &Xm, in mbedtls_ecjpake_write_round_two()
708 MBEDTLS_MPI_CHK(ecjpake_zkp_write(ctx->md_type, &ctx->grp, in mbedtls_ecjpake_write_round_two()
737 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&one, 1)); in mbedtls_ecjpake_derive_k()
744 MBEDTLS_MPI_CHK(ecjpake_mul_secret(&m_xm2_s, -1, &ctx->xm2, &ctx->s, in mbedtls_ecjpake_derive_k()
746 MBEDTLS_MPI_CHK(mbedtls_ecp_muladd(&ctx->grp, K, in mbedtls_ecjpake_derive_k()
749 MBEDTLS_MPI_CHK(mbedtls_ecp_mul(&ctx->grp, K, &ctx->xm2, K, in mbedtls_ecjpake_derive_k()
783 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&K.X, kx, x_bytes)); in mbedtls_ecjpake_derive_secret()
784 MBEDTLS_MPI_CHK(mbedtls_ecjpake_compute_hash(ctx->md_type, in mbedtls_ecjpake_derive_secret()
1008 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&ctx->xm1, xm1, len1)); in ecjpake_test_load()
1009 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&ctx->xm2, xm2, len2)); in ecjpake_test_load()
1010 MBEDTLS_MPI_CHK(mbedtls_ecp_mul(&ctx->grp, &ctx->Xm1, &ctx->xm1, in ecjpake_test_load()
1012 MBEDTLS_MPI_CHK(mbedtls_ecp_mul(&ctx->grp, &ctx->Xm2, &ctx->xm2, in ecjpake_test_load()
1130 MBEDTLS_MPI_CHK(ecjpake_test_load(&cli, in mbedtls_ecjpake_self_test()
1134 MBEDTLS_MPI_CHK(ecjpake_test_load(&srv, in mbedtls_ecjpake_self_test()