]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
lib: define more GOST curves
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Tue, 7 May 2019 12:24:53 +0000 (15:24 +0300)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Sun, 6 Oct 2019 16:32:05 +0000 (19:32 +0300)
Declare GOST curves from GOST R 34.10-2001 and GOST R 34.10-2012 (test
curves) and GOST curves defined by TC26 itself.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
devel/libgnutls-latest-x86_64.abi
lib/algorithms/ecc.c
lib/includes/gnutls/gnutls.h.in

index 7198fa4632cdab1957e57bdcd9ba68e8c09415d4..b2c058d71dc534f94c23e5a0adeed9f32a1db364 100644 (file)
       <enumerator name='GNUTLS_ECC_CURVE_GOST256CPXB' value='12'/>
       <enumerator name='GNUTLS_ECC_CURVE_GOST512A' value='13'/>
       <enumerator name='GNUTLS_ECC_CURVE_GOST512B' value='14'/>
-      <enumerator name='GNUTLS_ECC_CURVE_MAX' value='14'/>
+      <enumerator name='GNUTLS_ECC_CURVE_GOST512C' value='15'/>
+      <enumerator name='GNUTLS_ECC_CURVE_GOST256A' value='16'/>
+      <enumerator name='GNUTLS_ECC_CURVE_GOST256B' value='17'/>
+      <enumerator name='GNUTLS_ECC_CURVE_GOST256C' value='18'/>
+      <enumerator name='GNUTLS_ECC_CURVE_GOST256D' value='19'/>
+      <enumerator name='GNUTLS_ECC_CURVE_MAX' value='19'/>
     </enum-decl>
     <typedef-decl name='gnutls_ecc_curve_t' type-id='type-id-67' id='type-id-59'/>
     <enum-decl name='__anonymous_enum__' is-anonymous='yes' id='type-id-68'>
index 72b0864e757b3edb440b0cd175325876de61576e..0d305e8fee7995fa825b97f7941ce6e5d11c1ecf 100644 (file)
@@ -136,6 +136,42 @@ gnutls_ecc_curve_entry_st ecc_curves[] = {
         .gost_curve = 1,
         .supported = 1,
        },
+       {
+        .name = "TC26-256-A",
+        .oid = "1.2.643.7.1.2.1.1.1",
+        .id = GNUTLS_ECC_CURVE_GOST256A,
+        .pk = GNUTLS_PK_GOST_12_256,
+        .size = 64,
+        .gost_curve = 1,
+        .supported = 1,
+       },
+       {
+        .name = "TC26-256-B",
+        .oid = "1.2.643.7.1.2.1.1.2",
+        .id = GNUTLS_ECC_CURVE_GOST256B,
+        .pk = GNUTLS_PK_GOST_12_256,
+        .size = 64,
+        .gost_curve = 1,
+        .supported = 1,
+       },
+       {
+        .name = "TC26-256-C",
+        .oid = "1.2.643.7.1.2.1.1.3",
+        .id = GNUTLS_ECC_CURVE_GOST256C,
+        .pk = GNUTLS_PK_GOST_12_256,
+        .size = 64,
+        .gost_curve = 1,
+        .supported = 1,
+       },
+       {
+        .name = "TC26-256-D",
+        .oid = "1.2.643.7.1.2.1.1.4",
+        .id = GNUTLS_ECC_CURVE_GOST256D,
+        .pk = GNUTLS_PK_GOST_12_256,
+        .size = 64,
+        .gost_curve = 1,
+        .supported = 1,
+       },
        {
         .name = "TC26-512-A",
         .oid = "1.2.643.7.1.2.1.2.1",
@@ -154,6 +190,15 @@ gnutls_ecc_curve_entry_st ecc_curves[] = {
         .gost_curve = 1,
         .supported = 1,
        },
+       {
+        .name = "TC26-512-C",
+        .oid = "1.2.643.7.1.2.1.2.3",
+        .id = GNUTLS_ECC_CURVE_GOST512C,
+        .pk = GNUTLS_PK_GOST_12_512,
+        .size = 64,
+        .gost_curve = 1,
+        .supported = 1,
+       },
 #endif
        {0, 0, 0}
 };
index 6b35c44342b9418211531939c5732c28c6202039..b26aa004f7362b2f42ee26f5a10011d870dbf4d8 100644 (file)
@@ -986,6 +986,11 @@ typedef enum {
  * @GNUTLS_ECC_CURVE_GOST256CPXB: GOST R 34.10 CryptoPro 256 XchB curve
  * @GNUTLS_ECC_CURVE_GOST512A: GOST R 34.10 TC26 512 A curve
  * @GNUTLS_ECC_CURVE_GOST512B: GOST R 34.10 TC26 512 B curve
+ * @GNUTLS_ECC_CURVE_GOST512C: GOST R 34.10 TC26 512 C curve
+ * @GNUTLS_ECC_CURVE_GOST256A: GOST R 34.10 TC26 256 A curve
+ * @GNUTLS_ECC_CURVE_GOST256B: GOST R 34.10 TC26 256 B curve
+ * @GNUTLS_ECC_CURVE_GOST256C: GOST R 34.10 TC26 256 C curve
+ * @GNUTLS_ECC_CURVE_GOST256D: GOST R 34.10 TC26 256 D curve
  *
  * Enumeration of ECC curves.
  */
@@ -1005,7 +1010,12 @@ typedef enum {
        GNUTLS_ECC_CURVE_GOST256CPXB,
        GNUTLS_ECC_CURVE_GOST512A,
        GNUTLS_ECC_CURVE_GOST512B,
-       GNUTLS_ECC_CURVE_MAX = GNUTLS_ECC_CURVE_GOST512B
+       GNUTLS_ECC_CURVE_GOST512C,
+       GNUTLS_ECC_CURVE_GOST256A,
+       GNUTLS_ECC_CURVE_GOST256B,
+       GNUTLS_ECC_CURVE_GOST256C,
+       GNUTLS_ECC_CURVE_GOST256D,
+       GNUTLS_ECC_CURVE_MAX = GNUTLS_ECC_CURVE_GOST256D
 } gnutls_ecc_curve_t;
 
 /**