[Security] Problems using SDK CSEC Driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[Security] Problems using SDK CSEC Driver

Jump to solution
209 Views
Gideon
Contributor III

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? ?

0 Kudos
1 Solution
100 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

You can find the manual here:
c:\NXP\S32DS.3.4\S32DS\software\S32SDK_S32K1XX_RTM_4.0.3\doc\S32SDK_S32K144_UserManual.pdf

No configuration is needed. If you have a project without FreeRTOS then baremetal version is selected automatically.

View solution in original post

0 Kudos
3 Replies
178 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Gideon 

there's implementation of OSIF for both FreeRTOS and baremetal configuration. So, there's no problem even if you don't use FreeRTOS. Take a look at section "OS Interface (OSIF)" in SDK user manual.

lukaszadrapa_0-1713559726522.png

I can't see a reason to do such changes. 

And if SDK is not used ever, it's better to use code from AN5401.

Regards,

Lukas

 

0 Kudos
140 Views
Gideon
Contributor III

Dear NXPs:

Q1:Where can I view the document you sent a screenshot of?

Q2:Could you provide me with a baremetal configuration S32K14x CSEC driver?

0 Kudos
101 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

You can find the manual here:
c:\NXP\S32DS.3.4\S32DS\software\S32SDK_S32K1XX_RTM_4.0.3\doc\S32SDK_S32K144_UserManual.pdf

No configuration is needed. If you have a project without FreeRTOS then baremetal version is selected automatically.

0 Kudos