imx-ele-apps/aes_usage test with 50MB file fails

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

imx-ele-apps/aes_usage test with 50MB file fails

283 次查看
HH_Mov
Contributor III

As a test of the HSM on the i.MX93 the aes_usage test was ran with a 50MB file being en/decrypted.

However running the decryption on target resulted in:

./ele_aes_usage decrypt CTR /tmp/dummy-file.enc /tmp/dummy-file 0x3FFFFFFF > /dev/null
[ 1179.264527] fsl-se-fw se-fw2: hsm1_ch0: Not enough space in shared memory
[ 1179.271346] fsl-se-fw se-fw2: hsm1_ch0: Not enough space in shared memory
cipher_with_ele_cipher failed ret:0xff

(Encrypting a file resulted in the same issue)

For info: The reserved space for ele is 1MB

hexdump -C /proc/device-tree/reserved-memory/ele-reserved\@a4120000/reg
00000000  00 00 00 00 a4 12 00 00  00 00 00 00 00 10 00 00  |................|
00000010

 

Is this a configuration issue, or should the decryption of a large file be handled differently ?

0 项奖励
回复
3 回复数

244 次查看
HH_Mov
Contributor III

Additional info:

The aes_usage app allocates output buffer space based on the size of the input.
Using a file of 125MB and more than 650MB of free RAM, this should not be an issue.

0 项奖励
回复

223 次查看
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @HH_Mov 

I hope you are doing very well.

 

Kindly share your BSP version. 

Are you using a pre-compiled image? or did you compile your own (if so, please share the steps you followed)?

 

Best regards,

Salas.

0 项奖励
回复

172 次查看
HH_Mov
Contributor III

Hello Salas,

It is a custom yocto ScarthGap build, based on the karo and imx layers.

Running "ELE firmware version 2.0.0-64d8ef47" and Linux 6.6.52

The aes_usage app is obtained from: https://github.com/nxp-imx-support/imx_sec_apps.git: Branch master

With a few adaptations to make it run (e.g. nvm_daemon is started via init scripts in our case), and build using the sdk generated by our yocto build.

Did a small test using a file containing a short text string ("Alle appels zijn oranje"), encrypted on host and imported the aes key from the key_import example on target (0x3FFFFFFF).

./ele_aes_usage decrypt CBC another-cipher.txt another-secret-message.txt 0x3FFFFFFF


The result was: 

Alle appels zijn oranje;m^▒▒▒F▒▒▒}▒ϸ▒▒



Then tested using a 50MB binary (encrypted on host).

./ele_aes_usage decrypt CTR /tmp/binary.bin.enc /tmp/binary.bin 0x3FFFFFFF > /dev/null
[ 1179.264527] fsl-se-fw se-fw2: hsm1_ch0: Not enough space in shared memory
[ 1179.271346] fsl-se-fw se-fw2: hsm1_ch0: Not enough space in shared memory
cipher_with_ele_cipher failed ret:0xff



Then tested encrypting the binary.bin on target (to rule out something wrong with the encryption on host)

 

./ele_aes_usage encrypt CTR /tmp/binary.bin /tmp/binary.bin.enc 0x3FFFFFFF
Hello, World! Oct 13 2025:06:28:33 b83e779
message preview:
hsqs

SAB Error: SAB C[ 1573.976753] fsl-se-fw se-fw2: hsm1_ch0: Not enough space in shared memory
MD [0x30] Resp [[ 1573.983856] fsl-se-fw se-fw2: hsm1_ch0: Not enough space in shared memory
0xf29] - The key store is already opened by a user (load operation).

Key store already created, trying to load it...

SAB Error: SAB CMD [0x62] Resp [0x29] - General Error.

hsm cipher failed, ret: 0xff
cipher_with_ele_cipher failed ret:0xff



Best Regards,

Hugo


