]> Cypherpunks.ru repositories - pygost.git/commitdiff
Fix gost28147.addmod with bigger than modulo values 4.6
authorSergey Matveev <stargrave@stargrave.org>
Tue, 7 Jul 2020 17:30:22 +0000 (20:30 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 7 Jul 2020 17:32:37 +0000 (20:32 +0300)
VERSION
install.texi
news.texi
pygost/__init__.py
pygost/gost28147.py

diff --git a/VERSION b/VERSION
index 4caecc733e6bc437e8afacd9a27cd84edd18a5bc..b3d791d7525d40f365fab7fb6d7b34448af4aeb8 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.5
+4.6
index a494da641ba173e889e17b867098a39a966cc2dd..dcbaebd20f3b3bf79c0cc20bb8f42192977f3288 100644 (file)
@@ -1,7 +1,7 @@
 @node Download
 @unnumbered Download
 
-@set VERSION 4.5
+@set VERSION 4.6
 
 No additional dependencies except Python 2.7/3.x interpreter are required.
 
index e8c8c5845ded4b0df2af04c3713a1668692a0c96..8bcd2c3be9d6927a62e45e796491b818e7a401f5 100644 (file)
--- a/news.texi
+++ b/news.texi
@@ -3,6 +3,13 @@
 
 @table @strong
 
+@anchor{Release 4.6}
+@item 4.6
+    @itemize
+    @item Fix invalid @code{gost28147.addmod}'s behaviour with much
+        bigger values than the modulo
+    @end itemize
+
 @anchor{Release 4.5}
 @item 4.5
     @itemize
index 8c64e1e57437483413914f49bceb0ea5b097f3a8..2a80079d97fd15604c80350d6e487540a14a9a62 100644 (file)
@@ -3,4 +3,4 @@
 PyGOST is free software: see the file COPYING for copying conditions.
 """
 
-__version__ = "4.5"
+__version__ = "4.6"
index 01368f8b3e26475935e507821f999aac211a38fd..3d6705dbd1a2f542e2d2c07982ee1c2be0df38ab 100644 (file)
@@ -190,7 +190,7 @@ def addmod(x, y, mod=2 ** 32):
     """ Modulo adding of two integers
     """
     r = x + y
-    return r if r < mod else r - mod
+    return r if r < mod else r % mod
 
 
 def _shift11(x):