Mailing List Archive

[PATCH 1/4] ecc: rename 512-bit GOST curves
From: Paul Wolneykien <manowar@altlinux.org>

* cipher/ecc-curves.c (domain_parms): rename GOST 2012 curves to contain
curve bit size
(curve_aliases): rename curves and provide backwards-compatible
aliases.
* tests/basic.c (check_pubkey): use new name for GOST2012 512-bit test
curve.
* tests/benchmark.c (ecc_bench): use new name for GOST2012 512-bit test
curve.

--
In preparation to adding new GOST2012 curves, rename old GOST2012 curves
to specifically mention that they are 512-bit curves.

Signed-off-by: Paul Wolneykien <manowar@altlinux.org>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
cipher/ecc-curves.c | 12 +++++++-----
tests/basic.c | 4 ++--
tests/benchmark.c | 2 +-
3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c
index 581ba4d66e54..4ba66cb353dd 100644
--- a/cipher/ecc-curves.c
+++ b/cipher/ecc-curves.c
@@ -97,8 +97,10 @@ 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" },
+ { "GOST2012-512-tc26-A", "GOST2012-tc26-A" },
+ { "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" },

{ "secp256k1", "1.3.132.0.10" },

@@ -408,7 +410,7 @@ static const ecc_domain_parms_t domain_parms[] =
1
},
{
- "GOST2012-test", 511, 0,
+ "GOST2012-512-test", 511, 0,
MPI_EC_WEIERSTRASS, ECC_DIALECT_STANDARD,
"0x4531acd1fe0023c7550d267b6b2fee80922b14b2ffb90f04d4eb7c09b5d2d15d"
"f1d852741af4704a0458047e80e4546d35b8336fac224dd81664bbf528be6373",
@@ -425,7 +427,7 @@ static const ecc_domain_parms_t domain_parms[] =
1
},
{
- "GOST2012-tc26-A", 512, 0,
+ "GOST2012-512-tc26-A", 512, 0,
MPI_EC_WEIERSTRASS, ECC_DIALECT_STANDARD,
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc7",
@@ -442,7 +444,7 @@ static const ecc_domain_parms_t domain_parms[] =
1
},
{
- "GOST2012-tc26-B", 512, 0,
+ "GOST2012-512-tc26-B", 512, 0,
MPI_EC_WEIERSTRASS, ECC_DIALECT_STANDARD,
"0x8000000000000000000000000000000000000000000000000000000000000000"
"000000000000000000000000000000000000000000000000000000000000006f",
diff --git a/tests/basic.c b/tests/basic.c
index b798eaafa21c..8337bcfb7ba0 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -13227,7 +13227,7 @@ check_pubkey (void)
{
"(private-key\n"
" (ecc\n"
- " (curve GOST2012-test)\n"
+ " (curve GOST2012-512-test)\n"
" (q #04115DC5BC96760C7B48598D8AB9E740D4C4A85A65BE33C1"
" 815B5C320C854621DD5A515856D13314AF69BC5B924C8B"
" 4DDFF75C45415C1D9DD9DD33612CD530EFE137C7C90CD4"
@@ -13240,7 +13240,7 @@ check_pubkey (void)

"(public-key\n"
" (ecc\n"
- " (curve GOST2012-test)\n"
+ " (curve GOST2012-512-test)\n"
" (q #04115DC5BC96760C7B48598D8AB9E740D4C4A85A65BE33C1"
" 815B5C320C854621DD5A515856D13314AF69BC5B924C8B"
" 4DDFF75C45415C1D9DD9DD33612CD530EFE137C7C90CD4"
diff --git a/tests/benchmark.c b/tests/benchmark.c
index 0f15c0d89fe7..a245152c0228 100644
--- a/tests/benchmark.c
+++ b/tests/benchmark.c
@@ -1528,7 +1528,7 @@ ecc_bench (int iterations, int print_header)
else if (is_gost)
err = gcry_sexp_build (&key_spec, NULL,
"(genkey (ecdsa (curve %s)))",
- p_size == 256 ? "GOST2001-test" : "GOST2012-test");
+ p_size == 256 ? "GOST2001-test" : "GOST2012-512-test");
else
err = gcry_sexp_build (&key_spec, NULL,
"(genkey (ECDSA (nbits %d)))", p_size);
--
2.24.0


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: [PATCH 1/4] ecc: rename 512-bit GOST curves [ In reply to ]
On Tue, 12 Nov 2019 10:58, Dmitry Eremin-Solenikov said:

> * cipher/ecc-curves.c (domain_parms): rename GOST 2012 curves to contain
> curve bit size
> (curve_aliases): rename curves and provide backwards-compatible
> aliases.

I can't immediately see that there are new aliases.

> - { "GOST2012-tc26-A", "1.2.643.7.1.2.1.2.1" },
> - { "GOST2012-tc26-B", "1.2.643.7.1.2.1.2.2" },

These have been removed but we need to keep them - at least as an alias.
Actually even turning the curves into an alias would be an ABI change;
however we can accept that.

> - "GOST2012-test", 511, 0,
> + "GOST2012-512-test", 511, 0,

Ditto.

Can you please check again and if possible I would also appreciate a
single patch for the new curve names.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
Re: [PATCH 1/4] ecc: rename 512-bit GOST curves [ In reply to ]
??, 12 ????. 2019 ?. ? 18:20, Werner Koch <wk@gnupg.org>:
>
> On Tue, 12 Nov 2019 10:58, Dmitry Eremin-Solenikov said:
>
> > * cipher/ecc-curves.c (domain_parms): rename GOST 2012 curves to contain
> > curve bit size
> > (curve_aliases): rename curves and provide backwards-compatible
> > aliases.
>
> I can't immediately see that there are new aliases.

GOST2012-tc26-A is a current name, now provided in alias.
GOST2012-512-tc26-A is a new curve name.

>
> > - { "GOST2012-tc26-A", "1.2.643.7.1.2.1.2.1" },
> > - { "GOST2012-tc26-B", "1.2.643.7.1.2.1.2.2" },
>
> These have been removed but we need to keep them - at least as an alias.
> Actually even turning the curves into an alias would be an ABI change;
> however we can accept that.

Hmm. I have added aliases both for OIDs and for old names. Could you
please tell what did I miss?

>
> > - "GOST2012-test", 511, 0,
> > + "GOST2012-512-test", 511, 0,
>
> Ditto.

Ah, I missed this one. I'll add GOST2012-test alias to point to
GOST2012-512-test.

>
> Can you please check again and if possible I would also appreciate a
> single patch for the new curve names.

Which patches would you like to be squashed? Or should I just update this patch?

--
With best wishes
Dmitry

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: [PATCH 1/4] ecc: rename 512-bit GOST curves [ In reply to ]
On Tue, 12 Nov 2019 18:35, Dmitry Eremin-Solenikov said:

> GOST2012-tc26-A is a current name, now provided in alias.
> GOST2012-512-tc26-A is a new curve name.

Okay, I missed that.

>> > - "GOST2012-test", 511, 0,
>> > + "GOST2012-512-test", 511, 0,
>>
>> Ditto.
>
> Ah, I missed this one. I'll add GOST2012-test alias to point to
> GOST2012-512-test.

Good.

> Which patches would you like to be squashed? Or should I just update this patch?

I think squasing all 4 would bea easiest.


Salam-Shalom,

Werner



--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.