Truncate hash values for ECDSA signature scheme

Authored by lumag on Dec 30 2013, 9:38 PM.

Description

Truncate hash values for ECDSA signature scheme

* cipher/dsa-common (_gcry_dsa_normalize_hash): New. Truncate opaque
  mpis as required for DSA and ECDSA signature schemas.
* cipher/dsa.c (verify): Return gpg_err_code_t value from verify() to
  behave like the rest of internal sign/verify functions.
* cipher/dsa.c (sign, verify, dsa_verify): Factor out hash truncation.
* cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Factor out hash truncation.
* cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_verify):
  as required by ECDSA scheme, truncate hash values to bitlength of
  used curve.
* tests/pubkey.c (check_ecc_sample_key): add a testcase for hash
  truncation.

(cherry picked from commit 9edcf1090e0485f9f383b6c54b18ea8ca3d4a225)

  • Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

Details

Committed
wernerJan 24 2014, 10:45 AM
Parents
rCfa42c61a8499: Support locking under Windows.
Branches
Unknown
Tags
Unknown
Werner Koch <wk@gnupg.org> committed rCf6bd8edf764e: Truncate hash values for ECDSA signature scheme (authored by Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>).Jan 24 2014, 10:45 AM
werner mentioned this in Unknown Object (Maniphest Task).Mar 27 2017, 5:05 PM
werner mentioned this in Unknown Object (Maniphest Task).Mar 27 2017, 5:28 PM