Dear NXPs:
SDK CSEC Driver
csec_driver.h
csec_driver.c
csec_hw_access.c
csec_hw_access.h
I transplanted the SDK CSEC Driver to the normal project (without free RTOS) for use. The chip objects are S32K142 and S32K146. I found that the SDK CSEC Driver only used the OS timer for timeout processing, so my solution was to delete the OS part of the CSEC Driver C file, which met my needs.
The interface I plan to use is:
void CSEC_DRV_Init(csec_state_t *state);
void CSEC_DRV_Deinit(void);
status_t CSEC_DRV_EncryptCBC(csec_key_id_t keyId,
const uint8_t *plainText, uint32_t length,
const uint8_t *iv, uint8_t *cipherText, uint32_t timeout);
status_t CSEC_DRV_DecryptCBC(csec_key_id_t keyId, const uint8_t *cipherText,
uint32_t length, const uint8_t* iv, uint8_t *plainText, uint32_t timeout);
status_t CSEC_DRV_GenerateMAC(csec_key_id_t keyId, const uint8_t *msg,
uint32_t msgLen, uint8_t *cmac, uint32_t timeout);
status_t CSEC_DRV_GenerateMACAddrMode(csec_key_id_t keyId,
const uint8_t *msg, uint32_t msgLen, uint8_t *cmac);
status_t CSEC_DRV_VerifyMAC(csec_key_id_t keyId, const uint8_t *msg,
uint32_t msgLen, const uint8_t *mac, uint16_t macLen, bool *verifStatus,
uint32_t timeout);
status_t CSEC_DRV_VerifyMACAddrMode(csec_key_id_t keyId, const uint8_t *msg,
uint32_t msgLen, const uint8_t *mac, uint16_t macLen, bool *verifStatus);
status_t CSEC_DRV_LoadKey(csec_key_id_t keyId, const uint8_t *m1,
const uint8_t *m2, const uint8_t *m3, uint8_t *m4, uint8_t *m5);
status_t CSEC_DRV_BootFailure(void);
status_t CSEC_DRV_BootOK(void);
status_t CSEC_DRV_BootDefine(uint32_t bootSize, csec_boot_flavor_t bootFlavor);
static inline csec_status_t CSEC_DRV_GetStatus(void);
status_t CSEC_DRV_MPCompress(const uint8_t *msg, uint16_t msgLen,
uint8_t *mpCompress, uint32_t timeout);
Q:What I want to inquire about is transplanting the SDK CSEC Driver to the Normal project (142/146, no OS). Are there any potential risks? ?