From: Sergey Matveev Date: Mon, 5 Nov 2018 18:26:04 +0000 (+0300) Subject: kek_34102012256 can be used with 256-bit private keys X-Git-Tag: 3.15~18 X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=commitdiff_plain;h=daafb8be30dc1991de044e2f5f95d1232969e88a kek_34102012256 can be used with 256-bit private keys --- diff --git a/VERSION b/VERSION index 2c07333..e4fba21 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.11 +3.12 diff --git a/news.texi b/news.texi index 6dc6644..68e672d 100644 --- a/news.texi +++ b/news.texi @@ -2,6 +2,14 @@ @unnumbered News @table @strong + +@anchor{Release 3.12} +@item 3.12 + @itemize + @item Added mode argument to @code{pygost.gost3410_vko.kek_34102012256}, + because 256-bit private keys can be used with that algorithm too. + @end itemize + @anchor{Release 3.11} @item 3.11 Fixed PEP247 typing stub with invalid hexdigest method. @@ -128,4 +136,5 @@ GOST R 34.12-2015 Кузнечик (Kuznechik) implementation. @item 0.10 CryptoPro and GOST key wrapping, CryptoPro key meshing. + @end table diff --git a/pygost/gost3410_vko.py b/pygost/gost3410_vko.py index 6650ca5..7b7e10d 100644 --- a/pygost/gost3410_vko.py +++ b/pygost/gost3410_vko.py @@ -60,7 +60,7 @@ def kek_34102001(curve, prv, pub, ukm): ).digest() -def kek_34102012256(curve, prv, pub, ukm=1): +def kek_34102012256(curve, prv, pub, ukm=1, mode=2012): """ Key agreement (34.10-2012, 34.11-2012 256 bit) :param GOST3410Curve curve: curve to use @@ -74,7 +74,7 @@ def kek_34102012256(curve, prv, pub, ukm=1): Shared Key Encryption Key computation is based on :rfc:`7836` VKO GOST R 34.10-2012. """ - return GOST34112012256(kek(curve, prv, pub, ukm, mode=2012)).digest() + return GOST34112012256(kek(curve, prv, pub, ukm, mode=mode)).digest() def kek_34102012512(curve, prv, pub, ukm=1): diff --git a/pygost/stubs/pygost/gost3410_vko.pyi b/pygost/stubs/pygost/gost3410_vko.pyi index c6d35e5..6e4531f 100644 --- a/pygost/stubs/pygost/gost3410_vko.pyi +++ b/pygost/stubs/pygost/gost3410_vko.pyi @@ -8,7 +8,7 @@ def ukm_unmarshal(ukm: bytes) -> int: ... def kek_34102001(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int) -> bytes: ... -def kek_34102012256(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int=...) -> bytes: ... +def kek_34102012256(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int=..., mode: int=...) -> bytes: ... def kek_34102012512(curve: GOST3410Curve, prv: int, pub: PublicKey, ukm: int=...) -> bytes: ...