2018-01-07 13:15:05 +00:00
|
|
|
# Operations with pre-allocated output buffer
|
|
|
|
try:
|
2022-08-18 07:57:45 +01:00
|
|
|
from cryptolib import aes
|
2018-01-07 13:15:05 +00:00
|
|
|
except ImportError:
|
|
|
|
print("SKIP")
|
|
|
|
raise SystemExit
|
|
|
|
|
|
|
|
crypto = aes(b"1234" * 4, 1)
|
|
|
|
enc = bytearray(32)
|
|
|
|
crypto.encrypt(bytes(range(32)), enc)
|
|
|
|
print(enc)
|
|
|
|
|
|
|
|
crypto = aes(b"1234" * 4, 1)
|
|
|
|
dec = bytearray(32)
|
|
|
|
crypto.decrypt(enc, dec)
|
|
|
|
print(dec)
|