]> Cypherpunks.ru repositories - pygost.git/blobdiff - pygost/gost3413.py
Fix 34.13 OFB bug with len(IV) > 2
[pygost.git] / pygost / gost3413.py
index c0201c97ae8d2947aaf149494d444463c6c83a90..cdf82101203d919307b02f5db276dc4bb4800ddb 100644 (file)
@@ -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)