4 Commits

Author SHA1 Message Date
Jukka Laitinen
dcde0d0559 src/drivers/sw_crypto: Late initialize tomcypt
This saves a lot of flash space, in case functions from libtomcrypt
are not used (currently only RSA related).

When RSA is not used, the linker can now drop all libtomcrypt related things.
This is especially relevant for bootloaders using the SW crypto.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-09 10:28:06 -05:00
Jukka Laitinen
79aa8ee587 src/drivers/sw_crypto: Fix a function call argument type mismatch
Fix one function call argument from unsigned -> size_t

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-12-01 09:28:02 -05:00
Jukka Laitinen
9c94e4c5ef crypto: define XMALLOC & XFREE for sw_crypto
Use the same memory allocation in sw_crypto driver as what is used in
src/lib/crypto libraries

In addition, in nuttx protected build, allocate all memory from kernel heap

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-12-01 09:28:02 -05:00
Jukka Laitinen
929820136a Move sw_crypto and stub_keystore under src/drivers
This is more logical place for the "backend" implementation than
directly under platform.

This also allows making other implementations as "real" drivers, as well as proper configuration via Kconfigs

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-29 11:09:51 -05:00