OP-TEE OS with CAAM slower than without (xtest)?

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

OP-TEE OS with CAAM slower than without (xtest)?

1,131 Views
matthias_staube
Contributor II

Hello,

I have enabled CAAM driver support for OP-TEE OS and tried to compare the performance of crypto operations within OP-TEE OS with xtest --crypto-perf.

What I find quite surprising is that with CAAM enabled, hash and symmetric crypto performance is lower according to the xtest output. However, speed-up is achieved with ECDSA and RSASSA-PKCS1. Nevertheless, I believe even the ECDSA throughput is too low for a SW implementation.

Can you reproduce or contradict these findings? Am I missing something?

Here are my measurements from the target:

Testwith CAAMno CAAM

xtest --crypto-perf -alg SHA256

5 MiB/s13,2 MiB/s

xtest --crypto-perf -alg SHA1

5 MiB/s13,4 MiB/s

xtest --crypto-perf -alg AES_CTS

4,7 MiB/s13,3 MiB/s
xtest --crypto-perf -alg SHA256 -s 100K101 MiB/s447 MiB/s
xtest --crypto-perf -alg SHA1 -s 100K83 MiB/s430 MiB/s

xtest --crypto-perf -alg AES_CTS -s 100K (encrypt)

28,5 MiB/s485 MiB/s

xtest --crypto-perf -alg ECDSA_P256 -k 256 -n 10

0,0127 MiB/s0,000176 MiB/s

xtest --crypto-perf -alg RSASSA_PKCS1_V1_5_SHA512 -k 2048 -n 10

0,23 MiB/s0,063 MiB/s

I don't think these results are very plausible, so I appreciate any insights. Meanwhile I am inspecting configurations and source code to find any clues.

System Information:

  • i.MX 8M Quad
  • imx_4.14.98_2.0.0_ga

Kind Regards,

Matthias

Labels (2)
0 Kudos
2 Replies

949 Views
Yuri
NXP Employee
NXP Employee

Hello,

   "For small payloads, a better performance is achieved when using OPTEE with CFG_IMXCRYPT=n

because CAAM is not enabled in OPTEE.

   When CFG_IMXCRYPT=y, CAAM is enabled in OPTEE and the total time increases because the block

is offloaded to CAAM and this time used to offload the data to CAAM adds up to the total time of the operation".

Regards,

Yuri.

0 Kudos

949 Views
Yuri
NXP Employee
NXP Employee

Hello,

 OP-TEE on i.MX8QXP/QM platform does not support HW cryptography accelerating.

Below are patches to fix the issue.

Enable CAAM accelerating in OP-TEE on i.MX8QXP/QM platform(L4.14.98 GA) 

Regards,

Yuri.

0 Kudos