Qemu/openssl

From Segfault
Jump to: navigation, search

We'll do a quick OpenSSL benchmark:

 for f in libssl.so.0.9.8 libcrypto.so.0.9.8; do
    scp alice-i386:/usr/lib/"$f" i386/usr/lib
 done
 scp alice-i386:/usr/bin/openssl i386/usr/bin

Emulated

$ qemu-i386 -L `pwd`/i386/ i386/usr/bin/openssl version
OpenSSL 0.9.8k 25 Mar 2009

$ qemu-i386 -L `pwd`/i386/ i386/usr/bin/openssl speed sha1 rsa1024
Doing sha1 for 3s on 16 size blocks: 68262 sha1's in 2.91s
Doing sha1 for 3s on 64 size blocks: 54668 sha1's in 2.89s
Doing sha1 for 3s on 256 size blocks: 28129 sha1's in 2.91s
Doing sha1 for 3s on 1024 size blocks: 9773 sha1's in 2.94s
Doing sha1 for 3s on 8192 size blocks: 1352 sha1's in 2.91s
Doing 1024 bit private rsa's for 10s: 86 1024 bit private RSA's in 9.78s
Doing 1024 bit public rsa's for 10s: 1784 1024 bit public RSA's in 9.75s
OpenSSL 0.9.8k 25 Mar 2009
built on: Thu Feb 10 02:17:57 UTC 2011
options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) aes(partial) blowfish(idx) 
compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT \
-DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall
available timing options: TIMES TIMEB HZ=100 [sysconf value]
timing function used: times
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
sha1              375.32k     1210.64k    2474.58k    3403.93k     3806.04k

                   sign    verify    sign/s verify/s
rsa 1024 bits 0.113721s 0.005465s       8.8    183.0

Native

$ /usr/bin/openssl version
OpenSSL 0.9.8o 01 Jun 2010

$ /usr/bin/openssl speed sha1 rsa1024
Doing sha1 for 3s on 16 size blocks: 1190945 sha1's in 2.91s
Doing sha1 for 3s on 64 size blocks: 1445804 sha1's in 2.95s
Doing sha1 for 3s on 256 size blocks: 999516 sha1's in 2.92s
Doing sha1 for 3s on 1024 size blocks: 461113 sha1's in 2.95s
Doing sha1 for 3s on 8192 size blocks: 74618 sha1's in 2.91s
Doing 1024 bit private rsa's for 10s: 1696 1024 bit private RSA's in 9.79s
Doing 1024 bit public rsa's for 10s: 33744 1024 bit public RSA's in 9.40s
OpenSSL 0.9.8o 01 Jun 2010
built on: Thu Feb 10 19:59:37 UTC 2011
options:bn(64,32) md2(char) rc4(idx,int) des(ptr,risc2,16,long) aes(partial) blowfish(idx) 
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT \
-DDSO_DLFCN -DHAVE_DLFCN_H -DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall
available timing options: TIMES TIMEB HZ=100 [sysconf value]
timing function used: times
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
sha1             6548.15k    31366.60k    87628.80k   160060.92k   210058.64k

                   sign    verify    sign/s  verify/s
rsa 1024 bits 0.005772s 0.000279s    173.2   3589.8

Outcome

  • OpenSSL/native is ~40x faster for sha1 operations.
  • OpenSSL/native is ~20x faster for rsa/sign and rsa/verify operations.