aboutsummaryrefslogtreecommitdiff
path: root/tests/extmod/ucryptolib_aes128_ecb_inpl.py
blob: 88ccb02daf2655cd8517777b2057ec082dbe8662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Inplace operations (input and output buffer is the same)
try:
    from ucryptolib 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)