summaryrefslogtreecommitdiff
path: root/pygost/gost3413.py
diff options
context:
space:
mode:
authorSergey Matveev <stargrave@stargrave.org>2017-12-24 13:18:28 +0300
committerSergey Matveev <stargrave@stargrave.org>2018-12-09 13:00:17 +0300
commit22d0a1d34cbf1466e01b59a8567af36cf315f328 (patch)
tree5ae346b4ebd475e3ff7c87dc7438cd991d429372 /pygost/gost3413.py
parent8041023f83244e7bc19c9bb02ae8ba83ffdf654b (diff)
downloadpygost-22d0a1d34cbf1466e01b59a8567af36cf315f328.tar.xz
Fix 34.13 OFB bug with len(IV) > 2
Diffstat (limited to 'pygost/gost3413.py')
-rw-r--r--pygost/gost3413.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygost/gost3413.py b/pygost/gost3413.py
index c0201c9..cdf8210 100644
--- a/pygost/gost3413.py
+++ b/pygost/gost3413.py
@@ -138,7 +138,7 @@ def ofb(encrypter, bs, data, iv):
result = []
for i in xrange(0, len(data) + pad_size(len(data), bs), bs):
r = r[1:] + [encrypter(r[0])]
- result.append(strxor(r[1], data[i:i + bs]))
+ result.append(strxor(r[-1], data[i:i + bs]))
return b"".join(result)