0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2183889%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%B8%A6%E6%9C%89%2050MB%20%E6%96%87%E4%BB%B6%E7%9A%84%20imx-ele-apps%2Faes_usage%20%E6%B5%8B%E8%AF%95%E5%A4%B1%E8%B4%A5%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2183889%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%AF%B9%20i.MX93%20%E7%9A%84%20HSM%20%E8%BF%9B%E8%A1%8C%E4%BA%86%20aes_usage%20%E6%B5%8B%E8%AF%95%EF%BC%8C%E5%AF%B9%2050MB%20%E7%9A%84%E6%96%87%E4%BB%B6%E8%BF%9B%E8%A1%8C%E4%BA%86%E5%8A%A0%E5%AF%86%2F%E8%A7%A3%E5%AF%86%E3%80%82%3C%2FP%3E%3CP%3E%E7%84%B6%E8%80%8C%EF%BC%8C%E5%9C%A8%E7%9B%AE%E6%A0%87%E4%B8%8A%E8%BF%90%E8%A1%8C%E8%A7%A3%E5%AF%86%E7%9A%84%E7%BB%93%E6%9E%9C%E6%98%AF%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E.%2Fele_aes_usage%20decrypt%20CTR%20%2Ftmp%2Fdummy-file.enc%20%2Ftmp%2Fdummy-file%200x3FFFFFFF%20%26gt%3B%20%2Fdev%2Fnull%0A%5B%201179.264527%5D%20fsl-se-fw%20se-fw2%3A%20hsm1_ch0%3A%20Not%20enough%20space%20in%20shared%20memory%0A%5B%201179.271346%5D%20fsl-se-fw%20se-fw2%3A%20hsm1_ch0%3A%20Not%20enough%20space%20in%20shared%20memory%0Acipher_with_ele_cipher%20failed%20ret%3A0xff%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E(%E5%8A%A0%E5%AF%86%E6%96%87%E4%BB%B6%E4%B9%9F%E4%BC%9A%E5%87%BA%E7%8E%B0%E5%90%8C%E6%A0%B7%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%89%3CBR%20%2F%3E%3CBR%20%2F%3E%E4%BE%9B%E5%8F%82%E8%80%83%EF%BC%9Aele%20%E7%9A%84%E9%A2%84%E7%95%99%E7%A9%BA%E9%97%B4%E4%B8%BA%201MB%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3Ehexdump%20-C%20%2Fproc%2Fdevice-tree%2Freserved-memory%2Fele-reserved%5C%40a4120000%2Freg%0A00000000%20%2000%2000%2000%2000%20a4%2012%2000%2000%20%2000%2000%2000%2000%2000%2010%2000%2000%20%20%7C................%7C%0A00000010%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3E%E8%BF%99%E6%98%AF%E9%85%8D%E7%BD%AE%E9%97%AE%E9%A2%98%EF%BC%8C%E8%BF%98%E6%98%AF%E5%BA%94%E8%AF%A5%E4%BB%A5%E4%B8%8D%E5%90%8C%E7%9A%84%E6%96%B9%E5%BC%8F%E5%A4%84%E7%90%86%E5%A4%A7%E6%96%87%E4%BB%B6%E7%9A%84%E8%A7%A3%E5%AF%86%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2188949%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx-ele-apps%2Faes_usage%20test%20with%2050MB%20file%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2188949%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E8%90%A8%E6%8B%89%E6%96%AF%E3%80%81%3C%2FP%3E%3CP%3E%E5%AE%83%E6%98%AF%E4%B8%80%E6%AC%BE%E5%9F%BA%E4%BA%8E%20karo%20%E5%92%8C%20imx%20%E5%B1%82%E7%9A%84%E8%87%AA%E5%AE%9A%E4%B9%89%20yocto%20ScarthGap%20%E7%89%88%E6%9C%AC%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%E8%BF%90%E8%A1%8C%22ELE%20%E5%9B%BA%E4%BB%B6%E7%89%88%E6%9C%AC%202.0.0-64d8ef47%22%20%E5%92%8C%20Linux%206.6.52%3CBR%20%2F%3E%3CBR%20%2F%3Eaes_usage%20%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E6%9D%A5%E8%87%AA%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-imx-support%2Fimx_sec_apps.git%3A%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%EF%BC%9A%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-imx-support%2Fimx_sec_apps.git%EF%BC%9A%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-imx-support%2Fimx_sec_apps.git%EF%BC%9A%3C%2FA%3E%20%E4%B8%BB%E5%88%86%E9%83%A8%3CBR%20%2F%3E%3CBR%20%2F%3E%E7%BB%8F%E8%BF%87%E4%B8%80%E4%BA%9B%E8%B0%83%E6%95%B4%E5%90%8E%E5%8D%B3%E5%8F%AF%E8%BF%90%E8%A1%8C%EF%BC%88%E4%BE%8B%E5%A6%82nvm_daemon%20%E6%98%AF%E9%80%9A%E8%BF%87%E5%88%9D%E5%A7%8B%E5%8C%96%E8%84%9A%E6%9C%AC%E5%90%AF%E5%8A%A8%E7%9A%84%EF%BC%88%E5%9C%A8%E6%88%91%E4%BB%AC%E7%9A%84%E4%BE%8B%E5%AD%90%E4%B8%AD%EF%BC%89%EF%BC%8C%E5%B9%B6%E4%BD%BF%E7%94%A8%E6%88%91%E4%BB%AC%E7%9A%84%20yocto%20%E7%89%88%E6%9C%AC%E7%94%9F%E6%88%90%E7%9A%84%20sdk%20%E8%BF%9B%E8%A1%8C%E6%9E%84%E5%BB%BA%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%E4%BD%BF%E7%94%A8%E4%B8%80%E4%B8%AA%E5%8C%85%E5%90%AB%E7%AE%80%E7%9F%AD%E6%96%87%E6%9C%AC%E5%AD%97%E7%AC%A6%E4%B8%B2%20(%22Alle%20appels%20zijn%20oranje%22)%20%E7%9A%84%E6%96%87%E4%BB%B6%E5%81%9A%E4%BA%86%E4%B8%80%E4%B8%AA%E5%B0%8F%E6%B5%8B%E8%AF%95%EF%BC%8C%E8%AF%A5%E6%96%87%E4%BB%B6%E5%9C%A8%E4%B8%BB%E6%9C%BA%E4%B8%8A%E5%8A%A0%E5%AF%86%EF%BC%8C%E5%B9%B6%E4%BB%8E%E7%9B%AE%E6%A0%87%E6%9C%BA%E4%B8%8A%E7%9A%84%20key_import%20%E7%A4%BA%E4%BE%8B%E4%B8%AD%E5%AF%BC%E5%85%A5%E4%BA%86%20aes%20%E5%AF%86%E9%92%A5%20(0x3FFFFFFF)%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E.%2Fele_aes_usage%20decrypt%20CBC%20another-cipher.txt%20another-secret-message.txt%200x3FFFFFFF%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3E%E7%BB%93%E6%9E%9C%E6%98%AF%20%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3EAlle%20appels%20zijn%20oranje%3Bm%5E%E2%96%92%E2%96%92%E2%96%92F%E2%96%92%E2%96%92%E2%96%92%7D%E2%96%92%CF%B8%E2%96%92%E2%96%92%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%E7%84%B6%E5%90%8E%E4%BD%BF%E7%94%A8%2050MB%20%E4%BA%8C%E8%BF%9B%E5%88%B6%E6%96%87%E4%BB%B6%EF%BC%88%E5%9C%A8%E4%B8%BB%E6%9C%BA%E4%B8%8A%E5%8A%A0%E5%AF%86%EF%BC%89%E8%BF%9B%E8%A1%8C%E6%B5%8B%E8%AF%95%E3%80%82%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E.%2Fele_aes_usage%20decrypt%20CTR%20%2Ftmp%2Fbinary.bin.enc%20%2Ftmp%2Fbinary.bin%200x3FFFFFFF%20%26gt%3B%20%2Fdev%2Fnull%0A%5B%201179.264527%5D%20fsl-se-fw%20se-fw2%3A%20hsm1_ch0%3A%20Not%20enough%20space%20in%20shared%20memory%0A%5B%201179.271346%5D%20fsl-se-fw%20se-fw2%3A%20hsm1_ch0%3A%20Not%20enough%20space%20in%20shared%20memory%0Acipher_with_ele_cipher%20failed%20ret%3A0xff%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%E7%84%B6%E5%90%8E%E6%B5%8B%E8%AF%95%E4%BA%86%E5%AF%B9%E7%9B%AE%E6%A0%87%E4%B8%8A%E7%9A%84%20%E4%BA%8C%E8%BF%9B%E5%88%B6.bin%20%E8%BF%9B%E8%A1%8C%E5%8A%A0%E5%AF%86%EF%BC%88%E4%BB%A5%E6%8E%92%E9%99%A4%E4%B8%BB%E6%9C%BA%E4%B8%8A%E7%9A%84%E5%8A%A0%E5%AF%86%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%89%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E.%2Fele_aes_usage%20encrypt%20CTR%20%2Ftmp%2Fbinary.bin%20%2Ftmp%2Fbinary.bin.enc%200x3FFFFFFF%0AHello%2C%20World!%20Oct%2013%202025%3A06%3A28%3A33%20b83e779%0Amessage%20preview%3A%0Ahsqs%0A%0ASAB%20Error%3A%20SAB%20C%5B%201573.976753%5D%20fsl-se-fw%20se-fw2%3A%20hsm1_ch0%3A%20Not%20enough%20space%20in%20shared%20memory%0AMD%20%5B0x30%5D%20Resp%20%5B%5B%201573.983856%5D%20fsl-se-fw%20se-fw2%3A%20hsm1_ch0%3A%20Not%20enough%20space%20in%20shared%20memory%0A0xf29%5D%20-%20The%20key%20store%20is%20already%20opened%20by%20a%20user%20(load%20operation).%0A%0AKey%20store%20already%20created%2C%20trying%20to%20load%20it...%0A%0ASAB%20Error%3A%20SAB%20CMD%20%5B0x62%5D%20Resp%20%5B0x29%5D%20-%20General%20Error.%0A%0Ahsm%20cipher%20failed%2C%20ret%3A%200xff%0Acipher_with_ele_cipher%20failed%20ret%3A0xff%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%E8%87%B4%E4%BB%A5%E6%9C%80%E5%B4%87%E9%AB%98%E7%9A%84%E6%95%AC%E6%84%8F%EF%BC%8C%3CBR%20%2F%3E%3CBR%20%2F%3EHugo%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2186257%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx-ele-apps%2Faes_usage%20test%20with%2050MB%20file%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2186257%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252198%22%20target%3D%22_blank%22%3E%40HH_Mov%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E5%B8%8C%E6%9C%9B%E4%BD%A0%E4%B8%80%E5%88%87%E9%83%BD%E5%A5%BD%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E8%AF%B7%E5%88%86%E4%BA%AB%E6%82%A8%E7%9A%84%E7%94%B5%E8%B7%AF%E6%9D%BF%E6%94%AF%E6%8C%81%E5%8C%85%E7%89%88%E6%9C%AC%E3%80%82%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%E9%A2%84%E7%BC%96%E8%AF%91%E5%9B%BE%E5%83%8F%E5%90%97%EF%BC%9F%E8%BF%98%E6%98%AF%E6%82%A8%E8%87%AA%E5%B7%B1%E7%BC%96%E8%AF%91%E7%9A%84%EF%BC%88%E5%A6%82%E6%9E%9C%E6%98%AF%EF%BC%8C%E8%AF%B7%E5%88%86%E4%BA%AB%E6%82%A8%E9%81%B5%E5%BE%AA%E7%9A%84%E6%AD%A5%E9%AA%A4%EF%BC%89%EF%BC%9F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E9%A1%BA%E7%A5%9D%E5%95%86%E7%A5%BA%EF%BC%81%3C%2FP%3E%0A%3CP%3E%E8%90%A8%E6%8B%89%E6%96%AF%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2184577%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx-ele-apps%2Faes_usage%20test%20with%2050MB%20file%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2184577%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%85%B6%E4%BB%96%E4%BF%A1%E6%81%AF%3C%2FP%3E%3CP%3Eaes_usage%20%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%BC%9A%E6%A0%B9%E6%8D%AE%E8%BE%93%E5%85%A5%E7%9A%84%E5%A4%A7%E5%B0%8F%E5%88%86%E9%85%8D%E8%BE%93%E5%87%BA%E7%BC%93%E5%86%B2%E7%A9%BA%E9%97%B4%E3%80%82%3CBR%20%2F%3E%E4%BD%BF%E7%94%A8%20125MB%20%E7%9A%84%E6%96%87%E4%BB%B6%E5%92%8C%E8%B6%85%E8%BF%87%20650MB%20%E7%9A%84%E5%8F%AF%E7%94%A8%E5%86%85%E5%AD%98%EF%BC%8C%E8%BF%99%E5%BA%94%E8%AF%A5%E4%B8%8D%E6%88%90%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E