[PATCH 4/4] ecc: added GOST R 34.10-2012 Edwards curves from RFC 7836

dbaryshkov at gmail.com dbaryshkov at gmail.com
Tue Nov 12 08:58:19 CET 2019


From: Paul Wolneykien <manowar at altlinux.org>

* cipher/ecc-curves.c (domain_parms): add two curves defined in RFC 7836
  (curve_aliases): add OIDs for new curves.

--

[DES: added curve GOST2012-512-tc26-C, fixed cofactors to the value 4.]

Signed-off-by: Paul Wolneykien <manowar at altlinux.org>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
---
 cipher/ecc-curves.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c
index 732219a99572..e1085f817b04 100644
--- a/cipher/ecc-curves.c
+++ b/cipher/ecc-curves.c
@@ -97,6 +97,7 @@ static const struct
     { "GOST2001-CryptoPro-A", "1.2.643.2.2.36.0" },
     { "GOST2001-CryptoPro-C", "1.2.643.2.2.36.1" },
 
+    { "GOST2012-256-tc26-A", "1.2.643.7.1.2.1.1.1" },
     { "GOST2001-CryptoPro-A", "1.2.643.7.1.2.1.1.2" },
     { "GOST2001-CryptoPro-A", "GOST2012-256-tc26-B" },
     { "GOST2001-CryptoPro-B", "1.2.643.7.1.2.1.1.3" },
@@ -109,6 +110,7 @@ static const struct
     { "GOST2012-512-tc26-B", "GOST2012-tc26-B" },
     { "GOST2012-512-tc26-A", "1.2.643.7.1.2.1.2.1" },
     { "GOST2012-512-tc26-B", "1.2.643.7.1.2.1.2.2" },
+    { "GOST2012-512-tc26-C", "1.2.643.7.1.2.1.2.3" },
 
     { "secp256k1", "1.3.132.0.10" },
 
@@ -479,6 +481,23 @@ static const ecc_domain_parms_t domain_parms[] =
         "dcb228fd1edf4a39152cbcaaf8c0398828041055f94ceeec7e21340780fe41bd",
       1
     },
+    {
+      "GOST2012-512-tc26-C", 512, 0,
+      MPI_EC_WEIERSTRASS, ECC_DIALECT_STANDARD,
+      "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
+        "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc7",
+      "0xdc9203e514a721875485a529d2c722fb187bc8980eb866644de41c68e1430645"
+        "46e861c0e2c9edd92ade71f46fcf50ff2ad97f951fda9f2a2eb6546f39689bd3",
+      "0xb4c4ee28cebc6c2c8ac12952cf37f16ac7efb6a9f69f4b57ffda2e4f0de5ade0"
+        "38cbc2fff719d2c18de0284b8bfef3b52b8cc7a5f5bf0a3c8d2319a5312557e1",
+      "0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
+        "c98cdba46506ab004c33a9ff5147502cc8eda9e7a769a12694623cef47f023ed",
+      "0xe2e31edfc23de7bdebe241ce593ef5de2295b7a9cbaef021d385f7074cea043a"
+        "a27272a7ae602bf2a7b9033db9ed3610c6fb85487eae97aac5bc7928c1950148",
+      "0xf5ce40d95b5eb899abbccff5911cb8577939804d6527378b8c108c3d2090ff9be"
+        "18e2d33e3021ed2ef32d85822423b6304f726aa854bae07d0396e9a9addc40f",
+      4
+    },
 
     {
       "secp256k1", 256, 0,
-- 
2.24.0




More information about the Gcrypt-devel mailing list