[PATCH 5/5] Add GOST R 34.10-2012 curves proposed by TC26

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Mon Dec 30 21:39:58 CET 2013


* cipher/ecc-curves.c (domain_parmss): Add two GOST R 34.10-2012 curves
  proposed/pending to standardization by TC26 (Russian cryptography
  technical comitee).
* cipher/ecc-curves.c (curve_alias): Add OID aliases.
* tests/curves.c: Increase N_CURVES.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
---
 cipher/ecc-curves.c | 35 +++++++++++++++++++++++++++++++++++
 tests/curves.c      |  2 +-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c
index 970c8b1..db81f16 100644
--- a/cipher/ecc-curves.c
+++ b/cipher/ecc-curves.c
@@ -82,6 +82,9 @@ static const struct
     { "GOST2001-CryptoPro-A", "1.2.643.2.2.36.0" },
     { "GOST2001-CryptoPro-C", "1.2.643.2.2.36.1" },
 
+    { "GOST2012-tc26-A", "1.2.643.7.1.2.1.2.1" },
+    { "GOST2012-tc26-B", "1.2.643.7.1.2.1.2.2" },
+
     { NULL, NULL}
   };
 
@@ -334,6 +337,38 @@ static const ecc_domain_parms_t domain_parms[] =
       "0x2bb312a43bd2ce6e0d020613c857acddcfbf061e91e5f2c3f32447c259f39b2"
       "c83ab156d77f1496bf7eb3351e1ee4e43dc1a18b91b24640b6dbb92cb1add371e",
     },
+    {
+      "GOST2012-tc26-A", 512, 0,
+      MPI_EC_WEIERSTRASS, ECC_DIALECT_STANDARD,
+      "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
+        "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc7",
+      "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
+        "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc4",
+      "0xe8c2505dedfc86ddc1bd0b2b6667f1da34b82574761cb0e879bd081cfd0b6265"
+        "ee3cb090f30d27614cb4574010da90dd862ef9d4ebee4761503190785a71c760",
+      "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
+        "27e69532f48d89116ff22b8d4e0560609b4b38abfad2b85dcacdb1411f10b275",
+      "0x0000000000000000000000000000000000000000000000000000000000000000"
+        "0000000000000000000000000000000000000000000000000000000000000003",
+      "0x7503cfe87a836ae3a61b8816e25450e6ce5e1c93acf1abc1778064fdcbefa921"
+        "df1626be4fd036e93d75e6a50e3a41e98028fe5fc235f5b889a589cb5215f2a4",
+    },
+    {
+      "GOST2012-tc26-B", 512, 0,
+      MPI_EC_WEIERSTRASS, ECC_DIALECT_STANDARD,
+      "0x8000000000000000000000000000000000000000000000000000000000000000"
+        "000000000000000000000000000000000000000000000000000000000000006f",
+      "0x8000000000000000000000000000000000000000000000000000000000000000"
+        "000000000000000000000000000000000000000000000000000000000000006c",
+      "0x687d1b459dc841457e3e06cf6f5e2517b97c7d614af138bcbf85dc806c4b289f"
+        "3e965d2db1416d217f8b276fad1ab69c50f78bee1fa3106efb8ccbc7c5140116",
+      "0x8000000000000000000000000000000000000000000000000000000000000001"
+        "49a1ec142565a545acfdb77bd9d40cfa8b996712101bea0ec6346c54374f25bd",
+      "0x0000000000000000000000000000000000000000000000000000000000000000"
+        "0000000000000000000000000000000000000000000000000000000000000002",
+      "0x1a8f7eda389b094c2c071e3647a8940f3c123b697578c213be6dd9e6c8ec7335"
+        "dcb228fd1edf4a39152cbcaaf8c0398828041055f94ceeec7e21340780fe41bd",
+    },
 
     { NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL }
   };
diff --git a/tests/curves.c b/tests/curves.c
index 0768efd..3b0d071 100644
--- a/tests/curves.c
+++ b/tests/curves.c
@@ -29,7 +29,7 @@
 #include "../src/gcrypt-int.h"
 
 /* Number of curves defined in ../cipger/ecc.c */
-#define N_CURVES 18
+#define N_CURVES 20
 
 /* A real world sample public key.  */
 static char const sample_key_1[] =
-- 
1.8.5.2




More information about the Gcrypt-devel mailing list