4216bc7d13
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
16 lines
319 B
Python
16 lines
319 B
Python
# Inplace operations (input and output buffer is the same)
|
|
try:
|
|
from cryptolib import aes
|
|
except ImportError:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
crypto = aes(b"1234" * 4, 1)
|
|
buf = bytearray(bytes(range(32)))
|
|
crypto.encrypt(buf, buf)
|
|
print(buf)
|
|
|
|
crypto = aes(b"1234" * 4, 1)
|
|
crypto.decrypt(buf, buf)
|
|
print(buf)
|