micro-bitcoin / uBitcoin

Bitcoin library for microcontrollers. Supports Arduino, mbed, bare metal.
https://micro-bitcoin.github.io/
MIT License
166 stars 34 forks source link

Multiple definitions of function using ESP32 - hmac_sha256() #28

Open tomasz90 opened 1 year ago

tomasz90 commented 1 year ago

When I use your library in platformio using ESP32 I've got compilation error:

platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `hmac_sha256':
/Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:258: multiple definition of `hmac_sha256'; .pio/build/esp32dev/lib6d1/libuBitcoin.a(hmac.c.o):/Users/tomasz/CLionProjects/EthereumHDKeysGenerator/.pio/libdeps/esp32dev/uBitcoin/src/utility/trezor/hmac.c:67: first defined here
collect2: error: ld returned 1 exit status
*** [.pio/build/esp32dev/firmware.elf] Error 1

When I simply renamed function "hmac_sha256" in uBitcoin/src/utility/trezor/hmac.c to differnent name it works ok, but this is rather workaround. Please consider renaming it in your library or find different solution, thanks!