-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mbed TLS cannot be built with AES-XTS support #2254
Comments
Sorry, I can't explain your problem. I modified one of the examples to call mbedtls_aes_xts_init and it worked as expected, no linker errors. Try building with VERBOSE=1 and see how aes.c is being built |
Well the line itself where the compiler is called is 8 KB in length, but i can see And in the specific submodule commit/branch of Mbed TLS used by pico-sdk, I can see the following in #if defined(MBEDTLS_CIPHER_MODE_XTS)
void mbedtls_aes_xts_init(mbedtls_aes_xts_context *ctx)
{
AES_VALIDATE(ctx != NULL);
mbedtls_aes_init(&ctx->crypt);
mbedtls_aes_init(&ctx->tweak);
} So I myself can't see why this isn't working, I guess I'll have to investigate deeper into how exactly the binary is being linked to find the issue. |
For the building of
The compiler is invoked as arm-none-eabi-gcc [...] -DMBEDTLS_CIPHER_MODE_XTS=1 [...] -o CMakeFiles/path/to/pico-sdk/lib/mbedtls/library/aes.c.o -c /path/to/pico-sdk/lib/mbedtls/library/aes.c And the As for the linking of the main ELF binary, the path to |
Ah, I got it working, sorry for the annoyance, just define |
I'm trying to use the built-in
pico_mbedtls
library to use Mbed TLS to encrypt data using AES-XTS.However, no matter what I try, the result remains same: no error when compiling my code, but an error at linking because it cannot find the XTS-related symbols.
I have tried adding the
MBEDTLS_CIPHER_MODE_XTS=1
define in every possible way: intoCMAKE_C_FLAGS
, insidembedtls_config.h
, withadd_compile_definitions(...)
and bothtarget_compile_definitions(pico_mbedtls_crypto INTERFACE ...)
andtarget_compile_definitions(pico_mbedtls INTERFACE ...)
.(yes, I am importing
bench.c
directly fromkmain.c
without using a header file as this is a temporary test that will get removed afterwards)The relevant parts of my
CMakeLists.txt
are the following (with the project name replaced with ProjectNameHere):Is there something wrong in my end, or is this a shortcoming of the SDK's design?
Thanks in advance,
Ainara Garcia
The text was updated successfully, but these errors were encountered: