Skip to content

Instantly share code, notes, and snippets.

@mattcollier
Last active August 29, 2015 14:27
Show Gist options
  • Save mattcollier/262bf2bf2d99a4fb1b2c to your computer and use it in GitHub Desktop.
Save mattcollier/262bf2bf2d99a4fb1b2c to your computer and use it in GitHub Desktop.
AES-NI instruction found in some modern CPU's
https://en.wikipedia.org/wiki/AES_instruction_set
OpenSSL and AES-NI
http://openssl.6102.n7.nabble.com/having-a-lot-of-troubles-trying-to-get-AES-NI-working-tp44285p44309.html
$ openssl speed -elapsed -evp aes-128-cbc
You have chosen to measure elapsed time instead of user CPU time.
Doing aes-128-cbc for 3s on 16 size blocks: 98821624 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 64 size blocks: 26674959 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 256 size blocks: 6795017 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 1024 size blocks: 1705842 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 8192 size blocks: 210833 aes-128-cbc's in 3.00s
OpenSSL 1.0.1f 6 Jan 2014
built on: Thu Jun 11 15:28:12 UTC 2015
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) blowfish(idx)
compiler: cc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DMD32_REG_T=int -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
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 527048.66k 569065.79k 579841.45k 582260.74k 575714.65k
$ OPENSSL_ia32cap="~0x200000200000000" openssl speed -elapsed -evp aes-128-cbc
You have chosen to measure elapsed time instead of user CPU time.
Doing aes-128-cbc for 3s on 16 size blocks: 49444346 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 64 size blocks: 13760112 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 256 size blocks: 3484138 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 1024 size blocks: 873742 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 8192 size blocks: 110609 aes-128-cbc's in 3.00s
OpenSSL 1.0.1f 6 Jan 2014
built on: Thu Jun 11 15:28:12 UTC 2015
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) blowfish(idx)
compiler: cc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DMD32_REG_T=int -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
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 263703.18k 293549.06k 297313.11k 298237.27k 302036.31k
SUMMARY:
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
AES-NI ON: aes-128-cbc 527048.66k 569065.79k 579841.45k 582260.74k 575714.65k
AES-NI OFF: aes-128-cbc 263703.18k 293549.06k 297313.11k 298237.27k 302036.31k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment