Unlike the Raspberry Pi, the Vero 4k’s CPU supports ARMv8 cryptography extensions for AES, SHA1 and SHA2-256.
osmc@osmc:~$ cat /proc/cpuinfo | grep Features
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 wp half thumb fastmult vfp edsp neon vfpv3 tlsi vfpv4 idiva idivt
However, it appears that openssl is not making use of these crypto extensions:
osmc@osmc:~$ openssl speed -evp aes-128-cbc
Doing aes-128-cbc for 3s on 16 size blocks: 8066354 aes-128-cbc’s in 2.99s
Doing aes-128-cbc for 3s on 64 size blocks: 2589229 aes-128-cbc’s in 2.99s
Doing aes-128-cbc for 3s on 256 size blocks: 703339 aes-128-cbc’s in 2.99s
Doing aes-128-cbc for 3s on 1024 size blocks: 179647 aes-128-cbc’s in 2.99s
Doing aes-128-cbc for 3s on 8192 size blocks: 22599 aes-128-cbc’s in 2.99s
OpenSSL 1.0.1t 3 May 2016
built on: Fri Jan 27 00:26:25 2017
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr)
compiler: gcc -I. -I… -I…/include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wa,–noexecstack -Wall -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_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 43164.44k 55421.62k 60218.99k 61524.59k 61916.73k
osmc@osmc:~$ openssl speed aes-128-cbc
Doing aes-128 cbc for 3s on 16 size blocks: 9004567 aes-128 cbc’s in 2.97s
Doing aes-128 cbc for 3s on 64 size blocks: 2683427 aes-128 cbc’s in 2.99s
Doing aes-128 cbc for 3s on 256 size blocks: 709304 aes-128 cbc’s in 2.99s
Doing aes-128 cbc for 3s on 1024 size blocks: 180315 aes-128 cbc’s in 3.00s
Doing aes-128 cbc for 3s on 8192 size blocks: 22633 aes-128 cbc’s in 2.99s
OpenSSL 1.0.1t 3 May 2016
built on: Fri Jan 27 00:26:25 2017
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr)
compiler: gcc -I. -I… -I…/include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wa,–noexecstack -Wall -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_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 48509.45k 57437.90k 60729.71k 61547.52k 62009.88k
It is my understanding (confirmed on other larger systems) that using the -evp flag will cause openssl to use the AES hardware acceleration, where it is available. Though the result differ with and without -evp, they do not suggest a significant (or even any) improvement when -evp is used.
My first thought is that the openssl version from raspbian has probably not been compiled with hardware acceleration enabled since it is aimed at the Rapsberry Pi, which lacks such a feature. Plus the version of openssl on raspbian is 1.0.1t, which is a bit old and might not even have the equivalent of AES-NI for ARMv8.
I’m not averse to compiling my own openssl but perhaps someone more versed in these matters could tell me whether openssl 1.0.1t supports the crypto extensions and would it also need to be supported in the kernel and/or the Vero 4k’s equivalent of a “BIOS”?
Also, assuming there are no significant roadblocks on the way, what would be the chances of OSMC providing an “enhanced” AES-enabled build of openssl?