]> Cypherpunks.ru repositories - pygost.git/commitdiff
kek_34102012256 can be used with 256-bit private keys
authorSergey Matveev <stargrave@stargrave.org>
Mon, 5 Nov 2018 18:26:04 +0000 (21:26 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 9 Dec 2018 10:01:32 +0000 (13:01 +0300)
VERSION
news.texi
pygost/gost3410_vko.py
pygost/stubs/pygost/gost3410_vko.pyi

diff --git a/VERSION b/VERSION
index 2c0733315e415bfb5e5b353f9996ecd964d395b2..e4fba2183587225f216eeada4c78dfab6b2e65f5 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.11
+3.12
index 6dc66442d810e3941f25dae4f133aa948988892a..68e672d28c2b196e5ae9f449fd2e08d3cbced7c5 100644 (file)
--- 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
index 6650ca5607633375c26fef4c2314e97e8589eb38..7b7e10d42a608fa778f2a5dc118e45a6ee533cd8 100644 (file)
@@ -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):
index c6d35e5a0d19c7520e04251dad975af6b28acf3a..6e4531f28f876fd7d23a0707fa2e050f21e26672 100644 (file)
@@ -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: ...