1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-08 12:44:23 +01:00

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 <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2014-01-15 15:00:24 +09:00
parent 927377bc91
commit c5e41f539b
2 changed files with 8 additions and 0 deletions

@ -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"))

@ -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;