crypto/aes: prefix public AES API with nx_ to avoid symbol clashes#19428
crypto/aes: prefix public AES API with nx_ to avoid symbol clashes#19428FelipeMdeO wants to merge 1 commit into
Conversation
4471d86 to
88ae86a
Compare
| } | ||
|
|
||
| void aes_encrypt(FAR AES_CTX *ctx, FAR const uint8_t *src, FAR uint8_t *dst) | ||
| void nx_aes_encrypt(FAR AES_CTX *ctx, FAR const uint8_t *src, |
There was a problem hiding this comment.
but do you need add nx_ to all software crypto function
There was a problem hiding this comment.
Hello @xiaoxiang781216, Perhaps I misunderstood your comment. what do you mean with "add nx_ to all software crypto function"
There was a problem hiding this comment.
Hello @xiaoxiang781216, Perhaps I misunderstood your comment. what do you mean with "add nx_ to all software crypto function"
Yes, at least. BTW, why not change third party library?
There was a problem hiding this comment.
I tried, but I haven’t received any updates from them for a while, so I decided to try to solve it here.
There was a problem hiding this comment.
Add nx_ to all software crypto isn't good idea, it is a big change...
There was a problem hiding this comment.
yes, that's why I prefer fixing the 3rd party library instead
09c16a9 to
b15d4ab
Compare
The NuttX software AES aes_encrypt()/aes_decrypt() symbols collide at link time with the identically named symbols exported by third-party crypto libraries built into the arch tree, e.g. the Espressif esp-hal wpa_supplicant mbedTLS wrapper. When a board enables both the NuttX software crypto backend (CRYPTO_SW_AES) and such a library, the link fails with a multiple definition of aes_encrypt/aes_decrypt. Rename only the two clashing functions to nx_aes_encrypt/nx_aes_decrypt and update their in-tree callers under crypto/. The rest of the crypto/aes.h API is left unchanged. Signed-off-by: Felipe Moura <moura.fmo@gmail.com> Assisted-by: Claude Sonnet <noreply@anthropic.com>
b15d4ab to
c82ae07
Compare
Summary
Prefix the public AES API in
crypto/aes.h(aes_setkey,aes_encrypt,aes_decrypt, their_ecbvariants andaes_keysetup_*) withnx_, andupdate the in-tree callers under
crypto/.The unprefixed
aes_encrypt/aes_decryptsymbols exported by the NuttXsoftware AES (
CRYPTO_SW_AES) collide at link time with identically namedsymbols from third-party crypto libraries built into the arch tree (e.g. the
Espressif esp-hal wpa_supplicant mbedTLS wrapper). The
nx_prefix gives theNuttX implementation its own namespace.
Impact
API rename only; no behavior change. Any out-of-tree user of
crypto/aes.hmust adopt the
nx_names.Testing
Built
sim:nsh(withCRYPTO_SW_AES).