AnsweredAssumed Answered

Does IMX6Q Cryptographic Acceleration work in Linux 4.1.15?

Question asked by Ivy Liu on Sep 20, 2017
Latest reply on Sep 21, 2017 by Ivy Liu

Hi All,

 

Has anyone worked with IMX6Q Cryptographic Acceleration with Linux 4.1.15?

I am very new to cryptographic algorithm. I just tested the speed of aes and rc4 on my IMX6 Quad board with Linux 4.1.15. From the result below, we can see the hardware did improve aes speed in 16/64/1024 bytes, but get worse in 256 bytes and there is no improvement in RC4.

 

Is the way I am using wrong?

Is there any patch I need to use?

 

# openssl speed -evp aes-128-cbc
Doing aes-128-cbc for 3s on 16 size blocks: 47957 aes-128-cbc's in 0.10s
Doing aes-128-cbc for 3s on 64 size blocks: 42772 aes-128-cbc's in 0.02s
Doing aes-128-cbc for 3s on 256 size blocks: 40349 aes-128-cbc's in 0.03s
Doing aes-128-cbc for 3s on 1024 size blocks: 27385 aes-128-cbc's in 0.04s
Doing aes-128-cbc for 3s on 8192 size blocks: 8508 aes-128-cbc's in 0.00s
OpenSSL 1.0.2h 3 May 2016
built on: reproducible build, date unspecified
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) idea(int) blowfish(ptr)
compiler: arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/workspace2/psc-arm-yocto-bsp/build-geminivfe/tmp/sysroots -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE
_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/openssl/1.0.2h-r0=/usr/src/debug/openssl/1.0.2h-r0 -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots= -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF
2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 7673.12k 136870.40k 344311.47k 701056.00k infk


# openssl speed -evp aes-128-cbc -engine cryptodev
engine "cryptodev" set.
Doing aes-128-cbc for 3s on 16 size blocks: 48346 aes-128-cbc's in 0.09s
Doing aes-128-cbc for 3s on 64 size blocks: 42793 aes-128-cbc's in 0.01s
Doing aes-128-cbc for 3s on 256 size blocks: 40272 aes-128-cbc's in 0.04s
Doing aes-128-cbc for 3s on 1024 size blocks: 27395 aes-128-cbc's in 0.03s
Doing aes-128-cbc for 3s on 8192 size blocks: 8503 aes-128-cbc's in 0.00s
OpenSSL 1.0.2h 3 May 2016
built on: reproducible build, date unspecified
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) idea(int) blowfish(ptr)
compiler: arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/workspace2/psc-arm-y
octo-bsp/build/tmp/sysroots -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE
_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/openssl/1.0.2h-r0=/usr/src/debug/openssl/1.0.2h-r0 -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots= -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF
2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 8594.84k 273875.20k 257740.80k 935082.67k infk

 

# openssl speed -evp rc4 
Doing rc4 for 3s on 16 size blocks: 9022661 rc4's in 3.00s
Doing rc4 for 3s on 64 size blocks: 2938185 rc4's in 3.00s
Doing rc4 for 3s on 256 size blocks: 791755 rc4's in 3.00s
Doing rc4 for 3s on 1024 size blocks: 201967 rc4's in 3.00s
Doing rc4 for 3s on 8192 size blocks: 25355 rc4's in 3.00s
OpenSSL 1.0.2h 3 May 2016
built on: reproducible build, date unspecified
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) idea(int) blowfish(ptr)
compiler: arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE
_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/openssl/1.0.2h-r0=/usr/src/debug/openssl/1.0.2h-r0 -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots= -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF
2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
rc4 48120.86k 62681.28k 67563.09k 68938.07k 69236.05k

 

# openssl speed -evp rc4 -engine cryptodev
engine "cryptodev" set.
Doing rc4 for 3s on 16 size blocks: 9069058 rc4's in 3.00s
Doing rc4 for 3s on 64 size blocks: 2938390 rc4's in 3.00s
Doing rc4 for 3s on 256 size blocks: 792343 rc4's in 3.00s
Doing rc4 for 3s on 1024 size blocks: 202019 rc4's in 3.00s
Doing rc4 for 3s on 8192 size blocks: 25358 rc4's in 3.00s
OpenSSL 1.0.2h 3 May 2016
built on: reproducible build, date unspecified
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) idea(int) blowfish(ptr)
compiler: arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE
_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/openssl/1.0.2h-r0=/usr/src/debug/openssl/1.0.2h-r0 -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/home/workspace2/psc-arm-yocto-bsp/build/tmp/sysroots= -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF
2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
rc4 48368.31k 62685.65k 67613.27k 68955.82k 69244.25k

 

Thanks and Best Regards,

Ivy

Outcomes