"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cipher/ecc-sm2.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-sm2.c  (libgcrypt-1.9.1.tar.bz2):ecc-sm2.c  (libgcrypt-1.9.2.tar.bz2)
skipping to change at line 498 skipping to change at line 498
_gcry_ecc_sm2_verify (gcry_mpi_t input, mpi_ec_t ec, _gcry_ecc_sm2_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 = NULL; gcry_mpi_t hash = NULL;
gcry_mpi_t t = NULL; gcry_mpi_t t = NULL;
mpi_point_struct sG, tP; mpi_point_struct sG, tP;
gcry_mpi_t x1, y1; gcry_mpi_t x1, y1;
unsigned int nbits; unsigned int nbits;
if (!_gcry_mpi_ec_curve_point (ec->Q, ec))
return GPG_ERR_BROKEN_PUBKEY;
/* r, s within [1, n-1] */ /* r, s within [1, n-1] */
if (mpi_cmp_ui (r, 1) < 0 || mpi_cmp (r, ec->n) > 0) if (mpi_cmp_ui (r, 1) < 0 || mpi_cmp (r, ec->n) > 0)
return GPG_ERR_BAD_SIGNATURE; return GPG_ERR_BAD_SIGNATURE;
if (mpi_cmp_ui (s, 1) < 0 || mpi_cmp (s, ec->n) > 0) if (mpi_cmp_ui (s, 1) < 0 || mpi_cmp (s, ec->n) > 0)
return GPG_ERR_BAD_SIGNATURE; return GPG_ERR_BAD_SIGNATURE;
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)