lbrycrd/src/crypto
Wladimir J. van der Laan 3a3eabef40
Merge #13386: SHA256 implementations based on Intel SHA Extensions
66b2cf1ccf Use immintrin.h everywhere for intrinsics (Pieter Wuille)
4c935e2eee Add SHA256 implementation using using Intel SHA intrinsics (Pieter Wuille)
268400d318 [Refactor] CPU feature detection logic for SHA256 (Pieter Wuille)

Pull request description:

  Based on #13191.

  This adds SHA256 implementations that use Intel's SHA Extension instructions (using intrinsics). This needs GCC 4.9 or Clang 3.4.

  In addition to #13191, two extra implementations are provided:
  * (a) A variable-length SHA256 implementation using SHA extensions.
  * (b) A 2-way 64-byte input double-SHA256 implementation using SHA extensions.

  Benchmarks for 9001-element Merkle tree root computation on an AMD Ryzen 1800X system:
  * Using generic C++ code (pre-#10821): 6.1ms
  * Using SSE4 (master, #10821): 4.6ms
  * Using 4-way SSE4 specialized for 64-byte inputs (#13191): 2.8ms
  * Using 8-way AVX2 specialized for 64-byte inputs (#13191): 2.1ms
  * Using 2-way SHA-NI specialized for 64-byte inputs (this PR): 0.56ms

  Benchmarks for 32-byte SHA256 on the same system:
  * Using SSE4 (master, #10821): 190ns
  * Using SHA-NI (this PR): 53ns

  Benchmarks for 1000000-byte SHA256 on the same system:
  * Using SSE4 (master, #10821): 2.5ms
  * Using SHA-NI (this PR): 0.51ms

Tree-SHA512: 2b319e33b22579f815d91f9daf7994a5e1e799c4f73c13e15070dd54ba71f3f6438ccf77ae9cbd1ce76f972d9cbeb5f0edfea3d86f101bbc1055db70e42743b7
2018-07-09 21:17:18 +02:00
..
ctaes Update ctaes 2016-12-08 17:09:07 -08:00
aes.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
aes.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
chacha20.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
chacha20.h Add ChaCha20 2017-03-29 00:40:17 -07:00
common.h Consensus: Fix bug when compiler do not support __builtin_clz* 2018-03-01 17:20:27 +08:00
hmac_sha256.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
hmac_sha256.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
hmac_sha512.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
hmac_sha512.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
ripemd160.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
ripemd160.h Increment MIT Licence copyright header year on files modified in 2016 2016-12-31 11:01:21 -07:00
sha1.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
sha1.h Increment MIT Licence copyright header year on files modified in 2016 2016-12-31 11:01:21 -07:00
sha256.cpp Merge #13386: SHA256 implementations based on Intel SHA Extensions 2018-07-09 21:17:18 +02:00
sha256.h Specialized double sha256 for 64 byte inputs 2018-05-29 14:05:00 -07:00
sha256_avx2.cpp Use immintrin.h everywhere for intrinsics 2018-06-26 10:11:08 -07:00
sha256_shani.cpp Use immintrin.h everywhere for intrinsics 2018-06-26 10:11:08 -07:00
sha256_sse4.cpp Add SSE4 based SHA256 2017-07-20 09:03:53 -07:00
sha256_sse41.cpp Use immintrin.h everywhere for intrinsics 2018-06-26 10:11:08 -07:00
sha512.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
sha512.h Increment MIT Licence copyright header year on files modified in 2016 2016-12-31 11:01:21 -07:00