Hi!
Were are looking to use it for CMAC and AES which should be supported by the CC310 according to https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fcryptocell.html
Directly use of the KMU for AES is supported through mbedtls_aes_setkey_enc_shadow_key(..).
But you can't do much more that that.
I'm aware this is supported through the psa_crypto
APIs, but it does come with some pretty heavy downsides imo.
With PSA crypto:
We are importing a key that should be static throughout the life-time of the device:
- Importing keys with
PSA_KEY_PERSISTENCE_READ_ONLY
returns aNOT_SUPPORTED
- Importing with
PSA_KEY_LIFETIME_PERSISTENT
works but keys can be destroyed. - Unless you get the config just right it just throws an error.
- TF-M can't be pinned to a minimal config.
While psa_crypto
is awesome in many cases I think that some use-cases calls for different crypto APIs.
- Importing keys requires an ITS partition. I.e. 32kB is currently wasted to store 64bytes worth of keys.
- Persistent keys cannot be used with the KMU. Or at least they aren't stored in the KMU it seems. Why not just use the KMU as it is designed for this purpose?
- From this post: https://devzone.nordicsemi.com/f/nordic-q-a/100616/using-psa-function-to-persist-key-in-kmu-and-later-restore-it-for-aes-encryption it was highlighted that CONFIG_TFM_ITS_ENCRYPTED=y
was needed to store the keys encrypted.
In general:
- Any chance that more extended CC3XX drivers will be published? With support for more direct cryptographic operations?
If no to above:
- Is
CONFIG_TFM_ITS_ENCRYPTED=y
still needed? - Can PSA Crypto be configured to store
PSA_KEY_PERSISTENCE_READ_ONLY
in the KMU so we can omit the ITS partition? - Can we set keys with
nrf_cc3xx_platform_kmu_write_key(...)
and reference them later w. psa_crypto APIs? - Can the storage backend for
psa_import_key(...)
be customized?