"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cipher/ecc-ecdsa.c" between
libgcrypt-1.9.1.tar.bz2 and libgcrypt-1.9.2.tar.bz2

About: Libgcrypt is a general purpose library of cryptographic building blocks (originally based on GnuPG code).

ecc-ecdsa.c  (libgcrypt-1.9.1.tar.bz2):ecc-ecdsa.c  (libgcrypt-1.9.2.tar.bz2)
skipping to change at line 173 skipping to change at line 173
*/ */
gpg_err_code_t gpg_err_code_t
_gcry_ecc_ecdsa_verify (gcry_mpi_t input, mpi_ec_t ec, _gcry_ecc_ecdsa_verify (gcry_mpi_t input, mpi_ec_t ec,
gcry_mpi_t r, gcry_mpi_t s) gcry_mpi_t r, gcry_mpi_t s)
{ {
gpg_err_code_t err = 0; gpg_err_code_t err = 0;
gcry_mpi_t hash, h, h1, h2, x; gcry_mpi_t hash, h, h1, h2, x;
mpi_point_struct Q, Q1, Q2; mpi_point_struct Q, Q1, Q2;
unsigned int nbits; unsigned int nbits;
if (!_gcry_mpi_ec_curve_point (ec->Q, ec))
return GPG_ERR_BROKEN_PUBKEY;
if( !(mpi_cmp_ui (r, 0) > 0 && mpi_cmp (r, ec->n) < 0) ) if( !(mpi_cmp_ui (r, 0) > 0 && mpi_cmp (r, ec->n) < 0) )
return GPG_ERR_BAD_SIGNATURE; /* Assertion 0 < r < n failed. */ return GPG_ERR_BAD_SIGNATURE; /* Assertion 0 < r < n failed. */
if( !(mpi_cmp_ui (s, 0) > 0 && mpi_cmp (s, ec->n) < 0) ) if( !(mpi_cmp_ui (s, 0) > 0 && mpi_cmp (s, ec->n) < 0) )
return GPG_ERR_BAD_SIGNATURE; /* Assertion 0 < s < n failed. */ return GPG_ERR_BAD_SIGNATURE; /* Assertion 0 < s < n failed. */
nbits = mpi_get_nbits (ec->n); nbits = mpi_get_nbits (ec->n);
err = _gcry_dsa_normalize_hash (input, &hash, nbits); err = _gcry_dsa_normalize_hash (input, &hash, nbits);
if (err) if (err)
return err; return err;
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)