From: Dmitry Eremin-Solenikov Date: Tue, 7 May 2019 12:24:53 +0000 (+0300) Subject: lib: define more GOST curves X-Git-Tag: gnutls_3_6_11~41^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96fcde09cef9ca68b0d94d0498be3bfd8a609e2b;p=thirdparty%2Fgnutls.git lib: define more GOST curves 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 --- diff --git a/devel/libgnutls-latest-x86_64.abi b/devel/libgnutls-latest-x86_64.abi index 7198fa4632..b2c058d71d 100644 --- a/devel/libgnutls-latest-x86_64.abi +++ b/devel/libgnutls-latest-x86_64.abi @@ -1709,7 +1709,12 @@ - + + + + + + diff --git a/lib/algorithms/ecc.c b/lib/algorithms/ecc.c index 72b0864e75..0d305e8fee 100644 --- a/lib/algorithms/ecc.c +++ b/lib/algorithms/ecc.c @@ -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} }; diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index 6b35c44342..b26aa004f7 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -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; /**