Cutover to SecByteBlock member for AES (Issue 302, CVE-2016-7544)
parent
5a0a2187f2
commit
4c1b5472cc
|
|
@ -0,0 +1,218 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1><a href="http://www.cryptopp.com">Crypto++</a> 5.6.5 Benchmarks</H1>
|
||||
<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>
|
||||
CPU frequency of the test platform is 1.81899e+09 Hz.
|
||||
<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right><COL align=right><COL align=right>
|
||||
<THEAD><TR><TH>Algorithm<TH>MiB/Second<TH>Cycles Per Byte<TH>Microseconds to<br>Setup Key and IV<TH>Cycles to<br>Setup Key and IV
|
||||
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>AES/GCM (2K tables)<TD>217<TD>8.0<TD>0.796<TD>1448
|
||||
<TR><TH>AES/GCM (64K tables)<TD>234<TD>7.4<TD>3.726<TD>6778
|
||||
<TR><TH>AES/CCM (128-bit key)<TD>126<TD>13.8<TD>0.300<TD>545
|
||||
<TR><TH>AES/EAX (128-bit key)<TD>125<TD>13.8<TD>0.640<TD>1164
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>GMAC(AES) (2K tables)<TD>844<TD>2.1<TD>0.795<TD>1446
|
||||
<TR><TH>GMAC(AES) (64K tables)<TD>1232<TD>1.4<TD>3.752<TD>6825
|
||||
<TR><TH>VMAC(AES)-64 (128-bit key)<TD>7955<TD>0.2<TD>1.210<TD>2201
|
||||
<TR><TH>VMAC(AES)-128 (128-bit key)<TD>4223<TD>0.4<TD>1.462<TD>2659
|
||||
<TR><TH>HMAC(SHA-1) (128-bit key)<TD>272<TD>6.4<TD>0.242<TD>440
|
||||
<TR><TH>Two-Track-MAC (160-bit key)<TD>214<TD>8.1<TD>0.014<TD>26
|
||||
<TR><TH>CMAC(AES) (128-bit key)<TD>221<TD>7.9<TD>0.230<TD>418
|
||||
<TR><TH>DMAC(AES) (128-bit key)<TD>222<TD>7.8<TD>0.600<TD>1091
|
||||
<TR><TH>BLAKE2s (256-bit key)<TD>570<TD>3.0<TD>0.225<TD>409
|
||||
<TR><TH>BLAKE2b (512-bit key)<TD>758<TD>2.3<TD>0.263<TD>478
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>CRC32<TD>435<TD>4.0
|
||||
<TR><TH>CRC32C<TD>4230<TD>0.4
|
||||
<TR><TH>Adler32<TD>1315<TD>1.3
|
||||
<TR><TH>MD5<TD>529<TD>3.3
|
||||
<TR><TH>SHA-1<TD>273<TD>6.4
|
||||
<TR><TH>SHA-256<TD>186<TD>9.3
|
||||
<TR><TH>SHA-512<TD>235<TD>7.4
|
||||
<TR><TH>Keccak-224<TD>157<TD>11.0
|
||||
<TR><TH>Keccak-256<TD>148<TD>11.7
|
||||
<TR><TH>Keccak-384<TD>114<TD>15.3
|
||||
<TR><TH>Keccak-512<TD>78<TD>22.1
|
||||
<TR><TH>SHA3-224<TD>157<TD>11.0
|
||||
<TR><TH>SHA3-256<TD>149<TD>11.7
|
||||
<TR><TH>SHA3-384<TD>114<TD>15.3
|
||||
<TR><TH>SHA3-512<TD>79<TD>22.0
|
||||
<TR><TH>Tiger<TD>435<TD>4.0
|
||||
<TR><TH>Whirlpool<TD>135<TD>12.9
|
||||
<TR><TH>RIPEMD-160<TD>215<TD>8.1
|
||||
<TR><TH>RIPEMD-320<TD>232<TD>7.5
|
||||
<TR><TH>RIPEMD-128<TD>318<TD>5.5
|
||||
<TR><TH>RIPEMD-256<TD>344<TD>5.0
|
||||
<TR><TH>BLAKE2s<TD>548<TD>3.2
|
||||
<TR><TH>BLAKE2b<TD>757<TD>2.3
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>Panama-LE (256-bit key)<TD>1524<TD>1.1<TD>0.769<TD>1399
|
||||
<TR><TH>Panama-BE (256-bit key)<TD>680<TD>2.6<TD>1.443<TD>2625
|
||||
<TR><TH>Salsa20 (256-bit key)<TD>210<TD>8.3<TD>0.137<TD>249
|
||||
<TR><TH>Salsa20/12<TD>335<TD>5.2<TD>0.164<TD>298
|
||||
<TR><TH>Salsa20/8<TD>474<TD>3.7<TD>0.164<TD>298
|
||||
<TR><TH>ChaCha20 (256-bit key)<TD>327<TD>5.3<TD>0.089<TD>162
|
||||
<TR><TH>ChaCha12 (256-bit key)<TD>512<TD>3.4<TD>0.088<TD>160
|
||||
<TR><TH>ChaCha8 (256-bit key)<TD>726<TD>2.4<TD>0.090<TD>163
|
||||
<TR><TH>Sosemanuk (128-bit key)<TD>1266<TD>1.4<TD>0.458<TD>833
|
||||
<TR><TH>MARC4 (128-bit key)<TD>393<TD>4.4<TD>1.449<TD>2636
|
||||
<TR><TH>SEAL-3.0-LE (160-bit key)<TD>632<TD>2.7<TD>38.470<TD>69976
|
||||
<TR><TH>WAKE-OFB-LE (256-bit key)<TD>332<TD>5.2<TD>1.756<TD>3194
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>AES/CTR (128-bit key)<TD>285<TD>6.1<TD>0.243<TD>442
|
||||
<TR><TH>AES/CTR (192-bit key)<TD>235<TD>7.4<TD>0.242<TD>440
|
||||
<TR><TH>AES/CTR (256-bit key)<TD>200<TD>8.7<TD>0.256<TD>466
|
||||
<TR><TH>AES/CBC (128-bit key)<TD>221<TD>7.8<TD>0.184<TD>334
|
||||
<TR><TH>AES/CBC (192-bit key)<TD>189<TD>9.2<TD>0.186<TD>338
|
||||
<TR><TH>AES/CBC (256-bit key)<TD>165<TD>10.5<TD>0.201<TD>366
|
||||
<TR><TH>AES/OFB (128-bit key)<TD>213<TD>8.1<TD>0.231<TD>421
|
||||
<TR><TH>AES/CFB (128-bit key)<TD>219<TD>7.9<TD>0.342<TD>622
|
||||
<TR><TH>AES/ECB (128-bit key)<TD>231<TD>7.5<TD>0.092<TD>167
|
||||
<TR><TH>Camellia/CTR (128-bit key)<TD>117<TD>14.9<TD>0.224<TD>408
|
||||
<TR><TH>Camellia/CTR (256-bit key)<TD>92<TD>18.9<TD>0.249<TD>454
|
||||
<TR><TH>Twofish/CTR (128-bit key)<TD>146<TD>11.9<TD>2.542<TD>4623
|
||||
<TR><TH>Serpent/CTR (128-bit key)<TD>71<TD>24.6<TD>0.511<TD>930
|
||||
<TR><TH>CAST-256/CTR (128-bit key)<TD>73<TD>23.8<TD>1.252<TD>2278
|
||||
<TR><TH>RC6/CTR (128-bit key)<TD>119<TD>14.5<TD>2.008<TD>3653
|
||||
<TR><TH>MARS/CTR (128-bit key)<TD>85<TD>20.5<TD>1.501<TD>2730
|
||||
<TR><TH>SHACAL-2/CTR (128-bit key)<TD>114<TD>15.2<TD>0.305<TD>555
|
||||
<TR><TH>SHACAL-2/CTR (512-bit key)<TD>114<TD>15.2<TD>0.314<TD>571
|
||||
<TR><TH>DES/CTR (64-bit key)<TD>61<TD>28.5<TD>2.758<TD>5016
|
||||
<TR><TH>DES-XEX3/CTR (192-bit key)<TD>57<TD>30.4<TD>2.827<TD>5143
|
||||
<TR><TH>DES-EDE3/CTR (192-bit key)<TD>24<TD>73.2<TD>11.654<TD>21198
|
||||
<TR><TH>IDEA/CTR (128-bit key)<TD>71<TD>24.5<TD>0.255<TD>464
|
||||
<TR><TH>RC5 (r=16)<TD>105<TD>16.5<TD>1.612<TD>2933
|
||||
<TR><TH>Blowfish/CTR (128-bit key)<TD>105<TD>16.5<TD>36.799<TD>66936
|
||||
<TR><TH>TEA/CTR (128-bit key)<TD>58<TD>29.8<TD>0.204<TD>371
|
||||
<TR><TH>XTEA/CTR (128-bit key)<TD>58<TD>30.0<TD>0.204<TD>372
|
||||
<TR><TH>CAST-128/CTR (128-bit key)<TD>83<TD>20.8<TD>0.336<TD>612
|
||||
<TR><TH>SKIPJACK/CTR (80-bit key)<TD>35<TD>49.3<TD>1.835<TD>3338
|
||||
<TR><TH>SEED/CTR (1/2 K table)<TD>54<TD>32.2<TD>0.278<TD>505</TABLE>
|
||||
<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right>
|
||||
<THEAD><TR><TH>Operation<TH>Milliseconds/Operation<TH>Megacycles/Operation
|
||||
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>RSA 1024 Encryption<TD>0.02<TD>0.04
|
||||
<TR><TH>RSA 1024 Decryption<TD>0.34<TD>0.63
|
||||
<TR><TH>LUC 1024 Encryption<TD>0.02<TD>0.04
|
||||
<TR><TH>LUC 1024 Decryption<TD>0.56<TD>1.02
|
||||
<TR><TH>DLIES 1024 Encryption<TD>0.23<TD>0.42
|
||||
<TR><TH>DLIES 1024 Encryption with precomputation<TD>0.42<TD>0.77
|
||||
<TR><TH>DLIES 1024 Decryption<TD>0.33<TD>0.61
|
||||
<TR><TH>LUCELG 512 Encryption<TD>0.15<TD>0.27
|
||||
<TR><TH>LUCELG 512 Encryption with precomputation<TD>0.14<TD>0.26
|
||||
<TR><TH>LUCELG 512 Decryption<TD>0.16<TD>0.29
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>RSA 2048 Encryption<TD>0.04<TD>0.07
|
||||
<TR><TH>RSA 2048 Decryption<TD>1.56<TD>2.83
|
||||
<TR><TH>LUC 2048 Encryption<TD>0.05<TD>0.08
|
||||
<TR><TH>LUC 2048 Decryption<TD>2.60<TD>4.73
|
||||
<TR><TH>DLIES 2048 Encryption<TD>1.11<TD>2.01
|
||||
<TR><TH>DLIES 2048 Encryption with precomputation<TD>1.27<TD>2.30
|
||||
<TR><TH>DLIES 2048 Decryption<TD>1.07<TD>1.94
|
||||
<TR><TH>LUCELG 1024 Encryption<TD>0.51<TD>0.93
|
||||
<TR><TH>LUCELG 1024 Encryption with precomputation<TD>0.51<TD>0.93
|
||||
<TR><TH>LUCELG 1024 Decryption<TD>0.47<TD>0.85
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>RSA 1024 Signature<TD>0.34<TD>0.63
|
||||
<TR><TH>RSA 1024 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>RW 1024 Signature<TD>0.37<TD>0.67
|
||||
<TR><TH>RW 1024 Signature with precomputation<TD>0.37<TD>0.67
|
||||
<TR><TH>RW 1024 Verification<TD>0.01<TD>0.02
|
||||
<TR><TH>LUC 1024 Signature<TD>0.57<TD>1.04
|
||||
<TR><TH>LUC 1024 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>NR 1024 Signature<TD>0.12<TD>0.22
|
||||
<TR><TH>NR 1024 Signature with precomputation<TD>0.12<TD>0.21
|
||||
<TR><TH>NR 1024 Verification<TD>0.13<TD>0.24
|
||||
<TR><TH>NR 1024 Verification with precomputation<TD>0.18<TD>0.33
|
||||
<TR><TH>DSA 1024 Signature<TD>0.12<TD>0.23
|
||||
<TR><TH>DSA 1024 Signature with precomputation<TD>0.12<TD>0.22
|
||||
<TR><TH>DSA 1024 Verification<TD>0.14<TD>0.25
|
||||
<TR><TH>DSA 1024 Verification with precomputation<TD>0.19<TD>0.34
|
||||
<TR><TH>LUC-HMP 512 Signature<TD>0.14<TD>0.25
|
||||
<TR><TH>LUC-HMP 512 Signature with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>LUC-HMP 512 Verification<TD>0.14<TD>0.25
|
||||
<TR><TH>LUC-HMP 512 Verification with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>ESIGN 1023 Signature<TD>0.06<TD>0.10
|
||||
<TR><TH>ESIGN 1023 Verification<TD>0.02<TD>0.03
|
||||
<TR><TH>ESIGN 1536 Signature<TD>0.09<TD>0.17
|
||||
<TR><TH>ESIGN 1536 Verification<TD>0.03<TD>0.06
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>RSA 2048 Signature<TD>1.55<TD>2.81
|
||||
<TR><TH>RSA 2048 Verification<TD>0.04<TD>0.07
|
||||
<TR><TH>RW 2048 Signature<TD>1.60<TD>2.91
|
||||
<TR><TH>RW 2048 Signature with precomputation<TD>1.60<TD>2.91
|
||||
<TR><TH>RW 2048 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>LUC 2048 Signature<TD>2.57<TD>4.67
|
||||
<TR><TH>LUC 2048 Verification<TD>0.05<TD>0.08
|
||||
<TR><TH>NR 2048 Signature<TD>0.55<TD>1.01
|
||||
<TR><TH>NR 2048 Signature with precomputation<TD>0.27<TD>0.50
|
||||
<TR><TH>NR 2048 Verification<TD>0.62<TD>1.14
|
||||
<TR><TH>NR 2048 Verification with precomputation<TD>0.43<TD>0.78
|
||||
<TR><TH>LUC-HMP 1024 Signature<TD>0.50<TD>0.90
|
||||
<TR><TH>LUC-HMP 1024 Signature with precomputation<TD>0.49<TD>0.90
|
||||
<TR><TH>LUC-HMP 1024 Verification<TD>0.50<TD>0.91
|
||||
<TR><TH>LUC-HMP 1024 Verification with precomputation<TD>0.51<TD>0.93
|
||||
<TR><TH>ESIGN 2046 Signature<TD>0.12<TD>0.21
|
||||
<TR><TH>ESIGN 2046 Verification<TD>0.04<TD>0.07
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>XTR-DH 171 Key-Pair Generation<TD>0.17<TD>0.31
|
||||
<TR><TH>XTR-DH 171 Key Agreement<TD>0.33<TD>0.60
|
||||
<TR><TH>XTR-DH 342 Key-Pair Generation<TD>0.43<TD>0.79
|
||||
<TR><TH>XTR-DH 342 Key Agreement<TD>0.85<TD>1.54
|
||||
<TR><TH>DH 1024 Key-Pair Generation<TD>0.12<TD>0.21
|
||||
<TR><TH>DH 1024 Key-Pair Generation with precomputation<TD>0.21<TD>0.39
|
||||
<TR><TH>DH 1024 Key Agreement<TD>0.30<TD>0.54
|
||||
<TR><TH>DH 2048 Key-Pair Generation<TD>0.56<TD>1.02
|
||||
<TR><TH>DH 2048 Key-Pair Generation with precomputation<TD>0.63<TD>1.15
|
||||
<TR><TH>DH 2048 Key Agreement<TD>1.02<TD>1.86
|
||||
<TR><TH>LUCDIF 512 Key-Pair Generation<TD>0.07<TD>0.13
|
||||
<TR><TH>LUCDIF 512 Key-Pair Generation with precomputation<TD>0.07<TD>0.13
|
||||
<TR><TH>LUCDIF 512 Key Agreement<TD>0.15<TD>0.27
|
||||
<TR><TH>LUCDIF 1024 Key-Pair Generation<TD>0.25<TD>0.46
|
||||
<TR><TH>LUCDIF 1024 Key-Pair Generation with precomputation<TD>0.26<TD>0.47
|
||||
<TR><TH>LUCDIF 1024 Key Agreement<TD>0.43<TD>0.78
|
||||
<TR><TH>MQV 1024 Key-Pair Generation<TD>0.11<TD>0.20
|
||||
<TR><TH>MQV 1024 Key-Pair Generation with precomputation<TD>0.12<TD>0.21
|
||||
<TR><TH>MQV 1024 Key Agreement<TD>0.22<TD>0.41
|
||||
<TR><TH>MQV 2048 Key-Pair Generation<TD>0.54<TD>0.98
|
||||
<TR><TH>MQV 2048 Key-Pair Generation with precomputation<TD>0.27<TD>0.49
|
||||
<TR><TH>MQV 2048 Key Agreement<TD>1.00<TD>1.81
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>ECIES over GF(p) 256 Encryption<TD>1.40<TD>2.55
|
||||
<TR><TH>ECIES over GF(p) 256 Encryption with precomputation<TD>1.19<TD>2.17
|
||||
<TR><TH>ECIES over GF(p) 256 Decryption<TD>1.01<TD>1.83
|
||||
<TR><TH>ECDSA over GF(p) 256 Signature<TD>0.72<TD>1.30
|
||||
<TR><TH>ECDSA over GF(p) 256 Signature with precomputation<TD>0.61<TD>1.12
|
||||
<TR><TH>ECDSA over GF(p) 256 Verification<TD>2.49<TD>4.52
|
||||
<TR><TH>ECDSA over GF(p) 256 Verification with precomputation<TD>1.01<TD>1.84
|
||||
<TR><TH>ECDHC over GF(p) 256 Key-Pair Generation<TD>0.73<TD>1.32
|
||||
<TR><TH>ECDHC over GF(p) 256 Key-Pair Generation with precomputation<TD>0.62<TD>1.12
|
||||
<TR><TH>ECDHC over GF(p) 256 Key Agreement<TD>0.69<TD>1.26
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key-Pair Generation<TD>0.71<TD>1.29
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key-Pair Generation with precomputation<TD>0.61<TD>1.11
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key Agreement<TD>2.53<TD>4.60<TBODY style="background: yellow">
|
||||
|
||||
<TR><TH>ECIES over GF(2^n) 233 Encryption<TD>7.70<TD>14.00
|
||||
<TR><TH>ECIES over GF(2^n) 233 Encryption with precomputation<TD>2.12<TD>3.86
|
||||
<TR><TH>ECIES over GF(2^n) 233 Decryption<TD>4.39<TD>7.98
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Signature<TD>3.87<TD>7.04
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Signature with precomputation<TD>1.08<TD>1.97
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Verification<TD>4.83<TD>8.78
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Verification with precomputation<TD>1.77<TD>3.21
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key-Pair Generation<TD>3.93<TD>7.14
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key-Pair Generation with precomputation<TD>1.09<TD>1.98
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key Agreement<TD>4.07<TD>7.40
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key-Pair Generation<TD>3.88<TD>7.06
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key-Pair Generation with precomputation<TD>1.08<TD>1.97
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key Agreement<TD>4.88<TD>8.88</TABLE>
|
||||
Throughput Geometric Average: 990.021173
|
||||
|
||||
Test ended at Tue Sep 27 02:18:43 2016
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1><a href="http://www.cryptopp.com">Crypto++</a> 5.6.5 Benchmarks</H1>
|
||||
<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>
|
||||
CPU frequency of the test platform is 1.81899e+09 Hz.
|
||||
<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right><COL align=right><COL align=right>
|
||||
<THEAD><TR><TH>Algorithm<TH>MiB/Second<TH>Cycles Per Byte<TH>Microseconds to<br>Setup Key and IV<TH>Cycles to<br>Setup Key and IV
|
||||
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>AES/GCM (2K tables)<TD>218<TD>7.9<TD>0.769<TD>1399
|
||||
<TR><TH>AES/GCM (64K tables)<TD>235<TD>7.4<TD>3.677<TD>6689
|
||||
<TR><TH>AES/CCM (128-bit key)<TD>125<TD>13.9<TD>0.308<TD>560
|
||||
<TR><TH>AES/EAX (128-bit key)<TD>125<TD>13.8<TD>0.628<TD>1142
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>GMAC(AES) (2K tables)<TD>851<TD>2.0<TD>0.767<TD>1395
|
||||
<TR><TH>GMAC(AES) (64K tables)<TD>1234<TD>1.4<TD>3.678<TD>6690
|
||||
<TR><TH>VMAC(AES)-64 (128-bit key)<TD>7822<TD>0.2<TD>1.191<TD>2167
|
||||
<TR><TH>VMAC(AES)-128 (128-bit key)<TD>4186<TD>0.4<TD>1.439<TD>2617
|
||||
<TR><TH>HMAC(SHA-1) (128-bit key)<TD>264<TD>6.6<TD>0.260<TD>473
|
||||
<TR><TH>Two-Track-MAC (160-bit key)<TD>213<TD>8.2<TD>0.015<TD>27
|
||||
<TR><TH>CMAC(AES) (128-bit key)<TD>220<TD>7.9<TD>0.228<TD>415
|
||||
<TR><TH>DMAC(AES) (128-bit key)<TD>221<TD>7.8<TD>0.717<TD>1304
|
||||
<TR><TH>BLAKE2s (256-bit key)<TD>568<TD>3.1<TD>0.249<TD>453
|
||||
<TR><TH>BLAKE2b (512-bit key)<TD>752<TD>2.3<TD>0.301<TD>548
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>CRC32<TD>435<TD>4.0
|
||||
<TR><TH>CRC32C<TD>4258<TD>0.4
|
||||
<TR><TH>Adler32<TD>1316<TD>1.3
|
||||
<TR><TH>MD5<TD>531<TD>3.3
|
||||
<TR><TH>SHA-1<TD>267<TD>6.5
|
||||
<TR><TH>SHA-256<TD>186<TD>9.3
|
||||
<TR><TH>SHA-512<TD>234<TD>7.4
|
||||
<TR><TH>Keccak-224<TD>157<TD>11.0
|
||||
<TR><TH>Keccak-256<TD>149<TD>11.7
|
||||
<TR><TH>Keccak-384<TD>114<TD>15.2
|
||||
<TR><TH>Keccak-512<TD>79<TD>22.0
|
||||
<TR><TH>SHA3-224<TD>157<TD>11.0
|
||||
<TR><TH>SHA3-256<TD>149<TD>11.7
|
||||
<TR><TH>SHA3-384<TD>114<TD>15.2
|
||||
<TR><TH>SHA3-512<TD>79<TD>21.9
|
||||
<TR><TH>Tiger<TD>432<TD>4.0
|
||||
<TR><TH>Whirlpool<TD>134<TD>12.9
|
||||
<TR><TH>RIPEMD-160<TD>216<TD>8.0
|
||||
<TR><TH>RIPEMD-320<TD>232<TD>7.5
|
||||
<TR><TH>RIPEMD-128<TD>319<TD>5.4
|
||||
<TR><TH>RIPEMD-256<TD>344<TD>5.0
|
||||
<TR><TH>BLAKE2s<TD>569<TD>3.0
|
||||
<TR><TH>BLAKE2b<TD>753<TD>2.3
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>Panama-LE (256-bit key)<TD>1614<TD>1.1<TD>0.777<TD>1414
|
||||
<TR><TH>Panama-BE (256-bit key)<TD>685<TD>2.5<TD>1.428<TD>2597
|
||||
<TR><TH>Salsa20 (256-bit key)<TD>210<TD>8.3<TD>0.144<TD>261
|
||||
<TR><TH>Salsa20/12<TD>332<TD>5.2<TD>0.167<TD>303
|
||||
<TR><TH>Salsa20/8<TD>471<TD>3.7<TD>0.166<TD>301
|
||||
<TR><TH>ChaCha20 (256-bit key)<TD>324<TD>5.3<TD>0.090<TD>164
|
||||
<TR><TH>ChaCha12 (256-bit key)<TD>523<TD>3.3<TD>0.093<TD>169
|
||||
<TR><TH>ChaCha8 (256-bit key)<TD>712<TD>2.4<TD>0.092<TD>167
|
||||
<TR><TH>Sosemanuk (128-bit key)<TD>1261<TD>1.4<TD>0.474<TD>863
|
||||
<TR><TH>MARC4 (128-bit key)<TD>386<TD>4.5<TD>1.407<TD>2558
|
||||
<TR><TH>SEAL-3.0-LE (160-bit key)<TD>642<TD>2.7<TD>37.378<TD>67990
|
||||
<TR><TH>WAKE-OFB-LE (256-bit key)<TD>328<TD>5.3<TD>1.728<TD>3143
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>AES/CTR (128-bit key)<TD>289<TD>6.0<TD>0.243<TD>443
|
||||
<TR><TH>AES/CTR (192-bit key)<TD>239<TD>7.3<TD>0.246<TD>447
|
||||
<TR><TH>AES/CTR (256-bit key)<TD>201<TD>8.6<TD>0.261<TD>476
|
||||
<TR><TH>AES/CBC (128-bit key)<TD>221<TD>7.9<TD>0.185<TD>336
|
||||
<TR><TH>AES/CBC (192-bit key)<TD>189<TD>9.2<TD>0.187<TD>341
|
||||
<TR><TH>AES/CBC (256-bit key)<TD>164<TD>10.6<TD>0.203<TD>370
|
||||
<TR><TH>AES/OFB (128-bit key)<TD>214<TD>8.1<TD>0.236<TD>430
|
||||
<TR><TH>AES/CFB (128-bit key)<TD>220<TD>7.9<TD>0.345<TD>627
|
||||
<TR><TH>AES/ECB (128-bit key)<TD>230<TD>7.5<TD>0.093<TD>168
|
||||
<TR><TH>Camellia/CTR (128-bit key)<TD>117<TD>14.9<TD>0.228<TD>415
|
||||
<TR><TH>Camellia/CTR (256-bit key)<TD>92<TD>18.9<TD>0.252<TD>459
|
||||
<TR><TH>Twofish/CTR (128-bit key)<TD>145<TD>12.0<TD>2.580<TD>4693
|
||||
<TR><TH>Serpent/CTR (128-bit key)<TD>69<TD>25.1<TD>0.466<TD>848
|
||||
<TR><TH>CAST-256/CTR (128-bit key)<TD>74<TD>23.4<TD>1.229<TD>2235
|
||||
<TR><TH>RC6/CTR (128-bit key)<TD>121<TD>14.3<TD>2.033<TD>3699
|
||||
<TR><TH>MARS/CTR (128-bit key)<TD>83<TD>20.9<TD>1.508<TD>2743
|
||||
<TR><TH>SHACAL-2/CTR (128-bit key)<TD>114<TD>15.2<TD>0.311<TD>565
|
||||
<TR><TH>SHACAL-2/CTR (512-bit key)<TD>115<TD>15.1<TD>0.319<TD>581
|
||||
<TR><TH>DES/CTR (64-bit key)<TD>61<TD>28.3<TD>2.567<TD>4669
|
||||
<TR><TH>DES-XEX3/CTR (192-bit key)<TD>57<TD>30.3<TD>2.586<TD>4703
|
||||
<TR><TH>DES-EDE3/CTR (192-bit key)<TD>24<TD>73.3<TD>8.178<TD>14876
|
||||
<TR><TH>IDEA/CTR (128-bit key)<TD>71<TD>24.4<TD>0.260<TD>473
|
||||
<TR><TH>RC5 (r=16)<TD>105<TD>16.5<TD>1.586<TD>2885
|
||||
<TR><TH>Blowfish/CTR (128-bit key)<TD>105<TD>16.5<TD>36.777<TD>66898
|
||||
<TR><TH>TEA/CTR (128-bit key)<TD>59<TD>29.2<TD>0.212<TD>385
|
||||
<TR><TH>XTEA/CTR (128-bit key)<TD>58<TD>29.8<TD>0.212<TD>386
|
||||
<TR><TH>CAST-128/CTR (128-bit key)<TD>83<TD>20.9<TD>0.344<TD>626
|
||||
<TR><TH>SKIPJACK/CTR (80-bit key)<TD>36<TD>48.6<TD>1.823<TD>3317
|
||||
<TR><TH>SEED/CTR (1/2 K table)<TD>53<TD>32.4<TD>0.286<TD>520</TABLE>
|
||||
<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right>
|
||||
<THEAD><TR><TH>Operation<TH>Milliseconds/Operation<TH>Megacycles/Operation
|
||||
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>RSA 1024 Encryption<TD>0.02<TD>0.04
|
||||
<TR><TH>RSA 1024 Decryption<TD>0.34<TD>0.62
|
||||
<TR><TH>LUC 1024 Encryption<TD>0.02<TD>0.04
|
||||
<TR><TH>LUC 1024 Decryption<TD>0.55<TD>1.00
|
||||
<TR><TH>DLIES 1024 Encryption<TD>0.22<TD>0.41
|
||||
<TR><TH>DLIES 1024 Encryption with precomputation<TD>0.42<TD>0.76
|
||||
<TR><TH>DLIES 1024 Decryption<TD>0.31<TD>0.57
|
||||
<TR><TH>LUCELG 512 Encryption<TD>0.14<TD>0.25
|
||||
<TR><TH>LUCELG 512 Encryption with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>LUCELG 512 Decryption<TD>0.15<TD>0.27
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>RSA 2048 Encryption<TD>0.04<TD>0.07
|
||||
<TR><TH>RSA 2048 Decryption<TD>1.54<TD>2.80
|
||||
<TR><TH>LUC 2048 Encryption<TD>0.05<TD>0.08
|
||||
<TR><TH>LUC 2048 Decryption<TD>2.56<TD>4.67
|
||||
<TR><TH>DLIES 2048 Encryption<TD>1.07<TD>1.95
|
||||
<TR><TH>DLIES 2048 Encryption with precomputation<TD>1.22<TD>2.22
|
||||
<TR><TH>DLIES 2048 Decryption<TD>1.03<TD>1.88
|
||||
<TR><TH>LUCELG 1024 Encryption<TD>0.50<TD>0.90
|
||||
<TR><TH>LUCELG 1024 Encryption with precomputation<TD>0.49<TD>0.90
|
||||
<TR><TH>LUCELG 1024 Decryption<TD>0.43<TD>0.78
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>RSA 1024 Signature<TD>0.34<TD>0.62
|
||||
<TR><TH>RSA 1024 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>RW 1024 Signature<TD>0.37<TD>0.66
|
||||
<TR><TH>RW 1024 Signature with precomputation<TD>0.37<TD>0.67
|
||||
<TR><TH>RW 1024 Verification<TD>0.01<TD>0.02
|
||||
<TR><TH>LUC 1024 Signature<TD>0.55<TD>1.00
|
||||
<TR><TH>LUC 1024 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>NR 1024 Signature<TD>0.12<TD>0.21
|
||||
<TR><TH>NR 1024 Signature with precomputation<TD>0.12<TD>0.21
|
||||
<TR><TH>NR 1024 Verification<TD>0.13<TD>0.24
|
||||
<TR><TH>NR 1024 Verification with precomputation<TD>0.19<TD>0.34
|
||||
<TR><TH>DSA 1024 Signature<TD>0.12<TD>0.22
|
||||
<TR><TH>DSA 1024 Signature with precomputation<TD>0.12<TD>0.22
|
||||
<TR><TH>DSA 1024 Verification<TD>0.14<TD>0.25
|
||||
<TR><TH>DSA 1024 Verification with precomputation<TD>0.18<TD>0.34
|
||||
<TR><TH>LUC-HMP 512 Signature<TD>0.13<TD>0.24
|
||||
<TR><TH>LUC-HMP 512 Signature with precomputation<TD>0.13<TD>0.24
|
||||
<TR><TH>LUC-HMP 512 Verification<TD>0.13<TD>0.25
|
||||
<TR><TH>LUC-HMP 512 Verification with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>ESIGN 1023 Signature<TD>0.06<TD>0.11
|
||||
<TR><TH>ESIGN 1023 Verification<TD>0.02<TD>0.03
|
||||
<TR><TH>ESIGN 1536 Signature<TD>0.09<TD>0.17
|
||||
<TR><TH>ESIGN 1536 Verification<TD>0.03<TD>0.06
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>RSA 2048 Signature<TD>1.54<TD>2.81
|
||||
<TR><TH>RSA 2048 Verification<TD>0.04<TD>0.07
|
||||
<TR><TH>RW 2048 Signature<TD>1.58<TD>2.88
|
||||
<TR><TH>RW 2048 Signature with precomputation<TD>1.59<TD>2.89
|
||||
<TR><TH>RW 2048 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>LUC 2048 Signature<TD>2.57<TD>4.68
|
||||
<TR><TH>LUC 2048 Verification<TD>0.04<TD>0.08
|
||||
<TR><TH>NR 2048 Signature<TD>0.54<TD>0.99
|
||||
<TR><TH>NR 2048 Signature with precomputation<TD>0.27<TD>0.50
|
||||
<TR><TH>NR 2048 Verification<TD>0.61<TD>1.11
|
||||
<TR><TH>NR 2048 Verification with precomputation<TD>0.43<TD>0.79
|
||||
<TR><TH>LUC-HMP 1024 Signature<TD>0.49<TD>0.90
|
||||
<TR><TH>LUC-HMP 1024 Signature with precomputation<TD>0.50<TD>0.91
|
||||
<TR><TH>LUC-HMP 1024 Verification<TD>0.50<TD>0.91
|
||||
<TR><TH>LUC-HMP 1024 Verification with precomputation<TD>0.50<TD>0.91
|
||||
<TR><TH>ESIGN 2046 Signature<TD>0.12<TD>0.21
|
||||
<TR><TH>ESIGN 2046 Verification<TD>0.04<TD>0.06
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>XTR-DH 171 Key-Pair Generation<TD>0.16<TD>0.30
|
||||
<TR><TH>XTR-DH 171 Key Agreement<TD>0.32<TD>0.59
|
||||
<TR><TH>XTR-DH 342 Key-Pair Generation<TD>0.42<TD>0.77
|
||||
<TR><TH>XTR-DH 342 Key Agreement<TD>0.85<TD>1.54
|
||||
<TR><TH>DH 1024 Key-Pair Generation<TD>0.12<TD>0.21
|
||||
<TR><TH>DH 1024 Key-Pair Generation with precomputation<TD>0.22<TD>0.39
|
||||
<TR><TH>DH 1024 Key Agreement<TD>0.31<TD>0.56
|
||||
<TR><TH>DH 2048 Key-Pair Generation<TD>0.55<TD>1.00
|
||||
<TR><TH>DH 2048 Key-Pair Generation with precomputation<TD>0.63<TD>1.15
|
||||
<TR><TH>DH 2048 Key Agreement<TD>1.04<TD>1.90
|
||||
<TR><TH>LUCDIF 512 Key-Pair Generation<TD>0.07<TD>0.13
|
||||
<TR><TH>LUCDIF 512 Key-Pair Generation with precomputation<TD>0.07<TD>0.13
|
||||
<TR><TH>LUCDIF 512 Key Agreement<TD>0.15<TD>0.27
|
||||
<TR><TH>LUCDIF 1024 Key-Pair Generation<TD>0.26<TD>0.47
|
||||
<TR><TH>LUCDIF 1024 Key-Pair Generation with precomputation<TD>0.25<TD>0.46
|
||||
<TR><TH>LUCDIF 1024 Key Agreement<TD>0.43<TD>0.79
|
||||
<TR><TH>MQV 1024 Key-Pair Generation<TD>0.12<TD>0.21
|
||||
<TR><TH>MQV 1024 Key-Pair Generation with precomputation<TD>0.11<TD>0.21
|
||||
<TR><TH>MQV 1024 Key Agreement<TD>0.22<TD>0.41
|
||||
<TR><TH>MQV 2048 Key-Pair Generation<TD>0.55<TD>1.00
|
||||
<TR><TH>MQV 2048 Key-Pair Generation with precomputation<TD>0.27<TD>0.49
|
||||
<TR><TH>MQV 2048 Key Agreement<TD>0.99<TD>1.79
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>ECIES over GF(p) 256 Encryption<TD>1.40<TD>2.55
|
||||
<TR><TH>ECIES over GF(p) 256 Encryption with precomputation<TD>1.18<TD>2.15
|
||||
<TR><TH>ECIES over GF(p) 256 Decryption<TD>0.99<TD>1.80
|
||||
<TR><TH>ECDSA over GF(p) 256 Signature<TD>0.71<TD>1.30
|
||||
<TR><TH>ECDSA over GF(p) 256 Signature with precomputation<TD>0.61<TD>1.11
|
||||
<TR><TH>ECDSA over GF(p) 256 Verification<TD>2.49<TD>4.53
|
||||
<TR><TH>ECDSA over GF(p) 256 Verification with precomputation<TD>1.01<TD>1.83
|
||||
<TR><TH>ECDHC over GF(p) 256 Key-Pair Generation<TD>0.70<TD>1.27
|
||||
<TR><TH>ECDHC over GF(p) 256 Key-Pair Generation with precomputation<TD>0.60<TD>1.09
|
||||
<TR><TH>ECDHC over GF(p) 256 Key Agreement<TD>0.72<TD>1.31
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key-Pair Generation<TD>0.70<TD>1.28
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key-Pair Generation with precomputation<TD>0.60<TD>1.08
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key Agreement<TD>2.48<TD>4.51<TBODY style="background: yellow">
|
||||
|
||||
<TR><TH>ECIES over GF(2^n) 233 Encryption<TD>7.71<TD>14.03
|
||||
<TR><TH>ECIES over GF(2^n) 233 Encryption with precomputation<TD>2.13<TD>3.87
|
||||
<TR><TH>ECIES over GF(2^n) 233 Decryption<TD>4.34<TD>7.90
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Signature<TD>3.88<TD>7.07
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Signature with precomputation<TD>1.09<TD>1.98
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Verification<TD>4.71<TD>8.57
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Verification with precomputation<TD>1.83<TD>3.33
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key-Pair Generation<TD>3.83<TD>6.97
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key-Pair Generation with precomputation<TD>1.07<TD>1.94
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key Agreement<TD>3.90<TD>7.09
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key-Pair Generation<TD>3.84<TD>6.98
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key-Pair Generation with precomputation<TD>1.06<TD>1.93
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key Agreement<TD>4.81<TD>8.75</TABLE>
|
||||
Throughput Geometric Average: 997.032044
|
||||
|
||||
Test ended at Tue Sep 27 01:43:06 2016
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1><a href="http://www.cryptopp.com">Crypto++</a> 5.6.5 Benchmarks</H1>
|
||||
<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>
|
||||
CPU frequency of the test platform is 1.81899e+09 Hz.
|
||||
<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right><COL align=right><COL align=right>
|
||||
<THEAD><TR><TH>Algorithm<TH>MiB/Second<TH>Cycles Per Byte<TH>Microseconds to<br>Setup Key and IV<TH>Cycles to<br>Setup Key and IV
|
||||
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>AES/GCM<TD>887<TD>2.0<TD>0.491<TD>893
|
||||
<TR><TH>AES/CCM (128-bit key)<TD>452<TD>3.8<TD>0.311<TD>565
|
||||
<TR><TH>AES/EAX (128-bit key)<TD>460<TD>3.8<TD>0.400<TD>728
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>GMAC(AES)<TD>1505<TD>1.2<TD>0.493<TD>896
|
||||
<TR><TH>VMAC(AES)-64 (128-bit key)<TD>7744<TD>0.2<TD>0.653<TD>1188
|
||||
<TR><TH>VMAC(AES)-128 (128-bit key)<TD>4007<TD>0.4<TD>0.740<TD>1346
|
||||
<TR><TH>HMAC(SHA-1) (128-bit key)<TD>268<TD>6.5<TD>0.259<TD>472
|
||||
<TR><TH>Two-Track-MAC (160-bit key)<TD>211<TD>8.2<TD>0.015<TD>28
|
||||
<TR><TH>CMAC(AES) (128-bit key)<TD>584<TD>3.0<TD>0.153<TD>278
|
||||
<TR><TH>DMAC(AES) (128-bit key)<TD>583<TD>3.0<TD>0.431<TD>784
|
||||
<TR><TH>BLAKE2s (256-bit key)<TD>569<TD>3.0<TD>0.250<TD>455
|
||||
<TR><TH>BLAKE2b (512-bit key)<TD>751<TD>2.3<TD>0.295<TD>536
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>CRC32<TD>425<TD>4.1
|
||||
<TR><TH>CRC32C<TD>4124<TD>0.4
|
||||
<TR><TH>Adler32<TD>1281<TD>1.4
|
||||
<TR><TH>MD5<TD>528<TD>3.3
|
||||
<TR><TH>SHA-1<TD>265<TD>6.5
|
||||
<TR><TH>SHA-256<TD>181<TD>9.6
|
||||
<TR><TH>SHA-512<TD>229<TD>7.6
|
||||
<TR><TH>Keccak-224<TD>151<TD>11.5
|
||||
<TR><TH>Keccak-256<TD>147<TD>11.8
|
||||
<TR><TH>Keccak-384<TD>112<TD>15.5
|
||||
<TR><TH>Keccak-512<TD>79<TD>22.0
|
||||
<TR><TH>SHA3-224<TD>158<TD>11.0
|
||||
<TR><TH>SHA3-256<TD>148<TD>11.7
|
||||
<TR><TH>SHA3-384<TD>114<TD>15.2
|
||||
<TR><TH>SHA3-512<TD>79<TD>21.9
|
||||
<TR><TH>Tiger<TD>436<TD>4.0
|
||||
<TR><TH>Whirlpool<TD>135<TD>12.9
|
||||
<TR><TH>RIPEMD-160<TD>217<TD>8.0
|
||||
<TR><TH>RIPEMD-320<TD>233<TD>7.5
|
||||
<TR><TH>RIPEMD-128<TD>318<TD>5.5
|
||||
<TR><TH>RIPEMD-256<TD>346<TD>5.0
|
||||
<TR><TH>BLAKE2s<TD>570<TD>3.0
|
||||
<TR><TH>BLAKE2b<TD>745<TD>2.3
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>Panama-LE (256-bit key)<TD>1606<TD>1.1<TD>0.771<TD>1403
|
||||
<TR><TH>Panama-BE (256-bit key)<TD>640<TD>2.7<TD>1.425<TD>2592
|
||||
<TR><TH>Salsa20 (256-bit key)<TD>210<TD>8.3<TD>0.141<TD>256
|
||||
<TR><TH>Salsa20/12<TD>334<TD>5.2<TD>0.171<TD>311
|
||||
<TR><TH>Salsa20/8<TD>478<TD>3.6<TD>0.175<TD>318
|
||||
<TR><TH>ChaCha20 (256-bit key)<TD>317<TD>5.5<TD>0.095<TD>172
|
||||
<TR><TH>ChaCha12 (256-bit key)<TD>517<TD>3.4<TD>0.093<TD>169
|
||||
<TR><TH>ChaCha8 (256-bit key)<TD>713<TD>2.4<TD>0.093<TD>169
|
||||
<TR><TH>Sosemanuk (128-bit key)<TD>1269<TD>1.4<TD>0.457<TD>830
|
||||
<TR><TH>MARC4 (128-bit key)<TD>395<TD>4.4<TD>1.397<TD>2541
|
||||
<TR><TH>SEAL-3.0-LE (160-bit key)<TD>651<TD>2.7<TD>37.303<TD>67855
|
||||
<TR><TH>WAKE-OFB-LE (256-bit key)<TD>334<TD>5.2<TD>1.725<TD>3137
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>AES/CTR (128-bit key)<TD>2350<TD>0.7<TD>0.236<TD>430
|
||||
<TR><TH>AES/CTR (192-bit key)<TD>2000<TD>0.9<TD>0.228<TD>415
|
||||
<TR><TH>AES/CTR (256-bit key)<TD>1736<TD>1.0<TD>0.248<TD>451
|
||||
<TR><TH>AES/CBC (128-bit key)<TD>590<TD>2.9<TD>0.180<TD>327
|
||||
<TR><TH>AES/CBC (192-bit key)<TD>499<TD>3.5<TD>0.170<TD>310
|
||||
<TR><TH>AES/CBC (256-bit key)<TD>433<TD>4.0<TD>0.190<TD>345
|
||||
<TR><TH>AES/OFB (128-bit key)<TD>553<TD>3.1<TD>0.232<TD>422
|
||||
<TR><TH>AES/CFB (128-bit key)<TD>574<TD>3.0<TD>0.258<TD>469
|
||||
<TR><TH>AES/ECB (128-bit key)<TD>2824<TD>0.6<TD>0.083<TD>151
|
||||
<TR><TH>Camellia/CTR (128-bit key)<TD>116<TD>14.9<TD>0.229<TD>416
|
||||
<TR><TH>Camellia/CTR (256-bit key)<TD>92<TD>18.9<TD>0.253<TD>460
|
||||
<TR><TH>Twofish/CTR (128-bit key)<TD>146<TD>11.9<TD>2.531<TD>4604
|
||||
<TR><TH>Serpent/CTR (128-bit key)<TD>71<TD>24.5<TD>0.461<TD>838
|
||||
<TR><TH>CAST-256/CTR (128-bit key)<TD>75<TD>23.3<TD>1.222<TD>2223
|
||||
<TR><TH>RC6/CTR (128-bit key)<TD>121<TD>14.3<TD>2.120<TD>3857
|
||||
<TR><TH>MARS/CTR (128-bit key)<TD>85<TD>20.4<TD>1.489<TD>2708
|
||||
<TR><TH>SHACAL-2/CTR (128-bit key)<TD>114<TD>15.2<TD>0.312<TD>568
|
||||
<TR><TH>SHACAL-2/CTR (512-bit key)<TD>115<TD>15.1<TD>0.318<TD>578
|
||||
<TR><TH>DES/CTR (64-bit key)<TD>61<TD>28.4<TD>2.570<TD>4674
|
||||
<TR><TH>DES-XEX3/CTR (192-bit key)<TD>57<TD>30.4<TD>2.593<TD>4716
|
||||
<TR><TH>DES-EDE3/CTR (192-bit key)<TD>24<TD>73.4<TD>8.212<TD>14938
|
||||
<TR><TH>IDEA/CTR (128-bit key)<TD>71<TD>24.4<TD>0.261<TD>474
|
||||
<TR><TH>RC5 (r=16)<TD>102<TD>17.0<TD>1.702<TD>3096
|
||||
<TR><TH>Blowfish/CTR (128-bit key)<TD>103<TD>16.8<TD>36.860<TD>67048
|
||||
<TR><TH>TEA/CTR (128-bit key)<TD>59<TD>29.5<TD>0.230<TD>418
|
||||
<TR><TH>XTEA/CTR (128-bit key)<TD>58<TD>29.9<TD>0.230<TD>419
|
||||
<TR><TH>CAST-128/CTR (128-bit key)<TD>83<TD>20.9<TD>0.344<TD>625
|
||||
<TR><TH>SKIPJACK/CTR (80-bit key)<TD>35<TD>49.1<TD>1.850<TD>3366
|
||||
<TR><TH>SEED/CTR (1/2 K table)<TD>54<TD>32.3<TD>0.282<TD>514</TABLE>
|
||||
<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right>
|
||||
<THEAD><TR><TH>Operation<TH>Milliseconds/Operation<TH>Megacycles/Operation
|
||||
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>RSA 1024 Encryption<TD>0.02<TD>0.04
|
||||
<TR><TH>RSA 1024 Decryption<TD>0.34<TD>0.62
|
||||
<TR><TH>LUC 1024 Encryption<TD>0.02<TD>0.04
|
||||
<TR><TH>LUC 1024 Decryption<TD>0.56<TD>1.02
|
||||
<TR><TH>DLIES 1024 Encryption<TD>0.23<TD>0.41
|
||||
<TR><TH>DLIES 1024 Encryption with precomputation<TD>0.42<TD>0.77
|
||||
<TR><TH>DLIES 1024 Decryption<TD>0.32<TD>0.59
|
||||
<TR><TH>LUCELG 512 Encryption<TD>0.14<TD>0.25
|
||||
<TR><TH>LUCELG 512 Encryption with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>LUCELG 512 Decryption<TD>0.15<TD>0.27
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>RSA 2048 Encryption<TD>0.04<TD>0.07
|
||||
<TR><TH>RSA 2048 Decryption<TD>1.57<TD>2.85
|
||||
<TR><TH>LUC 2048 Encryption<TD>0.05<TD>0.08
|
||||
<TR><TH>LUC 2048 Decryption<TD>2.54<TD>4.62
|
||||
<TR><TH>DLIES 2048 Encryption<TD>1.09<TD>1.98
|
||||
<TR><TH>DLIES 2048 Encryption with precomputation<TD>1.25<TD>2.27
|
||||
<TR><TH>DLIES 2048 Decryption<TD>1.04<TD>1.90
|
||||
<TR><TH>LUCELG 1024 Encryption<TD>0.50<TD>0.91
|
||||
<TR><TH>LUCELG 1024 Encryption with precomputation<TD>0.50<TD>0.90
|
||||
<TR><TH>LUCELG 1024 Decryption<TD>0.43<TD>0.78
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>RSA 1024 Signature<TD>0.35<TD>0.63
|
||||
<TR><TH>RSA 1024 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>RW 1024 Signature<TD>0.37<TD>0.68
|
||||
<TR><TH>RW 1024 Signature with precomputation<TD>0.37<TD>0.67
|
||||
<TR><TH>RW 1024 Verification<TD>0.01<TD>0.02
|
||||
<TR><TH>LUC 1024 Signature<TD>0.56<TD>1.02
|
||||
<TR><TH>LUC 1024 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>NR 1024 Signature<TD>0.12<TD>0.22
|
||||
<TR><TH>NR 1024 Signature with precomputation<TD>0.12<TD>0.22
|
||||
<TR><TH>NR 1024 Verification<TD>0.13<TD>0.24
|
||||
<TR><TH>NR 1024 Verification with precomputation<TD>0.19<TD>0.34
|
||||
<TR><TH>DSA 1024 Signature<TD>0.12<TD>0.22
|
||||
<TR><TH>DSA 1024 Signature with precomputation<TD>0.12<TD>0.22
|
||||
<TR><TH>DSA 1024 Verification<TD>0.13<TD>0.24
|
||||
<TR><TH>DSA 1024 Verification with precomputation<TD>0.19<TD>0.35
|
||||
<TR><TH>LUC-HMP 512 Signature<TD>0.14<TD>0.25
|
||||
<TR><TH>LUC-HMP 512 Signature with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>LUC-HMP 512 Verification<TD>0.14<TD>0.25
|
||||
<TR><TH>LUC-HMP 512 Verification with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>ESIGN 1023 Signature<TD>0.06<TD>0.11
|
||||
<TR><TH>ESIGN 1023 Verification<TD>0.02<TD>0.03
|
||||
<TR><TH>ESIGN 1536 Signature<TD>0.10<TD>0.17
|
||||
<TR><TH>ESIGN 1536 Verification<TD>0.03<TD>0.06
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>RSA 2048 Signature<TD>1.60<TD>2.91
|
||||
<TR><TH>RSA 2048 Verification<TD>0.04<TD>0.07
|
||||
<TR><TH>RW 2048 Signature<TD>1.64<TD>2.98
|
||||
<TR><TH>RW 2048 Signature with precomputation<TD>1.67<TD>3.04
|
||||
<TR><TH>RW 2048 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>LUC 2048 Signature<TD>2.60<TD>4.74
|
||||
<TR><TH>LUC 2048 Verification<TD>0.05<TD>0.08
|
||||
<TR><TH>NR 2048 Signature<TD>0.57<TD>1.03
|
||||
<TR><TH>NR 2048 Signature with precomputation<TD>0.28<TD>0.51
|
||||
<TR><TH>NR 2048 Verification<TD>0.63<TD>1.14
|
||||
<TR><TH>NR 2048 Verification with precomputation<TD>0.41<TD>0.74
|
||||
<TR><TH>LUC-HMP 1024 Signature<TD>0.50<TD>0.90
|
||||
<TR><TH>LUC-HMP 1024 Signature with precomputation<TD>0.52<TD>0.94
|
||||
<TR><TH>LUC-HMP 1024 Verification<TD>0.51<TD>0.92
|
||||
<TR><TH>LUC-HMP 1024 Verification with precomputation<TD>0.51<TD>0.92
|
||||
<TR><TH>ESIGN 2046 Signature<TD>0.12<TD>0.21
|
||||
<TR><TH>ESIGN 2046 Verification<TD>0.04<TD>0.07
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>XTR-DH 171 Key-Pair Generation<TD>0.17<TD>0.31
|
||||
<TR><TH>XTR-DH 171 Key Agreement<TD>0.33<TD>0.61
|
||||
<TR><TH>XTR-DH 342 Key-Pair Generation<TD>0.44<TD>0.79
|
||||
<TR><TH>XTR-DH 342 Key Agreement<TD>0.88<TD>1.59
|
||||
<TR><TH>DH 1024 Key-Pair Generation<TD>0.12<TD>0.22
|
||||
<TR><TH>DH 1024 Key-Pair Generation with precomputation<TD>0.22<TD>0.40
|
||||
<TR><TH>DH 1024 Key Agreement<TD>0.33<TD>0.60
|
||||
<TR><TH>DH 2048 Key-Pair Generation<TD>0.56<TD>1.02
|
||||
<TR><TH>DH 2048 Key-Pair Generation with precomputation<TD>0.64<TD>1.16
|
||||
<TR><TH>DH 2048 Key Agreement<TD>1.05<TD>1.91
|
||||
<TR><TH>LUCDIF 512 Key-Pair Generation<TD>0.07<TD>0.13
|
||||
<TR><TH>LUCDIF 512 Key-Pair Generation with precomputation<TD>0.07<TD>0.13
|
||||
<TR><TH>LUCDIF 512 Key Agreement<TD>0.15<TD>0.27
|
||||
<TR><TH>LUCDIF 1024 Key-Pair Generation<TD>0.25<TD>0.46
|
||||
<TR><TH>LUCDIF 1024 Key-Pair Generation with precomputation<TD>0.25<TD>0.46
|
||||
<TR><TH>LUCDIF 1024 Key Agreement<TD>0.43<TD>0.79
|
||||
<TR><TH>MQV 1024 Key-Pair Generation<TD>0.11<TD>0.21
|
||||
<TR><TH>MQV 1024 Key-Pair Generation with precomputation<TD>0.11<TD>0.20
|
||||
<TR><TH>MQV 1024 Key Agreement<TD>0.22<TD>0.41
|
||||
<TR><TH>MQV 2048 Key-Pair Generation<TD>0.55<TD>1.00
|
||||
<TR><TH>MQV 2048 Key-Pair Generation with precomputation<TD>0.27<TD>0.49
|
||||
<TR><TH>MQV 2048 Key Agreement<TD>1.01<TD>1.85
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>ECIES over GF(p) 256 Encryption<TD>1.41<TD>2.56
|
||||
<TR><TH>ECIES over GF(p) 256 Encryption with precomputation<TD>1.20<TD>2.18
|
||||
<TR><TH>ECIES over GF(p) 256 Decryption<TD>0.99<TD>1.79
|
||||
<TR><TH>ECDSA over GF(p) 256 Signature<TD>0.72<TD>1.31
|
||||
<TR><TH>ECDSA over GF(p) 256 Signature with precomputation<TD>0.61<TD>1.12
|
||||
<TR><TH>ECDSA over GF(p) 256 Verification<TD>2.50<TD>4.54
|
||||
<TR><TH>ECDSA over GF(p) 256 Verification with precomputation<TD>1.00<TD>1.82
|
||||
<TR><TH>ECDHC over GF(p) 256 Key-Pair Generation<TD>0.71<TD>1.28
|
||||
<TR><TH>ECDHC over GF(p) 256 Key-Pair Generation with precomputation<TD>0.62<TD>1.13
|
||||
<TR><TH>ECDHC over GF(p) 256 Key Agreement<TD>0.72<TD>1.31
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key-Pair Generation<TD>0.71<TD>1.29
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key-Pair Generation with precomputation<TD>0.60<TD>1.09
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key Agreement<TD>2.54<TD>4.62<TBODY style="background: yellow">
|
||||
|
||||
<TR><TH>ECIES over GF(2^n) 233 Encryption<TD>7.77<TD>14.13
|
||||
<TR><TH>ECIES over GF(2^n) 233 Encryption with precomputation<TD>2.14<TD>3.89
|
||||
<TR><TH>ECIES over GF(2^n) 233 Decryption<TD>4.42<TD>8.04
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Signature<TD>3.94<TD>7.16
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Signature with precomputation<TD>1.08<TD>1.97
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Verification<TD>4.85<TD>8.83
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Verification with precomputation<TD>1.79<TD>3.25
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key-Pair Generation<TD>3.89<TD>7.08
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key-Pair Generation with precomputation<TD>1.07<TD>1.95
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key Agreement<TD>3.93<TD>7.15
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key-Pair Generation<TD>3.88<TD>7.05
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key-Pair Generation with precomputation<TD>1.08<TD>1.96
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key Agreement<TD>4.90<TD>8.91</TABLE>
|
||||
Throughput Geometric Average: 1110.724645
|
||||
|
||||
Test ended at Mon Sep 26 23:32:16 2016
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1><a href="http://www.cryptopp.com">Crypto++</a> 5.6.5 Benchmarks</H1>
|
||||
<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>
|
||||
CPU frequency of the test platform is 1.81899e+09 Hz.
|
||||
<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right><COL align=right><COL align=right>
|
||||
<THEAD><TR><TH>Algorithm<TH>MiB/Second<TH>Cycles Per Byte<TH>Microseconds to<br>Setup Key and IV<TH>Cycles to<br>Setup Key and IV
|
||||
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>AES/GCM (2K tables)<TD>218<TD>8.0<TD>0.761<TD>1383
|
||||
<TR><TH>AES/GCM (64K tables)<TD>231<TD>7.5<TD>3.776<TD>6868
|
||||
<TR><TH>AES/CCM (128-bit key)<TD>126<TD>13.8<TD>0.319<TD>580
|
||||
<TR><TH>AES/EAX (128-bit key)<TD>125<TD>13.8<TD>0.643<TD>1169
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>GMAC(AES) (2K tables)<TD>852<TD>2.0<TD>0.761<TD>1384
|
||||
<TR><TH>GMAC(AES) (64K tables)<TD>1233<TD>1.4<TD>3.704<TD>6737
|
||||
<TR><TH>VMAC(AES)-64 (128-bit key)<TD>7953<TD>0.2<TD>1.158<TD>2107
|
||||
<TR><TH>VMAC(AES)-128 (128-bit key)<TD>4197<TD>0.4<TD>1.424<TD>2591
|
||||
<TR><TH>HMAC(SHA-1) (128-bit key)<TD>276<TD>6.3<TD>0.258<TD>470
|
||||
<TR><TH>Two-Track-MAC (160-bit key)<TD>215<TD>8.1<TD>0.014<TD>26
|
||||
<TR><TH>CMAC(AES) (128-bit key)<TD>220<TD>7.9<TD>0.226<TD>412
|
||||
<TR><TH>DMAC(AES) (128-bit key)<TD>221<TD>7.8<TD>0.847<TD>1541
|
||||
<TR><TH>BLAKE2s (256-bit key)<TD>568<TD>3.1<TD>0.224<TD>407
|
||||
<TR><TH>BLAKE2b (512-bit key)<TD>773<TD>2.2<TD>0.273<TD>496
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>CRC32<TD>434<TD>4.0
|
||||
<TR><TH>CRC32C<TD>4264<TD>0.4
|
||||
<TR><TH>Adler32<TD>1310<TD>1.3
|
||||
<TR><TH>MD5<TD>529<TD>3.3
|
||||
<TR><TH>SHA-1<TD>275<TD>6.3
|
||||
<TR><TH>SHA-256<TD>186<TD>9.4
|
||||
<TR><TH>SHA-512<TD>234<TD>7.4
|
||||
<TR><TH>Keccak-224<TD>158<TD>11.0
|
||||
<TR><TH>Keccak-256<TD>149<TD>11.6
|
||||
<TR><TH>Keccak-384<TD>114<TD>15.2
|
||||
<TR><TH>Keccak-512<TD>79<TD>21.9
|
||||
<TR><TH>SHA3-224<TD>158<TD>11.0
|
||||
<TR><TH>SHA3-256<TD>149<TD>11.7
|
||||
<TR><TH>SHA3-384<TD>114<TD>15.2
|
||||
<TR><TH>SHA3-512<TD>79<TD>21.9
|
||||
<TR><TH>Tiger<TD>435<TD>4.0
|
||||
<TR><TH>Whirlpool<TD>134<TD>13.0
|
||||
<TR><TH>RIPEMD-160<TD>215<TD>8.1
|
||||
<TR><TH>RIPEMD-320<TD>233<TD>7.5
|
||||
<TR><TH>RIPEMD-128<TD>318<TD>5.5
|
||||
<TR><TH>RIPEMD-256<TD>345<TD>5.0
|
||||
<TR><TH>BLAKE2s<TD>569<TD>3.0
|
||||
<TR><TH>BLAKE2b<TD>761<TD>2.3
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>Panama-LE (256-bit key)<TD>1603<TD>1.1<TD>0.770<TD>1401
|
||||
<TR><TH>Panama-BE (256-bit key)<TD>688<TD>2.5<TD>1.423<TD>2588
|
||||
<TR><TH>Salsa20 (256-bit key)<TD>209<TD>8.3<TD>0.132<TD>240
|
||||
<TR><TH>Salsa20/12<TD>335<TD>5.2<TD>0.161<TD>293
|
||||
<TR><TH>Salsa20/8<TD>477<TD>3.6<TD>0.161<TD>293
|
||||
<TR><TH>ChaCha20 (256-bit key)<TD>328<TD>5.3<TD>0.087<TD>158
|
||||
<TR><TH>ChaCha12 (256-bit key)<TD>509<TD>3.4<TD>0.087<TD>159
|
||||
<TR><TH>ChaCha8 (256-bit key)<TD>725<TD>2.4<TD>0.088<TD>159
|
||||
<TR><TH>Sosemanuk (128-bit key)<TD>1262<TD>1.4<TD>0.453<TD>825
|
||||
<TR><TH>MARC4 (128-bit key)<TD>395<TD>4.4<TD>1.402<TD>2550
|
||||
<TR><TH>SEAL-3.0-LE (160-bit key)<TD>651<TD>2.7<TD>37.322<TD>67889
|
||||
<TR><TH>WAKE-OFB-LE (256-bit key)<TD>329<TD>5.3<TD>1.718<TD>3125
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>AES/CTR (128-bit key)<TD>294<TD>5.9<TD>0.237<TD>431
|
||||
<TR><TH>AES/CTR (192-bit key)<TD>240<TD>7.2<TD>0.239<TD>435
|
||||
<TR><TH>AES/CTR (256-bit key)<TD>203<TD>8.6<TD>0.255<TD>464
|
||||
<TR><TH>AES/CBC (128-bit key)<TD>222<TD>7.8<TD>0.181<TD>330
|
||||
<TR><TH>AES/CBC (192-bit key)<TD>189<TD>9.2<TD>0.184<TD>334
|
||||
<TR><TH>AES/CBC (256-bit key)<TD>165<TD>10.5<TD>0.201<TD>366
|
||||
<TR><TH>AES/OFB (128-bit key)<TD>214<TD>8.1<TD>0.232<TD>422
|
||||
<TR><TH>AES/CFB (128-bit key)<TD>220<TD>7.9<TD>0.333<TD>606
|
||||
<TR><TH>AES/ECB (128-bit key)<TD>230<TD>7.6<TD>0.092<TD>168
|
||||
<TR><TH>Camellia/CTR (128-bit key)<TD>116<TD>14.9<TD>0.224<TD>407
|
||||
<TR><TH>Camellia/CTR (256-bit key)<TD>91<TD>19.0<TD>0.247<TD>449
|
||||
<TR><TH>Twofish/CTR (128-bit key)<TD>146<TD>11.9<TD>2.526<TD>4594
|
||||
<TR><TH>Serpent/CTR (128-bit key)<TD>71<TD>24.5<TD>0.457<TD>831
|
||||
<TR><TH>CAST-256/CTR (128-bit key)<TD>74<TD>23.4<TD>1.230<TD>2237
|
||||
<TR><TH>RC6/CTR (128-bit key)<TD>121<TD>14.3<TD>1.982<TD>3605
|
||||
<TR><TH>MARS/CTR (128-bit key)<TD>86<TD>20.2<TD>1.492<TD>2714
|
||||
<TR><TH>SHACAL-2/CTR (128-bit key)<TD>114<TD>15.2<TD>0.307<TD>559
|
||||
<TR><TH>SHACAL-2/CTR (512-bit key)<TD>114<TD>15.2<TD>0.315<TD>572
|
||||
<TR><TH>DES/CTR (64-bit key)<TD>61<TD>28.5<TD>2.525<TD>4593
|
||||
<TR><TH>DES-XEX3/CTR (192-bit key)<TD>57<TD>30.4<TD>2.546<TD>4632
|
||||
<TR><TH>DES-EDE3/CTR (192-bit key)<TD>24<TD>73.5<TD>8.158<TD>14840
|
||||
<TR><TH>IDEA/CTR (128-bit key)<TD>71<TD>24.4<TD>0.255<TD>464
|
||||
<TR><TH>RC5 (r=16)<TD>105<TD>16.6<TD>1.582<TD>2877
|
||||
<TR><TH>Blowfish/CTR (128-bit key)<TD>104<TD>16.6<TD>36.796<TD>66931
|
||||
<TR><TH>TEA/CTR (128-bit key)<TD>59<TD>29.4<TD>0.206<TD>375
|
||||
<TR><TH>XTEA/CTR (128-bit key)<TD>58<TD>29.9<TD>0.205<TD>373
|
||||
<TR><TH>CAST-128/CTR (128-bit key)<TD>83<TD>21.0<TD>0.339<TD>616
|
||||
<TR><TH>SKIPJACK/CTR (80-bit key)<TD>36<TD>48.7<TD>1.835<TD>3337
|
||||
<TR><TH>SEED/CTR (1/2 K table)<TD>54<TD>32.4<TD>0.280<TD>509</TABLE>
|
||||
<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right>
|
||||
<THEAD><TR><TH>Operation<TH>Milliseconds/Operation<TH>Megacycles/Operation
|
||||
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>RSA 1024 Encryption<TD>0.02<TD>0.04
|
||||
<TR><TH>RSA 1024 Decryption<TD>0.34<TD>0.62
|
||||
<TR><TH>LUC 1024 Encryption<TD>0.02<TD>0.04
|
||||
<TR><TH>LUC 1024 Decryption<TD>0.55<TD>1.00
|
||||
<TR><TH>DLIES 1024 Encryption<TD>0.23<TD>0.42
|
||||
<TR><TH>DLIES 1024 Encryption with precomputation<TD>0.42<TD>0.77
|
||||
<TR><TH>DLIES 1024 Decryption<TD>0.33<TD>0.60
|
||||
<TR><TH>LUCELG 512 Encryption<TD>0.14<TD>0.25
|
||||
<TR><TH>LUCELG 512 Encryption with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>LUCELG 512 Decryption<TD>0.14<TD>0.26
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>RSA 2048 Encryption<TD>0.04<TD>0.07
|
||||
<TR><TH>RSA 2048 Decryption<TD>1.54<TD>2.81
|
||||
<TR><TH>LUC 2048 Encryption<TD>0.05<TD>0.08
|
||||
<TR><TH>LUC 2048 Decryption<TD>2.56<TD>4.66
|
||||
<TR><TH>DLIES 2048 Encryption<TD>1.07<TD>1.95
|
||||
<TR><TH>DLIES 2048 Encryption with precomputation<TD>1.21<TD>2.21
|
||||
<TR><TH>DLIES 2048 Decryption<TD>1.03<TD>1.88
|
||||
<TR><TH>LUCELG 1024 Encryption<TD>0.50<TD>0.90
|
||||
<TR><TH>LUCELG 1024 Encryption with precomputation<TD>0.49<TD>0.90
|
||||
<TR><TH>LUCELG 1024 Decryption<TD>0.43<TD>0.79
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>RSA 1024 Signature<TD>0.34<TD>0.62
|
||||
<TR><TH>RSA 1024 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>RW 1024 Signature<TD>0.37<TD>0.67
|
||||
<TR><TH>RW 1024 Signature with precomputation<TD>0.37<TD>0.67
|
||||
<TR><TH>RW 1024 Verification<TD>0.01<TD>0.02
|
||||
<TR><TH>LUC 1024 Signature<TD>0.56<TD>1.02
|
||||
<TR><TH>LUC 1024 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>NR 1024 Signature<TD>0.12<TD>0.21
|
||||
<TR><TH>NR 1024 Signature with precomputation<TD>0.12<TD>0.22
|
||||
<TR><TH>NR 1024 Verification<TD>0.13<TD>0.24
|
||||
<TR><TH>NR 1024 Verification with precomputation<TD>0.19<TD>0.35
|
||||
<TR><TH>DSA 1024 Signature<TD>0.12<TD>0.22
|
||||
<TR><TH>DSA 1024 Signature with precomputation<TD>0.12<TD>0.22
|
||||
<TR><TH>DSA 1024 Verification<TD>0.13<TD>0.24
|
||||
<TR><TH>DSA 1024 Verification with precomputation<TD>0.19<TD>0.34
|
||||
<TR><TH>LUC-HMP 512 Signature<TD>0.13<TD>0.24
|
||||
<TR><TH>LUC-HMP 512 Signature with precomputation<TD>0.13<TD>0.24
|
||||
<TR><TH>LUC-HMP 512 Verification<TD>0.14<TD>0.25
|
||||
<TR><TH>LUC-HMP 512 Verification with precomputation<TD>0.14<TD>0.25
|
||||
<TR><TH>ESIGN 1023 Signature<TD>0.06<TD>0.10
|
||||
<TR><TH>ESIGN 1023 Verification<TD>0.02<TD>0.03
|
||||
<TR><TH>ESIGN 1536 Signature<TD>0.09<TD>0.17
|
||||
<TR><TH>ESIGN 1536 Verification<TD>0.03<TD>0.06
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>RSA 2048 Signature<TD>1.55<TD>2.82
|
||||
<TR><TH>RSA 2048 Verification<TD>0.04<TD>0.07
|
||||
<TR><TH>RW 2048 Signature<TD>1.61<TD>2.92
|
||||
<TR><TH>RW 2048 Signature with precomputation<TD>1.60<TD>2.90
|
||||
<TR><TH>RW 2048 Verification<TD>0.02<TD>0.04
|
||||
<TR><TH>LUC 2048 Signature<TD>2.61<TD>4.75
|
||||
<TR><TH>LUC 2048 Verification<TD>0.04<TD>0.08
|
||||
<TR><TH>NR 2048 Signature<TD>0.55<TD>1.00
|
||||
<TR><TH>NR 2048 Signature with precomputation<TD>0.28<TD>0.51
|
||||
<TR><TH>NR 2048 Verification<TD>0.61<TD>1.12
|
||||
<TR><TH>NR 2048 Verification with precomputation<TD>0.42<TD>0.76
|
||||
<TR><TH>LUC-HMP 1024 Signature<TD>0.50<TD>0.92
|
||||
<TR><TH>LUC-HMP 1024 Signature with precomputation<TD>0.50<TD>0.91
|
||||
<TR><TH>LUC-HMP 1024 Verification<TD>0.51<TD>0.93
|
||||
<TR><TH>LUC-HMP 1024 Verification with precomputation<TD>0.52<TD>0.94
|
||||
<TR><TH>ESIGN 2046 Signature<TD>0.12<TD>0.21
|
||||
<TR><TH>ESIGN 2046 Verification<TD>0.04<TD>0.06
|
||||
<TBODY style="background: yellow">
|
||||
<TR><TH>XTR-DH 171 Key-Pair Generation<TD>0.17<TD>0.30
|
||||
<TR><TH>XTR-DH 171 Key Agreement<TD>0.33<TD>0.60
|
||||
<TR><TH>XTR-DH 342 Key-Pair Generation<TD>0.43<TD>0.78
|
||||
<TR><TH>XTR-DH 342 Key Agreement<TD>0.86<TD>1.56
|
||||
<TR><TH>DH 1024 Key-Pair Generation<TD>0.12<TD>0.21
|
||||
<TR><TH>DH 1024 Key-Pair Generation with precomputation<TD>0.21<TD>0.39
|
||||
<TR><TH>DH 1024 Key Agreement<TD>0.32<TD>0.58
|
||||
<TR><TH>DH 2048 Key-Pair Generation<TD>0.55<TD>1.00
|
||||
<TR><TH>DH 2048 Key-Pair Generation with precomputation<TD>0.63<TD>1.15
|
||||
<TR><TH>DH 2048 Key Agreement<TD>1.04<TD>1.89
|
||||
<TR><TH>LUCDIF 512 Key-Pair Generation<TD>0.07<TD>0.13
|
||||
<TR><TH>LUCDIF 512 Key-Pair Generation with precomputation<TD>0.07<TD>0.13
|
||||
<TR><TH>LUCDIF 512 Key Agreement<TD>0.14<TD>0.26
|
||||
<TR><TH>LUCDIF 1024 Key-Pair Generation<TD>0.25<TD>0.46
|
||||
<TR><TH>LUCDIF 1024 Key-Pair Generation with precomputation<TD>0.25<TD>0.46
|
||||
<TR><TH>LUCDIF 1024 Key Agreement<TD>0.44<TD>0.80
|
||||
<TR><TH>MQV 1024 Key-Pair Generation<TD>0.11<TD>0.20
|
||||
<TR><TH>MQV 1024 Key-Pair Generation with precomputation<TD>0.11<TD>0.20
|
||||
<TR><TH>MQV 1024 Key Agreement<TD>0.22<TD>0.41
|
||||
<TR><TH>MQV 2048 Key-Pair Generation<TD>0.54<TD>0.98
|
||||
<TR><TH>MQV 2048 Key-Pair Generation with precomputation<TD>0.27<TD>0.49
|
||||
<TR><TH>MQV 2048 Key Agreement<TD>1.00<TD>1.81
|
||||
<TBODY style="background: white">
|
||||
<TR><TH>ECIES over GF(p) 256 Encryption<TD>1.41<TD>2.57
|
||||
<TR><TH>ECIES over GF(p) 256 Encryption with precomputation<TD>1.20<TD>2.19
|
||||
<TR><TH>ECIES over GF(p) 256 Decryption<TD>1.00<TD>1.82
|
||||
<TR><TH>ECDSA over GF(p) 256 Signature<TD>0.72<TD>1.31
|
||||
<TR><TH>ECDSA over GF(p) 256 Signature with precomputation<TD>0.62<TD>1.12
|
||||
<TR><TH>ECDSA over GF(p) 256 Verification<TD>2.47<TD>4.50
|
||||
<TR><TH>ECDSA over GF(p) 256 Verification with precomputation<TD>1.02<TD>1.85
|
||||
<TR><TH>ECDHC over GF(p) 256 Key-Pair Generation<TD>0.71<TD>1.29
|
||||
<TR><TH>ECDHC over GF(p) 256 Key-Pair Generation with precomputation<TD>0.60<TD>1.09
|
||||
<TR><TH>ECDHC over GF(p) 256 Key Agreement<TD>0.71<TD>1.29
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key-Pair Generation<TD>0.70<TD>1.28
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key-Pair Generation with precomputation<TD>0.60<TD>1.08
|
||||
<TR><TH>ECMQVC over GF(p) 256 Key Agreement<TD>2.50<TD>4.55<TBODY style="background: yellow">
|
||||
|
||||
<TR><TH>ECIES over GF(2^n) 233 Encryption<TD>7.69<TD>13.98
|
||||
<TR><TH>ECIES over GF(2^n) 233 Encryption with precomputation<TD>2.13<TD>3.87
|
||||
<TR><TH>ECIES over GF(2^n) 233 Decryption<TD>4.44<TD>8.08
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Signature<TD>3.86<TD>7.03
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Signature with precomputation<TD>1.08<TD>1.97
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Verification<TD>4.80<TD>8.74
|
||||
<TR><TH>ECDSA over GF(2^n) 233 Verification with precomputation<TD>1.83<TD>3.33
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key-Pair Generation<TD>3.85<TD>7.01
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key-Pair Generation with precomputation<TD>1.06<TD>1.94
|
||||
<TR><TH>ECDHC over GF(2^n) 233 Key Agreement<TD>3.92<TD>7.13
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key-Pair Generation<TD>3.85<TD>7.01
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key-Pair Generation with precomputation<TD>1.06<TD>1.94
|
||||
<TR><TH>ECMQVC over GF(2^n) 233 Key Agreement<TD>4.85<TD>8.82</TABLE>
|
||||
Throughput Geometric Average: 995.348464
|
||||
|
||||
Test ended at Tue Sep 27 02:03:40 2016
|
||||
</BODY>
|
||||
</HTML>
|
||||
9
config.h
9
config.h
|
|
@ -490,25 +490,28 @@ NAMESPACE_END
|
|||
// MSVC 2008 (http://msdn.microsoft.com/en-us/library/bb892950%28v=vs.90%29.aspx)
|
||||
// SunCC could generate SSE4 at 12.1, but the intrinsics are missing until 12.4.
|
||||
#if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_SSE4) && !defined(_M_ARM) && ((_MSC_VER >= 1500) || (defined(__SSE4_1__) && defined(__SSE4_2__)))
|
||||
#define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 1
|
||||
#define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 0
|
||||
#else
|
||||
#define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 0
|
||||
#endif
|
||||
|
||||
// Don't disgorge AES-NI from CLMUL. There will be two to four subtle breaks
|
||||
#if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_AESNI) && !defined(_M_ARM) && (_MSC_FULL_VER >= 150030729 || __INTEL_COMPILER >= 1110 || (defined(__AES__) && defined(__PCLMUL__)))
|
||||
#define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 1
|
||||
#define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0
|
||||
#else
|
||||
#define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0
|
||||
#endif
|
||||
|
||||
// AVX2 in MSC 18.00
|
||||
#if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_AVX) && !defined(_M_ARM) && ((_MSC_VER >= 1600) || (defined(__RDRND__) || defined(__RDSEED__) || defined(__AVX__)))
|
||||
#define CRYPTOPP_BOOL_AVX_AVAILABLE 1
|
||||
#define CRYPTOPP_BOOL_AVX_AVAILABLE 0
|
||||
#else
|
||||
#define CRYPTOPP_BOOL_AVX_AVAILABLE 0
|
||||
#endif
|
||||
|
||||
// Enabled for testing Issue 302. If this hits production then please raise redflags
|
||||
#define CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS 1
|
||||
|
||||
// Requires ARMv7 and ACLE 1.0. Testing shows ARMv7 is really ARMv7a under most toolchains.
|
||||
#if !defined(CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM)
|
||||
# if defined(__ARM_NEON__) || defined(__ARM_NEON) || defined(_M_ARM)
|
||||
|
|
|
|||
196
integer.cpp
196
integer.cpp
|
|
@ -415,12 +415,15 @@ S DivideThreeWordsByTwo(S *A, S B0, S B1, D *dummy=NULL)
|
|||
// CRYPTOPP_ASSERT {A[2],A[1]} < {B1,B0}, so quotient can fit in a S
|
||||
CRYPTOPP_ASSERT(A[2] < B1 || (A[2]==B1 && A[1] < B0));
|
||||
|
||||
// estimate the quotient: do a 2 S by 1 S divide
|
||||
S Q;
|
||||
if (S(B1+1) == 0)
|
||||
Q = A[2];
|
||||
else if (B1 > 0)
|
||||
// estimate the quotient: do a 2 S by 1 S divide.
|
||||
// Profiling tells us the original second case was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
|
||||
S Q; bool pre = (S(B1+1) == 0);
|
||||
if (B1 > 0 && !pre)
|
||||
Q = D(A[1], A[2]) / S(B1+1);
|
||||
else if (pre)
|
||||
Q = A[2];
|
||||
else
|
||||
Q = D(A[0], A[1]) / B0;
|
||||
|
||||
|
|
@ -451,9 +454,10 @@ S DivideThreeWordsByTwo(S *A, S B0, S B1, D *dummy=NULL)
|
|||
template <class S, class D>
|
||||
inline D DivideFourWordsByTwo(S *T, const D &Al, const D &Ah, const D &B)
|
||||
{
|
||||
if (!B) // if divisor is 0, we assume divisor==2**(2*WORD_BITS)
|
||||
return D(Ah.GetLowHalf(), Ah.GetHighHalf());
|
||||
else
|
||||
// Profiling tells us the original second case was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
|
||||
if (!!B)
|
||||
{
|
||||
S Q[2];
|
||||
T[0] = Al.GetLowHalf();
|
||||
|
|
@ -464,6 +468,10 @@ inline D DivideFourWordsByTwo(S *T, const D &Al, const D &Ah, const D &B)
|
|||
Q[0] = DivideThreeWordsByTwo<S, D>(T, B.GetLowHalf(), B.GetHighHalf());
|
||||
return D(Q[0], Q[1]);
|
||||
}
|
||||
else // if divisor is 0, we assume divisor==2**(2*WORD_BITS)
|
||||
{
|
||||
return D(Ah.GetLowHalf(), Ah.GetHighHalf());
|
||||
}
|
||||
}
|
||||
|
||||
// returns quotient, which must fit in a word
|
||||
|
|
@ -2342,10 +2350,12 @@ void AsymmetricMultiply(word *R, word *T, const word *A, size_t NA, const word *
|
|||
{
|
||||
if (NA == NB)
|
||||
{
|
||||
if (A == B)
|
||||
Square(R, T, A, NA);
|
||||
else
|
||||
// Profiling tells us the original second case was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
if (A != B)
|
||||
Multiply(R, T, A, B, NA);
|
||||
else
|
||||
Square(R, T, A, NA);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -2360,8 +2370,14 @@ void AsymmetricMultiply(word *R, word *T, const word *A, size_t NA, const word *
|
|||
|
||||
if (NA==2 && !A[1])
|
||||
{
|
||||
// Profiling tells us the original Default case was dominant, so it was promoted to the first Case statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
switch (A[0])
|
||||
{
|
||||
default:
|
||||
R[NB] = LinearMultiply(R, B, A[0], NB);
|
||||
R[NB+1] = 0;
|
||||
return;
|
||||
case 0:
|
||||
SetWords(R, 0, NB+2);
|
||||
return;
|
||||
|
|
@ -2369,10 +2385,6 @@ void AsymmetricMultiply(word *R, word *T, const word *A, size_t NA, const word *
|
|||
CopyWords(R, B, NB);
|
||||
R[NB] = R[NB+1] = 0;
|
||||
return;
|
||||
default:
|
||||
R[NB] = LinearMultiply(R, B, A[0], NB);
|
||||
R[NB+1] = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2405,16 +2417,9 @@ void AsymmetricMultiply(word *R, word *T, const word *A, size_t NA, const word *
|
|||
|
||||
void RecursiveInverseModPower2(word *R, word *T, const word *A, size_t N)
|
||||
{
|
||||
if (N==2)
|
||||
{
|
||||
T[0] = AtomicInverseModPower2(A[0]);
|
||||
T[1] = 0;
|
||||
s_pBot[0](T+2, T, A);
|
||||
TwosComplement(T+2, 2);
|
||||
Increment(T+2, 2, 2);
|
||||
s_pBot[0](R, T, T+2);
|
||||
}
|
||||
else
|
||||
// Profiling tells us the original Else was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
if (N!=2)
|
||||
{
|
||||
const size_t N2 = N/2;
|
||||
RecursiveInverseModPower2(R0, T0, A0, N2);
|
||||
|
|
@ -2426,6 +2431,15 @@ void RecursiveInverseModPower2(word *R, word *T, const word *A, size_t N)
|
|||
TwosComplement(T0, N2);
|
||||
MultiplyBottom(R1, T1, R0, T0, N2);
|
||||
}
|
||||
else
|
||||
{
|
||||
T[0] = AtomicInverseModPower2(A[0]);
|
||||
T[1] = 0;
|
||||
s_pBot[0](T+2, T, A);
|
||||
TwosComplement(T+2, 2);
|
||||
Increment(T+2, 2, 2);
|
||||
s_pBot[0](R, T, T+2);
|
||||
}
|
||||
}
|
||||
|
||||
// R[N] --- result = X/(2**(WORD_BITS*N)) mod M
|
||||
|
|
@ -2876,7 +2890,8 @@ static inline size_t RoundupSize(size_t n)
|
|||
return 32;
|
||||
else if (n<=64)
|
||||
return 64;
|
||||
else return size_t(1) << BitPrecision(n-1);
|
||||
else
|
||||
return size_t(1) << BitPrecision(n-1);
|
||||
}
|
||||
|
||||
Integer::Integer()
|
||||
|
|
@ -2946,7 +2961,7 @@ Integer::Integer(BufferedTransformation &encodedInteger, size_t byteCount, Signe
|
|||
{
|
||||
CRYPTOPP_ASSERT(o == BIG_ENDIAN_ORDER || o == LITTLE_ENDIAN_ORDER);
|
||||
|
||||
if(o == LITTLE_ENDIAN_ORDER)
|
||||
if (o == LITTLE_ENDIAN_ORDER)
|
||||
{
|
||||
SecByteBlock block(byteCount);
|
||||
encodedInteger.Get(block, block.size());
|
||||
|
|
@ -2963,7 +2978,7 @@ Integer::Integer(const byte *encodedInteger, size_t byteCount, Signedness s, Byt
|
|||
{
|
||||
CRYPTOPP_ASSERT(o == BIG_ENDIAN_ORDER || o == LITTLE_ENDIAN_ORDER);
|
||||
|
||||
if(o == LITTLE_ENDIAN_ORDER)
|
||||
if (o == LITTLE_ENDIAN_ORDER)
|
||||
{
|
||||
SecByteBlock block(byteCount);
|
||||
#if (CRYPTOPP_MSC_VERSION >= 1400)
|
||||
|
|
@ -3054,10 +3069,12 @@ Integer& Integer::operator=(const Integer& t)
|
|||
|
||||
bool Integer::GetBit(size_t n) const
|
||||
{
|
||||
if (n/WORD_BITS >= reg.size())
|
||||
return 0;
|
||||
else
|
||||
// Profiling tells us the original Else was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
if (n/WORD_BITS < reg.size())
|
||||
return bool((reg[n/WORD_BITS] >> (n % WORD_BITS)) & 1);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Integer::SetBit(size_t n, bool value)
|
||||
|
|
@ -3076,10 +3093,12 @@ void Integer::SetBit(size_t n, bool value)
|
|||
|
||||
byte Integer::GetByte(size_t n) const
|
||||
{
|
||||
if (n/WORD_SIZE >= reg.size())
|
||||
return 0;
|
||||
else
|
||||
// Profiling tells us the original Else was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
if (n/WORD_SIZE < reg.size())
|
||||
return byte(reg[n/WORD_SIZE] >> ((n%WORD_SIZE)*8));
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Integer::SetByte(size_t n, byte value)
|
||||
|
|
@ -3172,18 +3191,20 @@ static Integer StringToInteger(const T *str, ByteOrder order)
|
|||
str += 2, length -= 2;
|
||||
}
|
||||
|
||||
if(order == BIG_ENDIAN_ORDER)
|
||||
if (order == BIG_ENDIAN_ORDER)
|
||||
{
|
||||
for (unsigned int i=0; i<length; i++)
|
||||
{
|
||||
int digit, ch = static_cast<int>(str[i]);
|
||||
|
||||
// Profiling showd the second and third Else needed to be swapped
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
if (ch >= '0' && ch <= '9')
|
||||
digit = ch - '0';
|
||||
else if (ch >= 'A' && ch <= 'F')
|
||||
digit = ch - 'A' + 10;
|
||||
else if (ch >= 'a' && ch <= 'f')
|
||||
digit = ch - 'a' + 10;
|
||||
else if (ch >= 'A' && ch <= 'F')
|
||||
digit = ch - 'A' + 10;
|
||||
else
|
||||
digit = radix;
|
||||
|
||||
|
|
@ -3194,7 +3215,7 @@ static Integer StringToInteger(const T *str, ByteOrder order)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(radix == 16 && order == LITTLE_ENDIAN_ORDER)
|
||||
else if (radix == 16 && order == LITTLE_ENDIAN_ORDER)
|
||||
{
|
||||
// Nibble high, low and count
|
||||
unsigned int nh = 0, nl = 0, nc = 0;
|
||||
|
|
@ -3206,21 +3227,21 @@ static Integer StringToInteger(const T *str, ByteOrder order)
|
|||
|
||||
if (ch >= '0' && ch <= '9')
|
||||
digit = ch - '0';
|
||||
else if (ch >= 'A' && ch <= 'F')
|
||||
digit = ch - 'A' + 10;
|
||||
else if (ch >= 'a' && ch <= 'f')
|
||||
digit = ch - 'a' + 10;
|
||||
else if (ch >= 'A' && ch <= 'F')
|
||||
digit = ch - 'A' + 10;
|
||||
else
|
||||
digit = radix;
|
||||
|
||||
if (digit < radix)
|
||||
{
|
||||
if(nc++ == 0)
|
||||
if (nc++ == 0)
|
||||
nh = digit;
|
||||
else
|
||||
nl = digit;
|
||||
|
||||
if(nc == 2)
|
||||
if (nc == 2)
|
||||
{
|
||||
v += position * (nh << 4 | nl);
|
||||
nc = 0, position <<= 8;
|
||||
|
|
@ -3228,7 +3249,7 @@ static Integer StringToInteger(const T *str, ByteOrder order)
|
|||
}
|
||||
}
|
||||
|
||||
if(nc == 1)
|
||||
if (nc == 1)
|
||||
v += nh * position;
|
||||
}
|
||||
else // LITTLE_ENDIAN_ORDER && radix != 16
|
||||
|
|
@ -3239,10 +3260,10 @@ static Integer StringToInteger(const T *str, ByteOrder order)
|
|||
|
||||
if (ch >= '0' && ch <= '9')
|
||||
digit = ch - '0';
|
||||
else if (ch >= 'A' && ch <= 'F')
|
||||
digit = ch - 'A' + 10;
|
||||
else if (ch >= 'a' && ch <= 'f')
|
||||
digit = ch - 'a' + 10;
|
||||
else if (ch >= 'A' && ch <= 'F')
|
||||
digit = ch - 'A' + 10;
|
||||
else
|
||||
digit = radix;
|
||||
|
||||
|
|
@ -3337,11 +3358,14 @@ void Integer::Decode(BufferedTransformation &bt, size_t inputLen, Signedness s)
|
|||
|
||||
size_t Integer::MinEncodedSize(Signedness signedness) const
|
||||
{
|
||||
// Profiling tells us the original second If was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
unsigned int outputLen = STDMAX(1U, ByteCount());
|
||||
if (signedness == UNSIGNED)
|
||||
return outputLen;
|
||||
if (NotNegative() && (GetByte(outputLen-1) & 0x80))
|
||||
const bool pre = (signedness == UNSIGNED);
|
||||
if (!pre && NotNegative() && (GetByte(outputLen-1) & 0x80))
|
||||
outputLen++;
|
||||
if (pre)
|
||||
return outputLen;
|
||||
if (IsNegative() && *this < -Power2(outputLen*8-1))
|
||||
outputLen++;
|
||||
return outputLen;
|
||||
|
|
@ -3665,7 +3689,7 @@ std::ostream& operator<<(std::ostream& out, const Integer &a)
|
|||
}
|
||||
|
||||
#ifdef CRYPTOPP_USE_STD_SHOWBASE
|
||||
if(out.flags() & std::ios_base::showbase)
|
||||
if (out.flags() & std::ios_base::showbase)
|
||||
out << suffix;
|
||||
|
||||
return out;
|
||||
|
|
@ -3716,15 +3740,19 @@ Integer& Integer::operator--()
|
|||
|
||||
void PositiveAdd(Integer &sum, const Integer &a, const Integer& b)
|
||||
{
|
||||
int carry;
|
||||
if (a.reg.size() == b.reg.size())
|
||||
carry = Add(sum.reg, a.reg, b.reg, a.reg.size());
|
||||
else if (a.reg.size() > b.reg.size())
|
||||
// Profiling tells us the original second Else If was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
int carry; const bool pre = (a.reg.size() == b.reg.size());
|
||||
if (!pre && a.reg.size() > b.reg.size())
|
||||
{
|
||||
carry = Add(sum.reg, a.reg, b.reg, b.reg.size());
|
||||
CopyWords(sum.reg+b.reg.size(), a.reg+b.reg.size(), a.reg.size()-b.reg.size());
|
||||
carry = Increment(sum.reg+b.reg.size(), a.reg.size()-b.reg.size(), carry);
|
||||
}
|
||||
else if (pre)
|
||||
{
|
||||
carry = Add(sum.reg, a.reg, b.reg, a.reg.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
carry = Add(sum.reg, a.reg, b.reg, a.reg.size());
|
||||
|
|
@ -3747,7 +3775,17 @@ void PositiveSubtract(Integer &diff, const Integer &a, const Integer& b)
|
|||
unsigned bSize = b.WordCount();
|
||||
bSize += bSize%2;
|
||||
|
||||
if (aSize == bSize)
|
||||
// Profiling tells us the original second Else If was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
if (aSize > bSize)
|
||||
{
|
||||
word borrow = Subtract(diff.reg, a.reg, b.reg, bSize);
|
||||
CopyWords(diff.reg+bSize, a.reg+bSize, aSize-bSize);
|
||||
borrow = Decrement(diff.reg+bSize, aSize-bSize, borrow);
|
||||
CRYPTOPP_ASSERT(!borrow);
|
||||
diff.sign = Integer::POSITIVE;
|
||||
}
|
||||
else if (aSize == bSize)
|
||||
{
|
||||
if (Compare(a.reg, b.reg, aSize) >= 0)
|
||||
{
|
||||
|
|
@ -3760,14 +3798,6 @@ void PositiveSubtract(Integer &diff, const Integer &a, const Integer& b)
|
|||
diff.sign = Integer::NEGATIVE;
|
||||
}
|
||||
}
|
||||
else if (aSize > bSize)
|
||||
{
|
||||
word borrow = Subtract(diff.reg, a.reg, b.reg, bSize);
|
||||
CopyWords(diff.reg+bSize, a.reg+bSize, aSize-bSize);
|
||||
borrow = Decrement(diff.reg+bSize, aSize-bSize, borrow);
|
||||
CRYPTOPP_ASSERT(!borrow);
|
||||
diff.sign = Integer::POSITIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
word borrow = Subtract(diff.reg, b.reg, a.reg, aSize);
|
||||
|
|
@ -4045,8 +4075,6 @@ void Integer::Divide(word &remainder, Integer "ient, const Integer ÷nd
|
|||
if (!divisor)
|
||||
throw Integer::DivideByZero();
|
||||
|
||||
CRYPTOPP_ASSERT(divisor);
|
||||
|
||||
if ((divisor & (divisor-1)) == 0) // divisor is a power of 2
|
||||
{
|
||||
quotient = dividend >> (BitPrecision(divisor)-1);
|
||||
|
|
@ -4089,29 +4117,32 @@ word Integer::Modulo(word divisor) const
|
|||
if (!divisor)
|
||||
throw Integer::DivideByZero();
|
||||
|
||||
CRYPTOPP_ASSERT(divisor);
|
||||
|
||||
word remainder;
|
||||
|
||||
if ((divisor & (divisor-1)) == 0) // divisor is a power of 2
|
||||
remainder = reg[0] & (divisor-1);
|
||||
else
|
||||
// Profiling tells us the original Else was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
if ((divisor & (divisor-1)) != 0) // divisor is not a power of 2
|
||||
{
|
||||
// Profiling tells us the original Else was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
unsigned int i = WordCount();
|
||||
|
||||
if (divisor <= 5)
|
||||
if (divisor > 5)
|
||||
{
|
||||
remainder = 0;
|
||||
while (i--)
|
||||
remainder = DWord(reg[i], remainder) % divisor;
|
||||
}
|
||||
else
|
||||
{
|
||||
DWord sum(0, 0);
|
||||
while (i--)
|
||||
sum += reg[i];
|
||||
remainder = sum % divisor;
|
||||
}
|
||||
else
|
||||
{
|
||||
remainder = 0;
|
||||
while (i--)
|
||||
remainder = DWord(reg[i], remainder) % divisor;
|
||||
}
|
||||
}
|
||||
else // divisor is a power of 2
|
||||
{
|
||||
remainder = reg[0] & (divisor-1);
|
||||
}
|
||||
|
||||
if (IsNegative() && remainder)
|
||||
|
|
@ -4128,12 +4159,13 @@ void Integer::Negate()
|
|||
|
||||
int Integer::PositiveCompare(const Integer& t) const
|
||||
{
|
||||
unsigned size = WordCount(), tSize = t.WordCount();
|
||||
|
||||
if (size == tSize)
|
||||
return CryptoPP::Compare(reg, t.reg, size);
|
||||
else
|
||||
// Profiling tells us the original Else was dominant, so it was promoted to the first If statement.
|
||||
// The code change occurred at Commit dc99266599a0e72d.
|
||||
const unsigned size = WordCount(), tSize = t.WordCount();
|
||||
if (size != tSize)
|
||||
return size > tSize ? 1 : -1;
|
||||
else
|
||||
return CryptoPP::Compare(reg, t.reg, size);
|
||||
}
|
||||
|
||||
int Integer::Compare(const Integer& t) const
|
||||
|
|
|
|||
76
rijndael.cpp
76
rijndael.cpp
|
|
@ -1035,13 +1035,33 @@ void Rijndael_Enc_AdvancedProcessBlocks(void *locals, const word32 *k);
|
|||
|
||||
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86
|
||||
|
||||
/* Determine whether the range between begin and end overlaps
|
||||
* with the same 4k block offsets as the Te table.
|
||||
*/
|
||||
// Determine whether the range between begin and end overlaps
|
||||
// with the same 4k block offsets as the Te table. Logically,
|
||||
// the code is trying to create the condition:
|
||||
//
|
||||
// Two sepearate memory pages:
|
||||
//
|
||||
// +-----+ +-----+
|
||||
// |XXXXX| |YYYYY|
|
||||
// |XXXXX| |YYYYY|
|
||||
// | | | |
|
||||
// | | | |
|
||||
// +-----+ +-----+
|
||||
// Te Table Locals
|
||||
//
|
||||
// Have a logical cache view of (X and Y may be inverted):
|
||||
//
|
||||
// +-----+
|
||||
// |XXXXX|
|
||||
// |XXXXX|
|
||||
// |YYYYY|
|
||||
// |YYYYY|
|
||||
// +-----+
|
||||
//
|
||||
static inline bool AliasedWithTable(const byte *begin, const byte *end)
|
||||
{
|
||||
size_t s0 = size_t(begin)%4096, s1 = size_t(end)%4096;
|
||||
size_t t0 = size_t(Te)%4096, t1 = (size_t(Te)+sizeof(Te))%4096;
|
||||
ptrdiff_t s0 = uintptr_t(begin)%4096, s1 = uintptr_t(end)%4096;
|
||||
ptrdiff_t t0 = uintptr_t(Te)%4096, t1 = (uintptr_t(Te)+sizeof(Te))%4096;
|
||||
if (t1 > t0)
|
||||
return (s0 >= t0 && s0 < t1) || (s1 > t0 && s1 <= t1);
|
||||
else
|
||||
|
|
@ -1230,6 +1250,21 @@ inline size_t AESNI_AdvancedProcessBlocks(F1 func1, F4 func4, MAYBE_CONST __m128
|
|||
}
|
||||
#endif
|
||||
|
||||
#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM)
|
||||
struct Locals
|
||||
{
|
||||
word32 subkeys[4*12], workspace[8];
|
||||
const byte *inBlocks, *inXorBlocks, *outXorBlocks;
|
||||
byte *outBlocks;
|
||||
size_t inIncrement, inXorIncrement, outXorIncrement, outIncrement;
|
||||
size_t regSpill, lengthAndCounterFlag, keysBegin;
|
||||
};
|
||||
|
||||
const size_t Rijndael::Enc::aliasPageSize = 4096;
|
||||
const size_t Rijndael::Enc::aliasBlockSize = 256;
|
||||
const size_t Rijndael::Enc::sizeToAllocate = aliasPageSize + aliasBlockSize + sizeof(Locals);
|
||||
#endif
|
||||
|
||||
size_t Rijndael::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const
|
||||
{
|
||||
#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE
|
||||
|
|
@ -1243,30 +1278,11 @@ size_t Rijndael::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xo
|
|||
if (length < BLOCKSIZE)
|
||||
return length;
|
||||
|
||||
struct Locals
|
||||
{
|
||||
word32 subkeys[4*12], workspace[8];
|
||||
const byte *inBlocks, *inXorBlocks, *outXorBlocks;
|
||||
byte *outBlocks;
|
||||
size_t inIncrement, inXorIncrement, outXorIncrement, outIncrement;
|
||||
size_t regSpill, lengthAndCounterFlag, keysBegin;
|
||||
};
|
||||
static const byte *zeros = (const byte*)(Te+aliasBlockSize);
|
||||
byte *space = NULL, *originalSpace = const_cast<byte*>(m_aliasBlock.data());
|
||||
|
||||
const byte* zeros = (byte *)(Te+256);
|
||||
byte *space = NULL, *originalSpace = NULL;
|
||||
|
||||
const size_t aliasPageSize = 4096;
|
||||
const size_t aliasBlockSize = 256;
|
||||
const size_t sizeToAllocate = aliasPageSize + aliasBlockSize + sizeof(Locals);
|
||||
#if (CRYPTOPP_MSC_VERSION >= 1400)
|
||||
originalSpace = (byte *)_malloca(sizeToAllocate);
|
||||
#else
|
||||
originalSpace = (byte *)alloca(sizeToAllocate);
|
||||
#endif
|
||||
/* round up to nearest 256 byte boundary */
|
||||
space = originalSpace +
|
||||
(aliasBlockSize - (size_t)originalSpace % aliasBlockSize)
|
||||
% aliasBlockSize;
|
||||
// round up to nearest 256 byte boundary
|
||||
space = originalSpace + (aliasBlockSize - (uintptr_t)originalSpace % aliasBlockSize) % aliasBlockSize;
|
||||
while (AliasedWithTable(space, space + sizeof(Locals)))
|
||||
{
|
||||
space += 256;
|
||||
|
|
@ -1301,10 +1317,6 @@ size_t Rijndael::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xo
|
|||
|
||||
Rijndael_Enc_AdvancedProcessBlocks(&locals, m_key);
|
||||
|
||||
#if (CRYPTOPP_MSC_VERSION >= 1400)
|
||||
_freea(originalSpace);
|
||||
#endif
|
||||
|
||||
return length % BLOCKSIZE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -56,7 +56,13 @@ class CRYPTOPP_DLL Rijndael : public Rijndael_Info, public BlockCipherDocumentat
|
|||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86
|
||||
Enc() : m_aliasBlock(sizeToAllocate) {}
|
||||
size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
|
||||
private:
|
||||
static const size_t aliasPageSize;
|
||||
static const size_t aliasBlockSize;
|
||||
static const size_t sizeToAllocate;
|
||||
SecByteBlock m_aliasBlock;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
|||
6
stdcpp.h
6
stdcpp.h
|
|
@ -44,7 +44,11 @@ namespace std {
|
|||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <climits>
|
||||
#include "trap.h"
|
||||
|
||||
// uintptr_t and ptrdiff_t
|
||||
#if (__cplusplus < 201103L)
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifdef CRYPTOPP_INCLUDE_VECTOR_CC
|
||||
// workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21
|
||||
|
|
|
|||
Loading…
Reference in New Issue