MbedTLS3 and CAAM driver for Non-PSA operations

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MbedTLS3 and CAAM driver for Non-PSA operations

1,538件の閲覧回数
jslota13245
Contributor III

Dear Everyone,

We followed the deprecation note about the mbedTLS 2 and we did an update to mbedTLS3. We found out that NXP has two repositories of mbedTLS.

(ver 2.x deprecated)
https://github.com/nxp-mcuxpresso/mbedtls

(ver 3.x)
https://github.com/NXP/nxp_mbedtls

We found it by reading through the yaml file which sdk uses - we're wondering if we'll lose performance if we choose ver 3x and won't use PSA API?

Version 2 provided a set of alternate functions through port/ksdk which could be used to delegate cryptographic operations to CAAM driver like ksdk_mbedtls:

https://github.com/nxp-mcuxpresso/mbedtls/blob/release/25.06.00/port/ksdk/ksdk_mbedtls.c

We use raw CAAM driver through fsl_caam for aes256 encryption and we would like to use mbedtls to generate a pair of ecdsa keys. Our goal is to have mbedTLS3 and delegate all possible jobs to CAAM hardware - if anyone knows an application note/port done or a guideline on how to design such it would be great.

Thank you for any support

タグ(2)
0 件の賞賛
返信
2 返答(返信)

1,477件の閲覧回数
jslota13245
Contributor III

Also minor info, we're using imxrt1176 and have a FreeRTOS on it, do we read the port right that the mbedtls_ksdk.c:
672 - 674

https://github.com/nxp-mcuxpresso/mbedtls/blob/release/25.06.00/port/ksdk/ksdk_mbedtls.c


