AnsweredAssumed Answered

Why is AES on CAAM slower than OpenSSL w/o CAAM?

Question asked by Hao Han on Apr 10, 2014
Latest reply on Dec 8, 2014 by Thomas Schuster

The kernel used in my tests is imx_3.0.35_4.1.0 with the latest patches.The test board is Boundary Devices's iMX6Q Sabre Lite.

 

With caam enabled in the kernel's command line parameters, I got output on dmesg showing that caam is loaded.

 

caam caam.0: device ID = 0x0a16010000000000

caam caam.0: job rings = 2, qi = 0

 

In addition, /proc/crypto also confirms that the caam drivers have been enabled.

 

 

TEST 1: With caam, I use tcrypt.ko to test AES encryption/decryption


#insmod tcrypt.ko sec=1 mode=200

testing speed of cbc(aes) encryption

test 0 (128 bit key, 16 byte blocks): 170772 operations in 1 seconds (2732352 B/s)

test 1 (128 bit key, 64 byte blocks): 121409 operations in 1 seconds (7770176 B/s)

test 2 (128 bit key, 256 byte blocks): 56503 operations in 1 seconds (14464768 B/s)

test 3 (128 bit key, 1024 byte blocks): 18017 operations in 1 seconds (18449408 B/s)

test 4 (128 bit key, 8192 byte blocks): 2390 operations in 1 seconds (19578880 B/s)

 

testing speed of cbc(aes) decryption

test 0 (128 bit key, 16 byte blocks): 169842 operations in 1 seconds (2717472 B/s)

test 1 (128 bit key, 64 byte blocks): 121802 operations in 1 seconds (7795328 B/s)

test 2 (128 bit key, 256 byte blocks): 57603 operations in 1 seconds (14746368  B/s)

test 3 (128 bit key, 1024 byte blocks): 18534 operations in 1 seconds (18978816 B/s)

test 4 (128 bit key, 8192 byte blocks): 2462 operations in 1 seconds (20168704 B/s)


TEST 2: Without caam, I use openssl to test AES encryption/decryption

# openssl speed -evp aes-128-cbc

Doing aes-128-cbc for 3s on 16 size blocks: 3547600 aes-128-cbc's in 2.99s

Doing aes-128-cbc for 3s on 64 size blocks: 946867 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 256 size blocks: 240616 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 1024 size blocks: 60033 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 8192 size blocks: 7513 aes-128-cbc's in 2.99s

OpenSSL 1.0.1e 11 Feb 2013

built on: Thu Aug  8 15:44:23 EDT 2013

options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr)

compiler: armv7l-timesys-linux-gnueabi-gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -I/here/worl

The 'numbers' are in 1000s of bytes per second processed.

type 16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes

aes-128-cbc 18983.81k    20199.83k 20532.57k    20491.26k    20584.11k



Question: Why is AES on CAAM slower than openssl without CAAM? Is it normal, or I made some mistakes in configuration?

 

Thank you!

Outcomes