summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/cryptolib_aes128_ecb_into.py
blob: f90dfcf272703684e0d6474cbb2df11c10997bea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Operations with pre-allocated output buffer
try:
    from cryptolib import aes
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)