From: Sergey Matveev Date: Tue, 7 Jul 2020 17:30:22 +0000 (+0300) Subject: Fix gost28147.addmod with bigger than modulo values X-Git-Tag: 4.6 X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=commitdiff_plain;h=refs%2Ftags%2F4.6 Fix gost28147.addmod with bigger than modulo values --- diff --git a/VERSION b/VERSION index 4caecc7..b3d791d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5 +4.6 diff --git a/install.texi b/install.texi index a494da6..dcbaebd 100644 --- a/install.texi +++ b/install.texi @@ -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. diff --git a/news.texi b/news.texi index e8c8c58..8bcd2c3 100644 --- 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 diff --git a/pygost/__init__.py b/pygost/__init__.py index 8c64e1e..2a80079 100644 --- a/pygost/__init__.py +++ b/pygost/__init__.py @@ -3,4 +3,4 @@ PyGOST is free software: see the file COPYING for copying conditions. """ -__version__ = "4.5" +__version__ = "4.6" diff --git a/pygost/gost28147.py b/pygost/gost28147.py index 01368f8..3d6705d 100644 --- a/pygost/gost28147.py +++ b/pygost/gost28147.py @@ -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):