Lines Matching refs:MBEDTLS_MPI_CHK
56 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( x, buf, use_size ) ); in derive_mpi()
58 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( x, use_size * 8 - grp->nbits ) ); in derive_mpi()
62 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( x, x, &grp->N ) ); in derive_mpi()
97 MBEDTLS_MPI_CHK( mbedtls_ecp_gen_keypair( grp, &k, &R, f_rng, p_rng ) ); in mbedtls_ecdsa_sign()
98 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( r, &R.X, &grp->N ) ); in mbedtls_ecdsa_sign()
111 MBEDTLS_MPI_CHK( derive_mpi( grp, &e, buf, blen ) ); in mbedtls_ecdsa_sign()
121 MBEDTLS_MPI_CHK( mbedtls_mpi_fill_random( &t, n_size, f_rng, p_rng ) ); in mbedtls_ecdsa_sign()
122 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( &t, 8 * n_size - grp->nbits ) ); in mbedtls_ecdsa_sign()
134 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( s, r, d ) ); in mbedtls_ecdsa_sign()
135 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &e, &e, s ) ); in mbedtls_ecdsa_sign()
136 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &e, &e, &t ) ); in mbedtls_ecdsa_sign()
137 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &k, &k, &t ) ); in mbedtls_ecdsa_sign()
138 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( s, &k, &grp->N ) ); in mbedtls_ecdsa_sign()
139 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( s, s, &e ) ); in mbedtls_ecdsa_sign()
140 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( s, s, &grp->N ) ); in mbedtls_ecdsa_sign()
179 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( d, data, grp_len ) ); in mbedtls_ecdsa_sign_det()
180 MBEDTLS_MPI_CHK( derive_mpi( grp, &h, buf, blen ) ); in mbedtls_ecdsa_sign_det()
181 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &h, data + grp_len, grp_len ) ); in mbedtls_ecdsa_sign_det()
227 MBEDTLS_MPI_CHK( mbedtls_ecp_check_pubkey( grp, Q ) ); in mbedtls_ecdsa_verify()
232 MBEDTLS_MPI_CHK( derive_mpi( grp, &e, buf, blen ) ); in mbedtls_ecdsa_verify()
237 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( &s_inv, s, &grp->N ) ); in mbedtls_ecdsa_verify()
239 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &u1, &e, &s_inv ) ); in mbedtls_ecdsa_verify()
240 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &u1, &u1, &grp->N ) ); in mbedtls_ecdsa_verify()
242 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &u2, r, &s_inv ) ); in mbedtls_ecdsa_verify()
243 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &u2, &u2, &grp->N ) ); in mbedtls_ecdsa_verify()
251 MBEDTLS_MPI_CHK( mbedtls_ecp_muladd( grp, &R, &u1, &grp->G, &u2, Q ) ); in mbedtls_ecdsa_verify()
263 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &R.X, &R.X, &grp->N ) ); in mbedtls_ecdsa_verify()
324 MBEDTLS_MPI_CHK( mbedtls_ecdsa_sign_det( &ctx->grp, &r, &s, &ctx->d, in mbedtls_ecdsa_write_signature()
329 MBEDTLS_MPI_CHK( mbedtls_ecdsa_sign( &ctx->grp, &r, &s, &ctx->d, in mbedtls_ecdsa_write_signature()
333 MBEDTLS_MPI_CHK( ecdsa_signature_to_asn1( &r, &s, sig, slen ) ); in mbedtls_ecdsa_write_signature()