Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

RSA implement on MCU ?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RSA implement on MCU ?

by water35 on Thu Aug 13, 2020 5:55 pm

In adafruit-circuitpython-bundle has adafruit_rsa library and examples, but it looks like run on pure python only,
Can I run it on MCU (e.g. STM32 or SAMD series) ?

https://github.com/adafruit/Adafruit_CircuitPython_RSA

water35
 
Posts: 22
Joined: Sun Mar 17, 2019 7:12 am

Re: RSA implement on MCU ?

by siddacious on Fri Aug 28, 2020 2:35 pm

If it's a circuit python library, it's primary use case is to run on MCUs, so yea :)

This library is adapted from pure python to be compatible with CircuitPython so you shouldn't have any issues running it on a M4 board like the Feather STM32F405 or Metro M4 Express (or others)

siddacious
 
Posts: 297
Joined: Fri Apr 21, 2017 3:09 pm

Re: RSA implement on MCU ?

by water35 on Sat Aug 29, 2020 3:45 pm

I test it on STM32F405RG , out of memory,
Code: Select all | TOGGLE FULL SIZE
import adafruit_rsa

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/adafruit_rsa/__init__.py", line 27, in <module>
File "/lib/adafruit_rsa/pkcs1.py", line 31, in <module>
File "/lib/adafruit_hashlib/__init__.py", line 45, in <module>
MemoryError: memory allocation failed, allocating 2933 bytes

water35
 
Posts: 22
Joined: Sun Mar 17, 2019 7:12 am

Re: RSA implement on MCU ?

by jerryn on Sat Aug 29, 2020 4:26 pm

See my response here https://github.com/adafruit/Adafruit_CircuitPython_RSA/issues/15. It worked for me if I used the .mpy Precompiled libraries.

jerryn
 
Posts: 1291
Joined: Sat Sep 14, 2013 9:05 am

Re: RSA implement on MCU ?

by water35 on Sat Aug 29, 2020 7:36 pm

Thanks, it works, the .mpy file more efficient than .py file!

Decrypt looks like very slow, is it possible use hardware RSA accelerator (e.g. ESP32-S2)?

water35
 
Posts: 22
Joined: Sun Mar 17, 2019 7:12 am

Re: RSA implement on MCU ?

by tannewt on Mon Aug 31, 2020 4:12 pm

water35 wrote:Decrypt looks like very slow, is it possible use hardware RSA accelerator (e.g. ESP32-S2)?


Not yet. Feel free to file an issue here: https://github.com/adafruit/circuitpyth ... %3Aesp32s2

tannewt
 
Posts: 1781
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.