# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2022 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2023 Sergey Matveev <stargrave@stargrave.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
"""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""