summaryrefslogtreecommitdiff
path: root/cipher/pubkey-internal.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2013-05-24 15:52:37 +0200
committerWerner Koch <wk@gnupg.org>2013-05-24 15:52:37 +0200
commit9711384f75564a71979e3fb971b5f4cadcf1afef (patch)
treeed2caca86567d96e608e510ff715017e7430d789 /cipher/pubkey-internal.h
parent0bdf26eea8cdbffefe7e37578f8f896c4f5f5275 (diff)
downloadlibgcrypt-9711384f75564a71979e3fb971b5f4cadcf1afef.tar.gz
ecc: Fix a minor flaw in the generation of K.
* cipher/dsa.c (gen_k): Factor code out to .. * cipher/dsa-common.c (_gcry_dsa_gen_k): new file and function. Add arg security_level and re-indent a bit. * cipher/ecc.c (gen_k): Remove and change callers to _gcry_dsa_gen_k. * cipher/dsa.c: Include pubkey-internal. * cipher/Makefile.am (libcipher_la_SOURCES): Add dsa-common.c -- The ECDSA code used the simple $k = k \bmod p$ method which introduces a small bias. We now use the bias free method we have always used with DSA. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'cipher/pubkey-internal.h')
-rw-r--r--cipher/pubkey-internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cipher/pubkey-internal.h b/cipher/pubkey-internal.h
index 0ca17a50..ae7e77b0 100644
--- a/cipher/pubkey-internal.h
+++ b/cipher/pubkey-internal.h
@@ -20,6 +20,9 @@
#ifndef GCRY_PUBKEY_INTERNAL_H
#define GCRY_PUBKEY_INTERNAL_H
+/*-- dsa-common.h --*/
+gcry_mpi_t _gcry_dsa_gen_k (gcry_mpi_t q, int security_level);
+
/*-- ecc.c --*/
gpg_err_code_t _gcry_pk_ecc_get_sexp (gcry_sexp_t *r_sexp, int mode,