LoRaMac-node
LoRaMac-node copied to clipboard
AES function rename due to multiple definitions linking error
Hello,
I would like to open a pull request to rename the aes_encrpyt() function found in src/peripherals/soft-se/aes.* files to something other than what it currently is, perhaps aes_encrypt_block() (aes_decrypt() would also potentially be renamed to aes_decrypt_block() as per this example, for consistency).
The reason for this request is a multiple definitions linking error occurring when including LmHandler.h in an application file when using an ESP32 board port. ESP-IDF has a function with the same name.
Thanks, Brandon
Hello, I agree with you, There is the same issue on a Zephyr project that is using loramac-node and the hal_espressif with wifi features enabled.
/******/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/subsys/lorawan/libloramac-node.a(aes.c.obj): in function `aes_encrypt':
/******/modules/lib/loramac-node/src/peripherals/soft-se/aes.c:569: multiple definition of `aes_encrypt'; zephyr/libzephyr.a(aes-internal-enc.c.obj):/******/modules/hal/espressif/components/wpa_supplicant/src/crypto/aes-internal-enc.c:120: first defined here