[PATCH v3] Truncate hash values for ECDSA signature scheme

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Fri Jan 10 15:55:01 CET 2014


On Tue, Dec 31, 2013 at 12:38 AM, Dmitry Eremin-Solenikov
<dbaryshkov at gmail.com> wrote:
> * 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.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
> ---
>
> * Change in V3 - fix testcases to use (hash sha1 ... ) S-exp instead of
> (value ...) - otherwise it will not be converted to an opaque MPI.
>
>  cipher/dsa-common.c      | 33 ++++++++++++++++++++
>  cipher/dsa.c             | 81 ++++++++++++++++++++----------------------------
>  cipher/ecc-ecdsa.c       | 28 ++++++++---------
>  cipher/pubkey-internal.h |  3 ++
>  tests/pubkey.c           | 47 +++++++++++++++++++++++++++-
>  5 files changed, 129 insertions(+), 63 deletions(-)

Ping?

-- 
With best wishes
Dmitry



More information about the Gcrypt-devel mailing list