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

@ -26,7 +26,7 @@ Counter Feedback (CFB) mode.
__all__ = ['CfbMode']
from Crypto.Util.py3compat import bstr
from Crypto.Util.py3compat import _copy_bytes
from Crypto.Util._raw_api import (load_pycryptodome_raw_lib, VoidPointer,
create_string_buffer, get_raw_buffer,
SmartPointer, c_size_t, c_uint8_ptr)
@ -111,7 +111,7 @@ class CfbMode(object):
self.block_size = len(iv)
"""The block size of the underlying cipher, in bytes."""
self.iv = bstr(iv)
self.iv = _copy_bytes(0, iv)
"""The Initialization Vector originally used to create the object.
The value does not change."""