]> Cypherpunks.ru repositories - pygost.git/commitdiff
Fix 34.10 degree sanitizing
authorSergey Matveev <stargrave@stargrave.org>
Mon, 5 Nov 2018 18:37:36 +0000 (21:37 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 9 Dec 2018 10:01:32 +0000 (13:01 +0300)
news.texi
pygost/gost3410.py

index 68e672d28c2b196e5ae9f449fd2e08d3cbced7c5..a0ca9d18ba36ba81bc6d999311e0cfdb817b3ee7 100644 (file)
--- a/news.texi
+++ b/news.texi
@@ -8,6 +8,9 @@
     @itemize
     @item Added mode argument to @code{pygost.gost3410_vko.kek_34102012256},
         because 256-bit private keys can be used with that algorithm too.
+    @item Fix incorrect degree sanitizing in
+        @code{pygost.gost3410.GOST3410Curve.exp} preventing using of
+        @code{UKM=1} in @code{pygost.gost3410_vko.kek_*} functions.
     @end itemize
 
 @anchor{Release 3.11}
index 50de4796077ee85f646331a8e9a3a61827b70e5e..f6089128d9571ce606ef518dc2c9885c56c86868 100644 (file)
@@ -164,9 +164,9 @@ class GOST3410Curve(object):
         y = y or self.y
         tx = x
         ty = y
-        degree -= 1
         if degree == 0:
             raise ValueError("Bad degree value")
+        degree -= 1
         while degree != 0:
             if degree & 1 == 1:
                 tx, ty = self._add(tx, ty, x, y)