From: Sergey Matveev Date: Thu, 9 Jul 2020 07:50:02 +0000 (+0300) Subject: More addmod simplification X-Git-Tag: 4.7~3 X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=commitdiff_plain;h=80dd2b2a713366081c2f3e8a10fd7b5bd705e127 More addmod simplification --- diff --git a/pygost/gost28147.py b/pygost/gost28147.py index 3d6705d..b6f3cf4 100644 --- a/pygost/gost28147.py +++ b/pygost/gost28147.py @@ -189,8 +189,7 @@ def ns2block(ns): def addmod(x, y, mod=2 ** 32): """ Modulo adding of two integers """ - r = x + y - return r if r < mod else r % mod + return (x + y) % mod def _shift11(x):