2025-08-05 5:15 AM
Hi guys i am trying to use stm32cryptolib library's encryption function. the main problem i am facing when i am trying to call the cmox_initialize function it is giving the error
cmox_init.c:(.text+0x1a): undefined reference to `cmox_ll_init'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:64: crypto.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.
but it is strange although i have included the include file to path under which it's .h comes.
The other err which i am facing that is this function written below is not returning CMOX_HASH_SUCCESS
cmox_mac_retval_t ret_val = cmox_mac_compute(
CMOX_HMAC_SHA256_ALGO, // Algorithm
message, sizeof(message)-1, // Message and its length
(const uint8_t *)key, strlen(key), // Key and its length
NULL, 0, // No custom data
hmac_bin, sizeof(hmac_bin), // Output tag and expected size
&tag_len // Output tag length pointer
);
2025-08-12 8:56 AM
Any solution suggestions? We are facing the same issue.
2025-08-12 9:30 AM
Include files typically don't pull in code, they define the interface expectations. It's not complaining it can't find the include file.. The linker is complaining it can't find the function in the object files it's been passed.
So missing the source file, or library file, containing the actual code for the function. So add that into the project build tree.
2025-08-12 9:31 AM
2025-08-12 9:37 AM - edited 2025-08-12 9:37 AM
Hello @SwastiK
Which STM32CubeIDE and package versions are you using ? Please make sure to use the latest release.
Check the include paths and make sure that you have added all required CMOX library files.
This article may help you to integrate the CRYPTOLIB library in STM32CubeIDE: How to add external libraries in STM32CubeIDE.
2025-08-12 10:11 PM
Hi
We have been able to get the library running with the new version of the IDE. However, bumping into a new issue now. The HMAC SHA256 signature that is being generated by the library is not matching with the ones that we are checking online. We have tried generating the signature with the same string and key on different platforms available on the internet, and the signatures all match. However the one being generated using the library.
I have attached the code snippet for reference
Received Output : aee0ab2b6302b529b7873bac798718f3a17bce27a0c0906b3e299942b9262bff
Required Output : b2793ffb929310a28134164a5ef650bdeb422fb34233f493fe323a60fbede10c