「OpenSSLのパフォーマンス比較」の版間の差分
提供: セキュリティ
(ページの作成:「OpenSSL のパフォーマンスを比較してみました。 '''読み方''' ;OpenSSL:おーぷん えすえすえる __TOC__ == 概要 == opensslには、ベ...」) |
|||
行7: | 行7: | ||
== 概要 == | == 概要 == | ||
opensslには、ベンチマークのオプションが実装されています。openssl speed で実行できます。 | opensslには、ベンチマークのオプションが実装されています。openssl speed で実行できます。 | ||
− | == openssl-1.0.2d | + | == openssl-0.9.8q と 1.0.2d, 1.0.1p, 1.0.0s, 0.9.8zg で sha 256 の比較 == |
− | + | ||
− | + | ||
SHA-256 でテストしました。 | SHA-256 でテストしました。 | ||
+ | openssl-0.9.8q は、FreeBSD 9.0-RELEASE にはじめから入っていたバイナリです。 | ||
+ | openssl-1.0.2d 達は、自分でビルドしました。config のオプションは、zlib のみです。 | ||
+ | 自分でビルドした openssl は、以下のバージョンです。 | ||
+ | * openssl 1.0.2d | ||
+ | * openssl 1.0.1p | ||
+ | * openssl 1.0.0s | ||
+ | * openssl 0.9.8zg | ||
=== 結論 === | === 結論 === | ||
1.0.2d のほうが 0.9.8qの1.79倍速い結果となりました。 | 1.0.2d のほうが 0.9.8qの1.79倍速い結果となりました。 | ||
openssl-1.0.2d > openssl-0.9.8q | openssl-1.0.2d > openssl-0.9.8q | ||
+ | |||
+ | openssl 0.9.8zg と openssl 1.0.0s は openssl 0.9.8q と同じぐらい遅く、1.0.1 以降は高速でした。 | ||
+ | |||
+ | * '''速い''' | ||
+ | ** openssl 1.0.2d | ||
+ | ** openssl 1.0.1p | ||
+ | * '''遅い''' | ||
+ | ** openssl 1.0.0s | ||
+ | ** openssl 0.9.8zg | ||
=== テスト環境 === | === テスト環境 === | ||
AMDのCPUの環境でテストを実施しました。 | AMDのCPUの環境でテストを実施しました。 | ||
行60: | 行74: | ||
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes | ||
sha256 51029.99k 117375.59k 204770.82k 251964.98k 271108.78k | sha256 51029.99k 117375.59k 204770.82k 251964.98k 271108.78k | ||
+ | </syntaxhighlight> | ||
+ | === ベンチマーク openssl 1.0.1p === | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl version | ||
+ | OpenSSL 1.0.1p 9 Jul 2015 | ||
+ | % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl speed sha256 | ||
+ | Doing sha256 for 3s on 16 size blocks: 9351335 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 64 size blocks: 5351405 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 256 size blocks: 2322864 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 1024 size blocks: 713883 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 8192 size blocks: 95641 sha256's in 3.01s | ||
+ | OpenSSL 1.0.1p 9 Jul 2015 | ||
+ | built on: Wed Nov 11 00:46:29 2015 | ||
+ | options:bn(64,64) rc4(8x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) | ||
+ | compiler: gcc -I. -I.. -I../include -DZLIB -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -O3 -Wall -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 | ||
+ | sha256 49873.79k 114163.31k 198217.73k 243672.06k 260485.34k | ||
+ | </syntaxhighlight> | ||
+ | === ベンチマーク openssl 1.0.0s === | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl version | ||
+ | OpenSSL 1.0.0s 11 Jun 2015 | ||
+ | % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl speed sha256 | ||
+ | Doing sha256 for 3s on 64 size blocks: 5156973 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 256 size blocks: 2249393 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 1024 size blocks: 693534 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 8192 size blocks: 93103 sha256's in 3.00s | ||
+ | OpenSSL 1.0.0s 11 Jun 2015 | ||
+ | built on: Wed Nov 11 00:54:25 2015 | ||
+ | options:bn(64,64) rc4(8x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) | ||
+ | compiler: gcc -I. -I.. -I../include -DZLIB -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM | ||
+ | The 'numbers' are in 1000s of bytes per second processed. | ||
+ | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes | ||
+ | sha256 48433.29k 110015.42k 191948.20k 236726.27k 254233.26k | ||
+ | </syntaxhighlight> | ||
+ | === ベンチマーク openssl 0.9.8zg === | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl version | ||
+ | % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl speed sha256 | ||
+ | program when this computer is idle. | ||
+ | Doing sha256 for 3s on 16 size blocks: 5939600 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 64 size blocks: 3998215 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 256 size blocks: 1997856 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 1024 size blocks: 668304 sha256's in 3.00s | ||
+ | Doing sha256 for 3s on 8192 size blocks: 92625 sha256's in 3.00s | ||
+ | OpenSSL 0.9.8zg 11 Jun 2015 | ||
+ | built on: Wed Nov 11 00:51:47 JST 2015 | ||
+ | options:bn(64,64) md2(int) rc4(8x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) | ||
+ | compiler: gcc -DZLIB -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM | ||
+ | available timing options: USE_TOD HZ=128 [sysconf value] | ||
+ | timing function used: getrusage | ||
+ | The 'numbers' are in 1000s of bytes per second processed. | ||
+ | type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes | ||
+ | sha256 31660.44k 85268.91k 170430.82k 228043.36k 252846.50k | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== 関連項目 == | == 関連項目 == |
2015年11月11日 (水) 01:05時点における最新版
OpenSSL のパフォーマンスを比較してみました。
読み方
- OpenSSL
- おーぷん えすえすえる
目次
概要
opensslには、ベンチマークのオプションが実装されています。openssl speed で実行できます。
openssl-0.9.8q と 1.0.2d, 1.0.1p, 1.0.0s, 0.9.8zg で sha 256 の比較
SHA-256 でテストしました。 openssl-0.9.8q は、FreeBSD 9.0-RELEASE にはじめから入っていたバイナリです。 openssl-1.0.2d 達は、自分でビルドしました。config のオプションは、zlib のみです。 自分でビルドした openssl は、以下のバージョンです。
- openssl 1.0.2d
- openssl 1.0.1p
- openssl 1.0.0s
- openssl 0.9.8zg
結論
1.0.2d のほうが 0.9.8qの1.79倍速い結果となりました。
openssl-1.0.2d > openssl-0.9.8q
openssl 0.9.8zg と openssl 1.0.0s は openssl 0.9.8q と同じぐらい遅く、1.0.1 以降は高速でした。
- 速い
- openssl 1.0.2d
- openssl 1.0.1p
- 遅い
- openssl 1.0.0s
- openssl 0.9.8zg
テスト環境
AMDのCPUの環境でテストを実施しました。
AMD Phenom(tm) II X4 980 Processor (4017.87-MHz K8-class CPU)
ベンチマーク openssl 0.9.8q
% openssl version OpenSSL 0.9.8q 2 Dec 2010 % which openssl /usr/bin/openssl % openssl speed sha256 To get the most accurate results, try to run this program when this computer is idle. Doing sha256 for 3s on 16 size blocks: 5324850 sha256's in 3.00s Doing sha256 for 3s on 64 size blocks: 3231766 sha256's in 3.00s Doing sha256 for 3s on 256 size blocks: 1478358 sha256's in 3.00s Doing sha256 for 3s on 1024 size blocks: 466211 sha256's in 3.00s Doing sha256 for 3s on 8192 size blocks: 63113 sha256's in 3.00s OpenSSL 0.9.8q 2 Dec 2010 built on: date not available options:bn(64,64) md2(int) rc4(ptr,int) des(idx,cisc,16,int) aes(partial) blowfish(idx) compiler: cc available timing options: USE_TOD HZ=128 [sysconf value] timing function used: getrusage The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes sha256 28375.34k 68923.07k 126113.99k 159083.83k 172285.95k
ベンチマーク openssl 1.0.2d
% env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl version OpenSSL 1.0.2d 9 Jul 2015 % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl speed sha256 Doing sha256 for 3s on 16 size blocks: 9568123 sha256's in 3.00s Doing sha256 for 3s on 64 size blocks: 5501981 sha256's in 3.00s Doing sha256 for 3s on 256 size blocks: 2399658 sha256's in 3.00s Doing sha256 for 3s on 1024 size blocks: 740101 sha256's in 3.01s Doing sha256 for 3s on 8192 size blocks: 99283 sha256's in 3.00s OpenSSL 1.0.2d 9 Jul 2015 built on: reproducible build, date unspecified options:bn(64,64) rc4(8x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) compiler: cc -I. -I.. -I../include -DZLIB -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -O3 -Wall -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 sha256 51029.99k 117375.59k 204770.82k 251964.98k 271108.78k
ベンチマーク openssl 1.0.1p
% env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl version OpenSSL 1.0.1p 9 Jul 2015 % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl speed sha256 Doing sha256 for 3s on 16 size blocks: 9351335 sha256's in 3.00s Doing sha256 for 3s on 64 size blocks: 5351405 sha256's in 3.00s Doing sha256 for 3s on 256 size blocks: 2322864 sha256's in 3.00s Doing sha256 for 3s on 1024 size blocks: 713883 sha256's in 3.00s Doing sha256 for 3s on 8192 size blocks: 95641 sha256's in 3.01s OpenSSL 1.0.1p 9 Jul 2015 built on: Wed Nov 11 00:46:29 2015 options:bn(64,64) rc4(8x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) compiler: gcc -I. -I.. -I../include -DZLIB -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -O3 -Wall -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 sha256 49873.79k 114163.31k 198217.73k 243672.06k 260485.34k
ベンチマーク openssl 1.0.0s
% env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl version OpenSSL 1.0.0s 11 Jun 2015 % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl speed sha256 Doing sha256 for 3s on 64 size blocks: 5156973 sha256's in 3.00s Doing sha256 for 3s on 256 size blocks: 2249393 sha256's in 3.00s Doing sha256 for 3s on 1024 size blocks: 693534 sha256's in 3.00s Doing sha256 for 3s on 8192 size blocks: 93103 sha256's in 3.00s OpenSSL 1.0.0s 11 Jun 2015 built on: Wed Nov 11 00:54:25 2015 options:bn(64,64) rc4(8x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) compiler: gcc -I. -I.. -I../include -DZLIB -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes sha256 48433.29k 110015.42k 191948.20k 236726.27k 254233.26k
ベンチマーク openssl 0.9.8zg
% env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl version % env OPENSSL_CONF=$PWD/apps/openssl.cnf apps/openssl speed sha256 program when this computer is idle. Doing sha256 for 3s on 16 size blocks: 5939600 sha256's in 3.00s Doing sha256 for 3s on 64 size blocks: 3998215 sha256's in 3.00s Doing sha256 for 3s on 256 size blocks: 1997856 sha256's in 3.00s Doing sha256 for 3s on 1024 size blocks: 668304 sha256's in 3.00s Doing sha256 for 3s on 8192 size blocks: 92625 sha256's in 3.00s OpenSSL 0.9.8zg 11 Jun 2015 built on: Wed Nov 11 00:51:47 JST 2015 options:bn(64,64) md2(int) rc4(8x,int) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx) compiler: gcc -DZLIB -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM available timing options: USE_TOD HZ=128 [sysconf value] timing function used: getrusage The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes sha256 31660.44k 85268.91k 170430.82k 228043.36k 252846.50k