X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=blobdiff_plain;f=pygost%2Fgost34112012.py;fp=pygost%2Fgost34112012.py;h=91782de66365658f6212ee4392e58205fec8b3d1;hp=64ed3b6de6fbfe4ba1209656cd521ccf18d31525;hb=63d5c5a81f29bfbb2e6eff3d8dc730a33ef80427;hpb=fffc38fbb9568b83575edeb2d6040fdf39fe7288 diff --git a/pygost/gost34112012.py b/pygost/gost34112012.py index 64ed3b6..91782de 100644 --- a/pygost/gost34112012.py +++ b/pygost/gost34112012.py @@ -268,8 +268,9 @@ class GOST34112012(PEP247): """Update state with the new data """ if len(self.buf) > 0: - self.buf += data[:BLOCKSIZE - len(self.buf)] - data = data[BLOCKSIZE - len(self.buf):] + chunk_len = BLOCKSIZE - len(self.buf) + self.buf += data[:chunk_len] + data = data[chunk_len:] if len(self.buf) == BLOCKSIZE: self._update_block(self.buf) self.buf = b""