mirror of
https://github.com/Legrandin/pycryptodome.git
synced 2025-12-08 05:19:46 +00:00
Support for memoryview in CBC/OFB/CFB mode
This commit is contained in:
parent
0914cc686d
commit
1a56f87afe
6 changed files with 167 additions and 25 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue