I am running some openssl speed tests on the SK-AM62 evaluation board. I am running PROCESSOR-SDK-LINUX-AM62X 6.1.46-g247b2535b2. A chapter in TI’s processor-sdk-linux documentation discusses how to use the Cryptographic Hardware Accelerators from OpenSSL. For some ciphers, such as AES-128-CBC, there is a clear difference between the speed test on the processor versus the crypto accelerator. But for many other ciphers, including all the TLSv1.3 ciphers (e.g., AES-256-GCM), there is no speed difference. I am attaching some output below. Am I correct in assuming that the cryptographic hardware accelerator only supports a handful of ciphers? If so, is there a list of supported ciphers? And if not, do you have an idea of what I could be doing wrong?
The AES-128-CBC speed test is affected by the crypto engine:
root@am62xx-evm:~# lsmod | grep cryptodev
cryptodev 53248 0
root@am62xx-evm:~# openssl speed -evp aes-128-cbc -engine devcrypto
Engine "devcrypto" set.
Doing AES-128-CBC for 3s on 16 size blocks: 67055 AES-128-CBC's in 0.11s
Doing AES-128-CBC for 3s on 64 size blocks: 65306 AES-128-CBC's in 0.06s
Doing AES-128-CBC for 3s on 256 size blocks: 60338 AES-128-CBC's in 0.05s
Doing AES-128-CBC for 3s on 1024 size blocks: 48182 AES-128-CBC's in 0.10s
Doing AES-128-CBC for 3s on 8192 size blocks: 22152 AES-128-CBC's in 0.04s
Doing AES-128-CBC for 3s on 16384 size blocks: 13752 AES-128-CBC's in 0.05s
version: 3.0.12
built on: Tue Oct 24 13:48:41 2023 UTC
options: bn(64,64)
compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_armcap=0xbd
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 9753.45k 69659.73k 308930.56k 493383.68k 4536729.60k 4506255.36k
root@am62xx-evm:~# modprobe -r cryptodev
[ 679.435360] cryptodev: driver unloaded.
root@am62xx-evm:~# openssl speed -evp aes-128-cbc
Doing AES-128-CBC for 3s on 16 size blocks: 22747132 AES-128-CBC's in 3.00s
Doing AES-128-CBC for 3s on 64 size blocks: 16960400 AES-128-CBC's in 2.99s
Doing AES-128-CBC for 3s on 256 size blocks: 8157019 AES-128-CBC's in 2.99s
Doing AES-128-CBC for 3s on 1024 size blocks: 2753479 AES-128-CBC's in 3.00s
Doing AES-128-CBC for 3s on 8192 size blocks: 382445 AES-128-CBC's in 2.99s
Doing AES-128-CBC for 3s on 16384 size blocks: 192841 AES-128-CBC's in 3.00s
version: 3.0.12
built on: Tue Oct 24 13:48:41 2023 UTC
options: bn(64,64)
compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_armcap=0xbd
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 121318.04k 363031.97k 698393.60k 939854.17k 1047822.56k 1053168.98k
The AES-256-GCM cipher is NOT affected by the crypto engine:
root@am62xx-evm:~# lsmod | grep -i crypt
cryptodev 53248 0
root@am62xx-evm:~#
root@am62xx-evm:~#
root@am62xx-evm:~# openssl speed -evp aes-256-gcm -engine devcrypto
Engine "devcrypto" set.
Doing AES-256-GCM for 3s on 16 size blocks: 11453793 AES-256-GCM's in 2.99s
Doing AES-256-GCM for 3s on 64 size blocks: 8407123 AES-256-GCM's in 2.99s
Doing AES-256-GCM for 3s on 256 size blocks: 4073659 AES-256-GCM's in 2.99s
Doing AES-256-GCM for 3s on 1024 size blocks: 1486851 AES-256-GCM's in 3.00s
Doing AES-256-GCM for 3s on 8192 size blocks: 214538 AES-256-GCM's in 2.99s
Doing AES-256-GCM for 3s on 16384 size blocks: 108304 AES-256-GCM's in 2.99s
version: 3.0.12
built on: Tue Oct 24 13:48:41 2023 UTC
options: bn(64,64)
compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_armcap=0xbd
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
AES-256-GCM 61291.20k 179951.80k 348781.51k 507511.81k 587791.07k 593462.45k
root@am62xx-evm:~# modprobe -r cryptodev
[ 63.859965] cryptodev: driver unloaded.
root@am62xx-evm:~# openssl speed -evp aes-256-gcm
Doing AES-256-GCM for 3s on 16 size blocks: 11536254 AES-256-GCM's in 2.99s
Doing AES-256-GCM for 3s on 64 size blocks: 8346996 AES-256-GCM's in 3.00s
Doing AES-256-GCM for 3s on 256 size blocks: 4062179 AES-256-GCM's in 2.99s
Doing AES-256-GCM for 3s on 1024 size blocks: 1487569 AES-256-GCM's in 2.99s
Doing AES-256-GCM for 3s on 8192 size blocks: 214685 AES-256-GCM's in 3.00s
Doing AES-256-GCM for 3s on 16384 size blocks: 108502 AES-256-GCM's in 2.99s
version: 3.0.12
built on: Tue Oct 24 13:48:41 2023 UTC
options: bn(64,64)
compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_armcap=0xbd
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
AES-256-GCM 61732.46k 178069.25k 347798.60k 509455.07k 586233.17k 594547.41k