After setting crypto through S32DS and copying the Crypto_SymmetricPrimitives_S32K312 source code for testing, it was found that Crypto_KeyElementSet returns an error on the second setting. How can this issue be resolved? However, there is no such problem when using the demo routine.
Hi @ygrssm
Do you mean that the same key is imported again? There's a difference if a key is imported first time and then updated second time. If a key slot is empty, key encryption and authentication is optional. If a key slot is not empty, authentication is mandatory and encryption is optional based on user rights. You can take a look at Table 47 and 48 in HSE firmware reference manual v2.5. Also the key counter needs to be increased.
It is rather complicated operation, so the recommendation is to erase such key if possible and then import new key to empty slot.
Regards,
Lukas
Thank you for your reply. but,What is the full name of the HSE firmware reference manual? Is it S32K3X2_HSE_Service_API_Reference_Manual.pdf?
It can be downloaded from https://www.nxp.com/products/S32K3
Documentation -> Secure files
Search for "RM00286 HSE-B Firmware Reference Manual - V2.5"
Regards,
Lukas