summaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-06-30 07:20:31 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2020-06-30 07:20:31 +0200
commit45398518fb76e2b859d2d48cf4cdbc11fbbda4fa (patch)
treefe11bc08c3736e84c82d4377637c293c1925d75f /g10/keygen.c
parentscd: Shorten cardio debug output for all zeroes. (diff)
downloadgnupg2-45398518fb76e2b859d2d48cf4cdbc11fbbda4fa.tar.xz
gnupg2-45398518fb76e2b859d2d48cf4cdbc11fbbda4fa.zip
ecc: Support Ed448/X448 key generation.
* g10/keygen.c (ask_curve): Support Ed448/X448 keys. (generate_keypair): Support switch to X448 key. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/keygen.c')
-rw-r--r--g10/keygen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index d87b8480a..776896228 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -2612,7 +2612,7 @@ ask_curve (int *algo, int *subkey_algo, const char *current)
# define MY_USE_ECDSADH 0
#endif
{ "Curve25519", "Ed25519", "Curve 25519", !!GPG_USE_EDDSA, 0, 0, 0 },
- { "Curve448", "Ed448", "Curve 448", 0/*reserved*/ , 0, 1, 0 },
+ { "X448", "Ed448", "Curve 448", !!GPG_USE_EDDSA, 0, 1, 0 },
{ "NIST P-256", NULL, NULL, MY_USE_ECDSADH, 0, 1, 0 },
{ "NIST P-384", NULL, NULL, MY_USE_ECDSADH, 0, 0, 0 },
{ "NIST P-521", NULL, NULL, MY_USE_ECDSADH, 0, 1, 0 },
@@ -4972,7 +4972,10 @@ generate_keypair (ctrl_t ctrl, int full, const char *fname,
{
/* Need to switch to a different curve for the
encryption key. */
- curve = "Curve25519";
+ if (!strcmp (curve, "Ed25519"))
+ curve = "Curve25519";
+ else
+ curve = "X448";
}
r = xmalloc_clear (sizeof *r + strlen (curve));
r->key = pSUBKEYCURVE;