#endif /* MBEDTLS_THREADING_C */
if (ctx->mode == MBEDTLS_DES_ENCRYPT) {
status = CAAM_DES_EncryptEcb(CAAM_INSTANCE, &s_caamHandle, input, output, 8, key);

Does this port use blocking operations? So that the other FreeRTOS Threads are blocked - we found this port to be used in freertos examples of mbedtls so it was a surprise for us

0 件の賞賛
返信

1,292件の閲覧回数
Sam_Gao
NXP Employee
NXP Employee

Hi,

It seems there are mbedtls and mebedtls 3.x in the SDK as following, and CAAM(Cryptographic Acceleration and Assurance Module) example as well. 

https://mcuxpresso.nxp.com/mcuxsdk/latest/html/examples/driver_examples/caam/readme.html 

https://mcuxpresso.nxp.com/mcuxsdk/latest/html/examples/mbedtls3x_examples/index.html 

https://mcuxpresso.nxp.com/mcuxsdk/latest/html/examples/mbedtls_examples/index.html 

 

Yes, it is a blocking operation.

0 件の賞賛
返信
%3CLINGO-SUB%20id%3D%22lingo-sub-2290143%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E9%9D%9EPSA%E6%93%8D%E4%BD%9C%E7%94%A8%E3%81%AEMbedTLS3%E3%81%8A%E3%82%88%E3%81%B3CAAM%E3%83%89%E3%83%A9%E3%82%A4%E3%83%90%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2290143%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E7%9A%86%E6%A7%98%E3%81%B8%3C%2FP%3E%3CP%3EmbedTLS%202%20%E3%81%AE%E5%BB%83%E6%AD%A2%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A0%85%E3%81%AB%E5%BE%93%E3%81%84%E3%80%81mbedTLS3%20%E3%81%AB%E3%82%A2%E3%83%83%E3%83%97%E3%83%87%E3%83%BC%E3%83%88%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82NXP%20%E3%81%AB%E3%81%AF%20mbedTLS%20%E3%81%AE%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%8C%202%20%E3%81%A4%E3%81%82%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%82%8F%E3%81%8B%E3%82%8A%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3E(%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%202.x%20%E3%81%AF%E9%9D%9E%E6%8E%A8%E5%A5%A8)%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmbedtls%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmbedtls%3C%2FA%3E%3C%2FP%3E%3CP%3E%EF%BC%88%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B33.x%EF%BC%89%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FNXP%2Fnxp_mbedtls%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FNXP%2Fnxp_mbedtls%3C%2FA%3E%3C%2FP%3E%3CP%3ESDK%20%E3%81%8C%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%20yaml%20%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E8%AA%AD%E3%82%93%E3%81%A7%E3%80%81%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%203x%20%E3%82%92%E9%81%B8%E6%8A%9E%E3%81%97%E3%81%A6%20PSA%20API%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%AA%E3%81%84%E3%81%A8%E3%83%91%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%B3%E3%82%B9%E3%81%8C%E4%BD%8E%E4%B8%8B%E3%81%99%E3%82%8B%E3%81%AE%E3%81%A7%E3%81%AF%E3%81%AA%E3%81%84%E3%81%8B%E3%81%A8%E3%81%84%E3%81%86%E7%96%91%E5%95%8F%E3%81%8C%E7%94%9F%E3%81%98%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3E%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%202%20%E3%81%A7%E3%81%AF%E3%80%81port%2Fksdk%20%E3%82%92%E9%80%9A%E3%81%98%E3%81%A6%E4%B8%80%E9%80%A3%E3%81%AE%E4%BB%A3%E6%9B%BF%E9%96%A2%E6%95%B0%E3%81%8C%E6%8F%90%E4%BE%9B%E3%81%95%E3%82%8C%E3%80%81%E3%81%93%E3%82%8C%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%80%81ksdk_mbedtls%20%E3%81%AA%E3%81%A9%E3%81%AE%20CAAM%20%E3%83%89%E3%83%A9%E3%82%A4%E3%83%90%E3%81%AB%E6%9A%97%E5%8F%B7%E5%8C%96%E6%93%8D%E4%BD%9C%E3%82%92%E5%A7%94%E4%BB%BB%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmbedtls%2Fblob%2Frelease%2F25.06.00%2Fport%2Fksdk%2Fksdk_mbedtls.c%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmbedtls%2Fblob%2Frelease%2F25.06.00%2Fport%2Fksdk%2Fksdk_mbedtls.c%3C%2FA%3E%3C%2FP%3E%3CP%3EAES256%E6%9A%97%E5%8F%B7%E5%8C%96%E3%81%AB%E3%81%AFfsl_caam%E7%B5%8C%E7%94%B1%E3%81%A7%E7%94%9F%E3%81%AECAAM%E3%83%89%E3%83%A9%E3%82%A4%E3%83%90%E3%83%BC%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%8A%E3%82%8A%E3%80%81mbedtls%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6ecdsa%E9%8D%B5%E3%83%9A%E3%82%A2%E3%82%92%E7%94%9F%E6%88%90%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E8%80%83%E3%81%88%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3CSTRONG%3E%E7%9B%AE%E6%A8%99%E3%81%AFmbedTLS3%E3%82%92%E5%B0%8E%E5%85%A5%E3%81%97%E3%80%81%E3%81%82%E3%82%89%E3%82%86%E3%82%8B%E3%82%B8%E3%83%A7%E3%83%96%E3%82%92CAAM%E3%83%8F%E3%83%BC%E3%83%89%E3%82%A6%E3%82%A7%E3%82%A2%E3%81%AB%E5%A7%94%E8%AD%B2%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%A7%E3%81%99%3C%2FSTRONG%3E%E3%80%82%E3%82%82%E3%81%97%E3%80%81%E3%81%9D%E3%81%AE%E3%82%88%E3%81%86%E3%81%AA%E8%A8%AD%E8%A8%88%E6%96%B9%E6%B3%95%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%8E%E3%83%BC%E3%83%88%E3%82%84%E7%A7%BB%E6%A4%8D%E7%89%88%E3%80%81%E3%82%AC%E3%82%A4%E3%83%89%E3%83%A9%E3%82%A4%E3%83%B3%E3%82%92%E3%81%94%E5%AD%98%E7%9F%A5%E3%81%AE%E6%96%B9%E3%81%8C%E3%81%84%E3%82%89%E3%81%A3%E3%81%97%E3%82%83%E3%81%84%E3%81%BE%E3%81%97%E3%81%9F%E3%82%89%E3%80%81%E3%81%9C%E3%81%B2%E6%95%99%E3%81%88%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3C%2FP%3E%3CP%3E%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%99%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2290860%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MbedTLS3%20and%20CAAM%20driver%20for%20Non-PSA%20operations%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2290860%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E3%81%BE%E3%81%9F%E3%80%81%E3%81%A1%E3%82%87%E3%81%A3%E3%81%A8%E3%81%97%E3%81%9F%E6%83%85%E5%A0%B1%E3%81%A7%E3%81%99%E3%81%8C%E3%80%81imxrt1176%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%8A%E3%82%8A%E3%80%81FreeRTOS%20%E3%81%8C%E6%90%AD%E8%BC%89%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82mbedtls_ksdk.c%20%E3%81%AE%E3%83%9D%E3%83%BC%E3%83%88%E3%82%92%E6%AD%A3%E3%81%97%E3%81%8F%E8%AA%AD%E3%81%BF%E5%8F%96%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%3F%3CBR%20%2F%3E672%20-%20674%3CBR%20%2F%3E%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmbedtls%2Fblob%2Frelease%2F25.06.00%2Fport%2Fksdk%2Fksdk_mbedtls.c%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmbedtls%2Fblob%2Frelease%2F25.06.00%2Fport%2Fksdk%2Fksdk_mbedtls.c%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%23endif%20%2F*%20MBEDTLS_THREADING_C%20*%2F%3CBR%20%2F%3E%20(ctx-%26gt%3Bmode%20%3D%3D%20MBEDTLS_DES_ENCRYPT)%20%E3%81%AE%E5%A0%B4%E5%90%88%20%7B%3CBR%20%2F%3E%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9%20%3D%20CAAM_DES_EncryptEcb(CAAM_INSTANCE%E3%80%81%26amp%3Bs_caamHandle%E3%80%81%E5%85%A5%E5%8A%9B%E3%80%81%E5%87%BA%E5%8A%9B%E3%80%818%E3%80%81%E3%82%AD%E3%83%BC)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%E3%81%93%E3%81%AE%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AF%E3%83%96%E3%83%AD%E3%83%83%E3%82%AD%E3%83%B3%E3%82%B0%E6%93%8D%E4%BD%9C%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%BE%E3%81%99%E3%81%8B%3F%E4%BB%96%E3%81%AEFreeRTOS%E3%82%B9%E3%83%AC%E3%83%83%E3%83%89%E3%81%8C%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF%E3%81%95%E3%82%8C%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%20-%20%E3%81%93%E3%81%AE%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AFmbedtls%E3%81%AEfreertos%E3%81%AE%E4%BE%8B%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%82%8F%E3%81%8B%E3%81%A3%E3%81%9F%E3%81%AE%E3%81%A7%E3%80%81%E7%A7%81%E3%81%9F%E3%81%A1%E3%81%AB%E3%81%A8%E3%81%A3%E3%81%A6%E3%81%AF%E9%A9%9A%E3%81%8D%E3%81%A7%E3%81%97%E3%81%9F%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2293190%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MbedTLS3%20and%20CAAM%20driver%20for%20Non-PSA%20operations%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2293190%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%3C%2FP%3E%0A%3CP%3ESDK%20%E3%81%AB%E3%81%AF%E3%80%81%E6%AC%A1%E3%81%AE%20mbedtls%20%E3%81%A8%20mebedtls%203.x%20%E3%81%8C%E3%81%82%E3%82%8A%E3%80%81CAAM%20(%20%3CSPAN%3ECryptographic%20Acceleration%20and%20Assurance%20Module%3C%2FSPAN%3E%20)%20%E3%81%AE%E4%BE%8B%E3%82%82%E3%81%82%E3%82%8B%E3%82%88%E3%81%86%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fexamples%2Fdriver_examples%2Fcaam%2Freadme.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fexamples%2Fdriver_examples%2Fcaam%2Freadme.html%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fexamples%2Fmbedtls3x_examples%2Findex.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fexamples%2Fmbedtls3x_examples%2Findex.html%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fexamples%2Fmbedtls_examples%2Findex.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fexamples%2Fmbedtls_examples%2Findex.html%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E3%81%AF%E3%81%84%E3%80%81%3CSPAN%3E%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF%E6%93%8D%E4%BD%9C%E3%81%A7%E3%81%99%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E