Support for memoryview in CBC/OFB/CFB mode

This commit is contained in:
Helder Eijs 2018-04-01 22:17:07 +02:00
parent 0914cc686d
commit 1a56f87afe
6 changed files with 167 additions and 25 deletions

View file

@ -133,4 +133,15 @@ else:
_memoryview = memoryview
def _copy_bytes(start, seq):
"""Return a copy of a sequence (byte string, byte array, memoryview)
starting from a certain index"""
if isinstance(seq, _memoryview):
return seq[start:].tobytes()
else:
return seq[start:]
del sys