dmazzella / ucrypto

Micropython package for doing fast rsa and elliptic curve cryptography, specifically digital signatures
31 stars 11 forks source link

[ESP32] Compiling for Micropython #2

Closed TGiles1998 closed 2 years ago

TGiles1998 commented 2 years ago

Hi,

Do you have to change the make file to a cmake file in order for this to compile?

-- Adding linker script /Users/thomasgiles/esp-VS/micropython-3/esp-idf/components/soc/esp32s3/ld/esp32s3.peripherals.ld Including User C Module(s) from /Users/thomasgiles/esp-VS/micropython-3/ports/esp32/boards/GENERIC_S3_SPIRAM/ucrypto CMake Error at /Users/thomasgiles/esp-VS/micropython-3/py/usermod.cmake:42 (include): include requested file is a directory:

/Users/thomasgiles/esp-VS/micropython-3/ports/esp32/boards/GENERIC_S3_SPIRAM/ucrypto

Call Stack (most recent call first): main/CMakeLists.txt:10 (include)

Many thanks,

Thomas

TGiles1998 commented 2 years ago

Command used:

make -C ports/esp32/ BOARD="GENERIC_S3_SPIRAM" USER_C_MODULES="/Users/thomasgiles/esp-VS/micropython-3/ports/esp32/boards/GENERIC_S3_SPIRAM/ucrypto"

dmazzella commented 2 years ago

I havn't a esp32 for test it and time to try it.

But any PR are welcome!

TGiles1998 commented 2 years ago

@dmazzella Thank you, can u provide a skeleton example for a cmake file? Im happy to do the rest and then open a pull request. I'm just not sure how to add a correct cmake file. Many thanks!

dmazzella commented 2 years ago

Look at usqlite

TGiles1998 commented 2 years ago

Hi,

Does this seem reasonable?

Many thanks,

Thomas

add_library(usermod_ufastecdsa INTERFACE)

target_sources(usermod_ufastecdsa INTERFACE ${CMAKE_CURRENT_LIST_DIR}/moducrypto.c )

target_include_directories(usermod_ufastecdsa INTERFACE ${CMAKE_CURRENT_LIST_DIR} )

target_link_libraries(usermod INTERFACE usermod_ufastecdsa)

dmazzella commented 2 years ago

try with last push

dmazzella commented 2 years ago

Please give me feedback on this, I have only tested the build.

MATTYGILO commented 2 years ago

Going to start documenting errors from build:

if isinstance(h1, hashlib.md5):
    hash_size = 16

hashlib.md5 is not a thing

util.py line 69

MATTYGILO commented 2 years ago

Also in the case of hmac.py line 51 and line 65

MATTYGILO commented 2 years ago

ERROR A stack overflow in task mp_task has been detected. When running fast_ecdsa1.py

MATTYGILO commented 2 years ago

@dmazzella Are there any other ecc repos for MicroPython out there?

dmazzella commented 2 years ago

@dmazzella Are there any other ecc repos for MicroPython out there?

I don't know any others

MATTYGILO commented 2 years ago

@dmazzella Are there any other ecc repos for MicroPython out there?

I don't know any others

Ok no worries I'm gonna try and work through it and get a working version.

dmazzella commented 2 years ago

Ok no worries I'm gonna try and work through it and get a working version.

thank you, without hardware it is difficult for me to test porting to a new platform.

TGiles1998 commented 2 years ago

Hi @dmazzella

Unfortunately I could not get this to work, the python in this repo also needs altering.

Thanks

Thomas

dmazzella commented 2 years ago

Hi @dmazzella

Unfortunately I could not get this to work, the python in this repo also needs altering.

Thanks

Thomas

native part work for you?

dmazzella commented 2 years ago

I am closing this for now, in case of future updates, please feel free to reopen it.