Lines Matching refs:r
72 int mbedtls_ecdsa_sign( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, in mbedtls_ecdsa_sign() argument
98 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( r, &R.X, &grp->N ) ); in mbedtls_ecdsa_sign()
106 while( mbedtls_mpi_cmp_int( r, 0 ) == 0 ); in mbedtls_ecdsa_sign()
134 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( s, r, d ) ); in mbedtls_ecdsa_sign()
161 int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, in mbedtls_ecdsa_sign_det() argument
184 ret = mbedtls_ecdsa_sign( grp, r, s, d, buf, blen, in mbedtls_ecdsa_sign_det()
201 const mbedtls_ecp_point *Q, const mbedtls_mpi *r, const mbedtls_mpi *s) in mbedtls_ecdsa_verify() argument
217 if( mbedtls_mpi_cmp_int( r, 1 ) < 0 || mbedtls_mpi_cmp_mpi( r, &grp->N ) >= 0 || in mbedtls_ecdsa_verify()
242 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &u2, r, &s_inv ) ); in mbedtls_ecdsa_verify()
268 if( mbedtls_mpi_cmp_mpi( &R.X, r ) != 0 ) in mbedtls_ecdsa_verify()
284 static int ecdsa_signature_to_asn1( const mbedtls_mpi *r, const mbedtls_mpi *s, in ecdsa_signature_to_asn1() argument
293 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &p, buf, r ) ); in ecdsa_signature_to_asn1()
315 mbedtls_mpi r, s; in mbedtls_ecdsa_write_signature() local
317 mbedtls_mpi_init( &r ); in mbedtls_ecdsa_write_signature()
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()
336 mbedtls_mpi_free( &r ); in mbedtls_ecdsa_write_signature()
365 mbedtls_mpi r, s; in mbedtls_ecdsa_read_signature() local
367 mbedtls_mpi_init( &r ); in mbedtls_ecdsa_read_signature()
384 if( ( ret = mbedtls_asn1_get_mpi( &p, end, &r ) ) != 0 || in mbedtls_ecdsa_read_signature()
392 &ctx->Q, &r, &s ) ) != 0 ) in mbedtls_ecdsa_read_signature()
399 mbedtls_mpi_free( &r ); in mbedtls_ecdsa_read_signature()