Implement deterministic DSA as specified by rfc-6979.
authorWerner Koch <wk@gnupg.org>
Fri, 26 Jul 2013 18:15:53 +0000 (20:15 +0200)
committerWerner Koch <wk@gnupg.org>
Fri, 26 Jul 2013 18:15:53 +0000 (20:15 +0200)
commit1cfa79aabc5d0fd8d124901054475e90ab7d9cde
tree9a8b1dbaced1e915ba782ad3b290f15ac2e6045b
parentb72d312ad11887fc416aa821786f6bdb663c0f4a
Implement deterministic DSA as specified by rfc-6979.

* cipher/dsa.c (dsa_sign): Move opaque mpi extraction to sign.
(sign): Add args FLAGS and HASHALGO.  Implement deterministic DSA.
Add code path for R==0 to comply with the standard.
(dsa_verify): Left fill opaque mpi based hash values.
* cipher/dsa-common.c (int2octets, bits2octets): New.
(_gcry_dsa_gen_rfc6979_k): New.
* tests/dsa-rfc6979.c: New.
* tests/Makefile.am (TESTS): Add dsa-rfc6979.
--

This patch also fixes a recent patch (37d0a1e) which allows to pass
the hash in a (hash) element.

Support for deterministic ECDSA will come soon.

Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/dsa-common.c
cipher/dsa.c
cipher/pubkey-internal.h
tests/Makefile.am
tests/dsa-rfc6979.c [new file with mode: 0644]