summaryrefslogtreecommitdiff
path: root/tests/keygen.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2013-11-05 19:00:09 +0100
committerWerner Koch <wk@gnupg.org>2013-11-05 19:00:09 +0100
commitb9fd3988b54b50109f4e7179e7fe0739bb1d97c5 (patch)
tree879510f3cfce1a862506cb34edbacdb05d7ca6bd /tests/keygen.c
parentf09ffe8a4802af65a116e79eceeb1cb4ed4fa2f4 (diff)
downloadlibgcrypt-b9fd3988b54b50109f4e7179e7fe0739bb1d97c5.tar.gz
ecc: Require "eddsa" flag for curve Ed25519.
* src/cipher.h (PUBKEY_FLAG_ECDSA): Remove. * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Remove "ecdsa". * cipher/ecc.c (ecc_generate, ecc_sign, ecc_verify): Require "eddsa" flag. * cipher/ecc-misc.c (_gcry_ecc_compute_public): Depend "eddsa" flag. * tests/benchmark.c, tests/keygen.c, tests/pubkey.c * tests/t-ed25519.c, tests/t-mpi-point.c: Adjust for changed flags. -- This changes make using ECDSA signatures the default for all curves. If another signing algorithm is to be used, the corresponding flag needs to be given. In particular the flags "eddsa" is now always required with curve Ed25519 to comply with the specs. This change makes the code better readable by not assuming a certain signature algorithm depending on the curve. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'tests/keygen.c')
-rw-r--r--tests/keygen.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/keygen.c b/tests/keygen.c
index 18fe2117..58793930 100644
--- a/tests/keygen.c
+++ b/tests/keygen.c
@@ -374,9 +374,14 @@ check_ecc_keys (void)
{
if (verbose)
show ("creating ECC key using curve %s\n", curves[testno]);
- rc = gcry_sexp_build (&keyparm, NULL,
- "(genkey(ecc(curve %s)(flags noparam)))",
- curves[testno]);
+ if (!strcmp (curves[testno], "Ed25519"))
+ rc = gcry_sexp_build (&keyparm, NULL,
+ "(genkey(ecc(curve %s)(flags noparam eddsa)))",
+ curves[testno]);
+ else
+ rc = gcry_sexp_build (&keyparm, NULL,
+ "(genkey(ecc(curve %s)(flags noparam)))",
+ curves[testno]);
if (rc)
die ("error creating S-expression: %s\n", gpg_strerror (rc));
rc = gcry_pk_genkey (&key, keyparm);
@@ -398,8 +403,7 @@ check_ecc_keys (void)
if (verbose)
show ("creating ECC key using curve Ed25519 for ECDSA\n");
- rc = gcry_sexp_build (&keyparm, NULL,
- "(genkey(ecc(curve Ed25519)(flags ecdsa)))");
+ rc = gcry_sexp_build (&keyparm, NULL, "(genkey(ecc(curve Ed25519)))");
if (rc)
die ("error creating S-expression: %s\n", gpg_strerror (rc));
rc = gcry_pk_genkey (&key, keyparm);
@@ -414,7 +418,7 @@ check_ecc_keys (void)
if (verbose)
show ("creating ECC key using curve Ed25519 for ECDSA\n");
rc = gcry_sexp_build (&keyparm, NULL,
- "(genkey(ecc(curve Ed25519)(flags noparam ecdsa)))");
+ "(genkey(ecc(curve Ed25519)(flags noparam)))");
if (rc)
die ("error creating S-expression: %s\n", gpg_strerror (rc));
rc = gcry_pk_genkey (&key, keyparm);