diff options
author | Werner Koch <wk@gnupg.org> | 2020-05-12 13:14:06 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-05-12 13:14:06 +0200 |
commit | c750b784d2bee0a32be72bcfb818e0a7683fa914 (patch) | |
tree | 3c5fcab2dcc069599e78bffd41f483ab87f55cf9 /cipher/ecc-curves.c | |
parent | 75a7b17878e02c3882070d6c86e0d2efbc3d680a (diff) | |
download | libgcrypt-c750b784d2bee0a32be72bcfb818e0a7683fa914.tar.gz |
ecc: Temporary hack to enable Ed25519 as specified by rfc8410.
--
Diffstat (limited to 'cipher/ecc-curves.c')
-rw-r--r-- | cipher/ecc-curves.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c index 92850ac7..b42be53f 100644 --- a/cipher/ecc-curves.c +++ b/cipher/ecc-curves.c @@ -45,16 +45,15 @@ static const struct { "Ed25519", "1.3.6.1.4.1.11591.15.1" }, /* OpenPGP */ -#if 0 /* FIXME: We have a naming issue here. RFC-8032 says that its * Ed25519 is the pureEdDSA, that is w.o. the SHA512 prehasing we - * use in OpenPGP. */ - { "Ed25519", "1.3.101.112" }, /* rfc8410 */ + * use in OpenPGP. For now we prefix the name with curve ala + * dumpasn1. */ + { "curveEd25519","1.3.101.112" }, /* rfc8410 */ - { "Ed448", "1.3.101.113" }, /* rfc8410 */ + { "curveEd448", "1.3.101.113" }, /* rfc8410 */ { "X22519", "1.3.101.110" }, /* rfc8410 */ -#endif { "X448", "1.3.101.111" }, /* rfc8410 */ @@ -160,6 +159,18 @@ static const ecc_domain_parms_t domain_parms[] = "0x6666666666666666666666666666666666666666666666666666666666666658", 8 }, + { /* Duplicated due to name issues. FIXME FIXME. */ + /* (-x^2 + y^2 = 1 + dx^2y^2) */ + "curveEd25519", 256, 0, + MPI_EC_EDWARDS, ECC_DIALECT_ED25519, + "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED", + "-0x01", + "-0x2DFC9311D490018C7338BF8688861767FF8FF5B2BEBE27548A14B235ECA6874A", + "0x1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED", + "0x216936D3CD6E53FEC0A4E231FDD6DC5C692CC7609525A7B2C9562D608F25D51A", + "0x6666666666666666666666666666666666666666666666666666666666666658", + 8 + }, { /* (y^2 = x^3 + 486662*x^2 + x) */ "Curve25519", 256, 0, |