Skip to content

Instantly share code, notes, and snippets.

@azet
Last active November 3, 2015 23:21
Show Gist options
  • Save azet/701268a0aeddc79df930 to your computer and use it in GitHub Desktop.
Save azet/701268a0aeddc79df930 to your computer and use it in GitHub Desktop.
AES-OCB vs AES-CBC vs AES-GCM (AESNI) in OpenSSL 1.1.0-dev
azet@orpheus ~ % lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.2 (jessie)
Release: 8.2
Codename: jessie
azet@orpheus ~ % gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
azet@orpheus ~ % /lib64/libc.so.6
GNU C Library (Debian GLIBC 2.19-18+deb8u1) stable release version 2.19, by Roland McGrath et al.
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.8.4.
Compiled on a Linux 3.16.7 system on 2015-08-30.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
azet@orpheus ~/test/openssl (git)-[master] % git branch ; ./apps/openssl version
* master
OpenSSL 1.1.0-dev xx XXX xxxx
azet@orpheus ~/test/openssl/apps (git)-[master] % ./openssl speed -evp aes-128-ocb aes-128-cbc
Doing aes-128 cbc for 3s on 16 size blocks: 26682088 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 64 size blocks: 7345848 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 256 size blocks: 1865824 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 1024 size blocks: 473223 aes-128 cbc's in 3.00s
Doing aes-128 cbc for 3s on 8192 size blocks: 59264 aes-128 cbc's in 3.01s
Doing aes-128-ocb for 3s on 16 size blocks: 73212516 aes-128-ocb's in 3.00s
Doing aes-128-ocb for 3s on 64 size blocks: 22518949 aes-128-ocb's in 3.01s
Doing aes-128-ocb for 3s on 256 size blocks: 5983470 aes-128-ocb's in 3.00s
Doing aes-128-ocb for 3s on 1024 size blocks: 1517890 aes-128-ocb's in 3.00s
Doing aes-128-ocb for 3s on 8192 size blocks: 190856 aes-128-ocb's in 3.01s
OpenSSL 1.1.0-dev xx XXX xxxx
built on: reproducible build, date unspecified
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx)
compiler: gcc -I. -I.. -I../include -Iinclude -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -Wall -O3 -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_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 142304.47k 156711.42k 159216.98k 161526.78k 161292.59k
aes-128-ocb 390466.75k 478808.22k 510589.44k 518106.45k 519432.68k
./openssl speed -evp aes-128-ocb aes-128-cbc 30.03s user 0.00s system 100% cpu 30.003 total
orpheus 22:03:56 up 10 days, 10:43, 3 users, load average: 1.53, 1.35, 1.39
azet@orpheus ~/test/openssl/apps (git)-[master] % ./openssl speed -evp aes-128-gcm :(
Doing aes-128-gcm for 3s on 16 size blocks: 95058789 aes-128-gcm's in 3.00s
Doing aes-128-gcm for 3s on 64 size blocks: 56459779 aes-128-gcm's in 3.00s
Doing aes-128-gcm for 3s on 256 size blocks: 28642837 aes-128-gcm's in 3.00s
Doing aes-128-gcm for 3s on 1024 size blocks: 9138662 aes-128-gcm's in 3.01s
Doing aes-128-gcm for 3s on 8192 size blocks: 1306722 aes-128-gcm's in 3.00s
OpenSSL 1.1.0-dev xx XXX xxxx
built on: reproducible build, date unspecified
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx)
compiler: gcc -I. -I.. -I../include -Iinclude -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -Wall -O3 -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-gcm 506980.21k 1204475.29k 2444188.76k 3108966.74k 3568222.21k
./openssl speed -evp aes-128-gcm 15.02s user 0.00s system 100% cpu 15.002 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment