dmazzella / uaesgcm

AES GCM for Micropython
MIT License
2 stars 0 forks source link

Works on ESP32 #1

Closed gampam2000 closed 1 year ago

gampam2000 commented 1 year ago

Hi,

great work, it works on ESP32. I successfully ran your test on the ESP32:

>>> from _aesgcm import ciphers
>>> data = b"a secret message"
>>> 
>>> aad = b"\xDE\xAD\xBE\xEF"
>>> key = b'\xd1}\x9c"e\x0c\xe0\xafb\x1c\xf3J^\xd7\xa7y<\x17\xdd\xed`eD\x051\xae\xbb\xa2\x91\xfeD\xe1'
>>> nonce = b"7M\xb4xy\x01t\x88\xd8\xf3\x9e\xc0"
>>> aesgcm = ciphers.AESGCM(key)
>>> ct = aesgcm.encrypt(nonce, data, aad)
>>> print(ct)
b'\x81\xf2\x1d\x92\x8f*"4w\xe4\xfaF\x8bE6/\xae\x03.\x9b>\xa8\x12c\x17H1\x18\x06\x99e\xf0'
>>> dt = aesgcm.decrypt(nonce, ct, aad)
>>> print(dt)
b'a secret message'

To compile it for ESP32 I used this command: make -j2 -C ports/esp32/ MICROPY_PY_BTREE=0 MICROPY_SSL_MBEDTLS=1 USER_C_MODULES="$(pwd)/usercmodule/uaesgcm/micropython.cmake"

Maybe you can add this to the Readme.

Thanks & best regards

dmazzella commented 1 year ago

done, thank you for test it