From c5e41f539b9a21cbad10c7dae95572a4445d31c3 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 15 Jan 2014 15:00:24 +0900 Subject: [PATCH] Add secp256k1. * common/openpgp-oid.c (openpgp_curve_to_oid): Add secp256k1. (openpgp_oid_to_curve): Likewise. * g10/keygen.c (ask_curve): Add secp256k1. Signed-off-by: NIIBE Yutaka --- common/openpgp-oid.c | 7 +++++++ g10/keygen.c | 1 + 2 files changed, 8 insertions(+) diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c index 05b1a4046..28567b7fe 100644 --- a/common/openpgp-oid.c +++ b/common/openpgp-oid.c @@ -310,6 +310,11 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits) oidstr = "1.3.36.3.3.2.8.1.1.13"; nbits = 512; } + else if (!strcmp (name, "secp256k1")) + { + oidstr = "1.3.132.0.10"; + nbits = 256; + } else oidstr = NULL; @@ -333,6 +338,8 @@ openpgp_oid_to_curve (const char *oid) name = "Ed25519"; else if (!strcmp (oid, "1.2.840.10045.3.1.7")) name = "nistp256"; + else if (!strcmp (oid, "1.3.132.0.10")) + name = "secp256k1"; else if (!strcmp (oid, "1.3.132.0.34")) name = "nistp384"; else if (!strcmp (oid, "1.3.132.0.35")) diff --git a/g10/keygen.c b/g10/keygen.c index 4bb8bbaed..7582b0bf9 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -2062,6 +2062,7 @@ ask_curve (void) { "brainpoolP256r1", 0, 1, "Brainpool P-256" }, { "brainpoolP384r1", 0, 1, "Brainpool P-384" }, { "brainpoolP512r1", 0, 1, "Brainpool P-512" }, + { "secp256k1", 0, 1 }, }; int idx; char *answer;