Novena/Crypto

From Studio Kousagi Wiki
Jump to: navigation, search

OpenSSL

Benchmarks

Run quickly at 29c3 (late Dec 2012); no special configuration was done to enable hardware co-processing, unsure if openssl found those assembler instructions automatically.

root@torouter:/etc/apt# openssl speed md5 sha1 rsa dsa des aes hmac
[snip]
OpenSSL 1.0.1c 10 May 2012
built on: Sun Jul 29 13:43:04 UTC 2012
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr)
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector --param=ssp-buffer-size=4  -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wa,--noexecstack - Wall
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md5               4222.76k    14510.36k    40580.10k    73623.55k    96586.41k
hmac(md5)         5201.78k    17441.75k    46196.05k    78046.55k    97815.21k
sha1              3993.92k    12071.00k    27591.94k    40681.81k    47210.50k
des cbc          12777.75k    13595.33k    13815.13k    13872.81k    13888.17k
des ede3          4888.58k     4997.95k     5034.58k     5043.20k     5046.27k
aes-128 cbc      12262.57k    13658.54k    13993.73k    14078.98k    14098.43k
aes-192 cbc      10643.06k    11518.34k    11760.55k    11823.45k    11840.17k
aes-256 cbc       9291.74k    10071.36k    10252.46k    10296.66k    10305.54k
                  sign    verify    sign/s verify/s
rsa  512 bits 0.002351s 0.000210s    425.4   4771.6
rsa 1024 bits 0.012512s 0.000605s     79.9   1652.2
rsa 2048 bits 0.074296s 0.001992s     13.5    502.0
rsa 4096 bits 0.483333s 0.006791s      2.1    147.3
                  sign    verify    sign/s verify/s
dsa  512 bits 0.002146s 0.002334s    466.0    428.5
dsa 1024 bits 0.006073s 0.007082s    164.7    141.2
dsa 2048 bits 0.019763s 0.023553s     50.6     42.5


Re-run using af_alg, which does crypto in the kernel. Again, no special hardware was used in these tests:

root@novena:~# openssl speed md5 sha1 des aes hmac -engine af_alg
...
OpenSSL 1.0.0j 10 May 2012
built on: Tue Dec 11 10:55:15 CET 2012
options:bn(64,32) rc4(ptr,int) des(idx,risc1,2,long) aes(partial) idea(int) blowfish(idx) 
compiler: arm-angstrom-linux-gnueabi-gcc  -march=armv7-a -fno-tree-vectorize     -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 --sysroot=/home/koen/setup-scripts/build/tmp-angstrom_v2012_05-eglibc/sysroots/beaglebone -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN 	-DTERMIO  -O2 -pipe -g -feliminate-unused-debug-types -Wall -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md5               2469.98k     9029.97k    27167.57k    54987.43k    78148.95k
hmac(md5)         5406.18k    16967.72k    42191.87k    67042.99k    81059.84k
sha1               164.00k     2643.20k     5273.60k    10470.40k   337510.40k
des cbc          11807.59k    12681.54k    12946.94k    13018.79k    13036.20k
des ede3          4534.86k     4689.07k     4740.69k     4750.34k     4743.17k
aes-128 cbc      13942.93k    15050.77k    15387.82k    15473.32k    15496.53k
aes-192 cbc      11973.76k    12773.53k    13009.75k    13070.34k    13088.09k
aes-256 cbc      10471.23k    11083.82k    11265.62k    11312.13k    11324.07k