How to test openssl DES RSA speed with afalg engine when CAAM enable

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

How to test openssl DES RSA speed with afalg engine when CAAM enable

948件の閲覧回数
JasonCS
Contributor I

Hi,

Follow i.MX Linux User's Guide Rev. LF6.1.22_2.0.0 — 30 June 2023 chapter 10.4.6 Running OpenSSL benchmarking tests with AF_ALG engine.

I have verfied the test result of AES is same as document, however when I test DES or RSA it seems CAAM not work, CPU loading still high and /proc/interrupt of job ring doesn't increase.

Do you have any idea to this test case?

 

Thank you.

0 件の賞賛
返信
3 返答(返信)

913件の閲覧回数
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

What ciphers did you tried with? Here are described AES and DES as RSA is asymmetric is not listed.

Trying three key EDE DED, I successfully get positive results, please see below.

joseph@imx8mpevk:~$ openssl speed -engine afalg -evp des-ede3-cbc
Engine "afalg" set.
Doing DES-EDE3-CBC for 3s on 16 size blocks: 2001533 DES-EDE3-CBC's in 2.99s
Doing DES-EDE3-CBC for 3s on 64 size blocks: 534471 DES-EDE3-CBC's in 3.00s
Doing DES-EDE3-CBC for 3s on 256 size blocks: 135999 DES-EDE3-CBC's in 2.99s
Doing DES-EDE3-CBC for 3s on 1024 size blocks: 34153 DES-EDE3-CBC's in 3.00s
Doing DES-EDE3-CBC for 3s on 8192 size blocks: 4274 DES-EDE3-CBC's in 3.00s
Doing DES-EDE3-CBC for 3s on 16384 size blocks: 2137 DES-EDE3-CBC's in 2.99s
version: 3.0.2
built on: Wed May 24 17:12:55 2023 UTC
options: bn(64,64)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/openssl-7eq86f/openssl-3.0.2=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
CPUINFO: OPENSSL_armcap=0xbf
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
DES-EDE3-CBC     10710.54k    11402.05k    11644.06k    11657.56k    11670.87k    11709.90k

joseph@imx8mpevk:~$ openssl speed -engine afalg -evp des-ede3
Engine "afalg" set.
Doing DES-EDE3-ECB for 3s on 16 size blocks: 2037078 DES-EDE3-ECB's in 3.00s
Doing DES-EDE3-ECB for 3s on 64 size blocks: 533639 DES-EDE3-ECB's in 2.99s
Doing DES-EDE3-ECB for 3s on 256 size blocks: 135134 DES-EDE3-ECB's in 3.00s
Doing DES-EDE3-ECB for 3s on 1024 size blocks: 33893 DES-EDE3-ECB's in 2.99s
Doing DES-EDE3-ECB for 3s on 8192 size blocks: 4241 DES-EDE3-ECB's in 3.00s
Doing DES-EDE3-ECB for 3s on 16384 size blocks: 2120 DES-EDE3-ECB's in 3.00s
version: 3.0.2
built on: Wed May 24 17:12:55 2023 UTC
options: bn(64,64)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/openssl-7eq86f/openssl-3.0.2=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
CPUINFO: OPENSSL_armcap=0xbf
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
DES-EDE3-ECB     10864.42k    11422.37k    11531.43k    11607.50k    11580.76k    11578.03

Thank you

0 件の賞賛
返信

904件の閲覧回数
JasonCS
Contributor I

Hi Joseph,

Below is what I try, please check the job ring change difference between des-ede3-cbc and aes-128-cbc, to make sure CAAM work I check job ring , I know can run des-ede3-cbc success with openssl but job ring seems not change, is there other method to make sure CAAM is work when we test des-ede3-cbc with openssl?

cat /proc/interrupts | grep jr
56: 164948 0 0 0 GICv3 137 Level 30901000.jr
57: 2670903 0 0 0 GICv3 138 Level 30902000.jr
58: 156888 0 0 0 GICv3 146 Level 30903000.jr

openssl speed -engine afalg -evp des-ede3-cbc
engine "afalg" set.
Doing des-ede3-cbc for 3s on 16 size blocks: 1743322 des-ede3-cbc's in 3.00s
Doing des-ede3-cbc for 3s on 64 size blocks: 469911 des-ede3-cbc's in 2.99s
Doing des-ede3-cbc for 3s on 256 size blocks: 119956 des-ede3-cbc's in 2.99s
Doing des-ede3-cbc for 3s on 1024 size blocks: 30149 des-ede3-cbc's in 3.00s
Doing des-ede3-cbc for 3s on 8192 size blocks: 3774 des-ede3-cbc's in 2.99s
Doing des-ede3-cbc for 3s on 16384 size blocks: 1887 des-ede3-cbc's in 3.00s
OpenSSL 1.1.1n 15 Mar 2022
built on: Fri May 26 21:30:44 2023 UTC
options:bn(64,64) rc4(char) des(int) aes(partial) blowfish(ptr)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/openssl-DLe6s5/openssl-1.1.1n=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
des-ede3-cbc 9297.72k 10058.30k 10270.48k 10290.86k 10340.00k 10305.54k


cat /proc/interrupts | grep jr
56: 164948 0 0 0 GICv3 137 Level 30901000.jr
57: 2670903 0 0 0 GICv3 138 Level 30902000.jr
58: 156888 0 0 0 GICv3 146 Level 30903000.jr


openssl speed -engine afalg -evp aes-128-cbc
engine "afalg" set.
Doing aes-128-cbc for 3s on 16 size blocks: 55569 aes-128-cbc's in 0.13s
Doing aes-128-cbc for 3s on 64 size blocks: 56190 aes-128-cbc's in 0.11s
Doing aes-128-cbc for 3s on 256 size blocks: 53179 aes-128-cbc's in 0.10s
Doing aes-128-cbc for 3s on 1024 size blocks: 38486 aes-128-cbc's in 0.05s
Doing aes-128-cbc for 3s on 8192 size blocks: 8031 aes-128-cbc's in 0.05s
Doing aes-128-cbc for 3s on 16384 size blocks: 4362 aes-128-cbc's in 0.03s
OpenSSL 1.1.1n 15 Mar 2022
built on: Fri May 26 21:30:44 2023 UTC
options:bn(64,64) rc4(char) des(int) aes(partial) blowfish(ptr)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/openssl-DLe6s5/openssl-1.1.1n=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
aes-128-cbc 6839.26k 32692.36k 136138.24k 788193.28k 1315799.04k 2382233.60k


cat /proc/interrupts | grep jr
56: 164951 0 0 0 GICv3 137 Level 30901000.jr
57: 2886720 0 0 0 GICv3 138 Level 30902000.jr
58: 156888 0 0 0 GICv3 146 Level 30903000.jr

 

Thank you.

0 件の賞賛
返信

883件の閲覧回数
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

I am reviewing it with a colleague,

Thank you for your patience.

Regards

0 件の賞賛
返信