X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=blobdiff_plain;f=pygost%2Fgost341194.py;h=4ffb45e63f189cb4a4c1027b884c68ee54fddf6e;hp=6d58efd666de769c9358ff66b2bf5f0175681d23;hb=b2e90391aebf713b34023e379803fbf968e5aed8;hpb=80dd2b2a713366081c2f3e8a10fd7b5bd705e127 diff --git a/pygost/gost341194.py b/pygost/gost341194.py index 6d58efd..4ffb45e 100644 --- a/pygost/gost341194.py +++ b/pygost/gost341194.py @@ -23,7 +23,6 @@ from copy import copy from functools import partial from struct import pack -from pygost.gost28147 import addmod from pygost.gost28147 import block2ns from pygost.gost28147 import encrypt from pygost.gost28147 import ns2block @@ -167,7 +166,7 @@ class GOST341194(PEP247): for i in xrange(0, len(m), BLOCKSIZE): part = m[i:i + BLOCKSIZE][::-1] _len += len(part) * 8 - checksum = addmod(checksum, int(hexenc(part), 16), 2 ** 256) + checksum = (checksum + int(hexenc(part), 16)) % (2 ** 256) if len(part) < BLOCKSIZE: part = b"\x00" * (BLOCKSIZE - len(part)) + part h = _step(h, part, self.sbox)