aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
Commit message (Collapse)AuthorAgeFilesLines
* Abstract out seeding/extracting entropy into RNGState::MixExtractPieter Wuille2019-01-161-1/+1
|
* Extract CSipHasher to it's own file in crypto/ directory.Jim Posen2018-11-052-0/+220
| | | | This is a move-only commit with the exception of changes to includes.
* Update copyright headers to 2018DrahtBot2018-07-2712-12/+12
|
* Merge #13386: SHA256 implementations based on Intel SHA ExtensionsWladimir J. van der Laan2018-07-094-24/+433
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 66b2cf1ccfad545a8ec3f2a854e23f647322bf30 Use immintrin.h everywhere for intrinsics (Pieter Wuille) 4c935e2eee456ff66cdfb908b0edffdd1e8a6c04 Add SHA256 implementation using using Intel SHA intrinsics (Pieter Wuille) 268400d3188200c9e3dcd3482c4853354388a721 [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
| * Use immintrin.h everywhere for intrinsicsPieter Wuille2018-06-263-12/+0
| |
| * Add SHA256 implementation using using Intel SHA intrinsicsPieter Wuille2018-06-262-0/+403
| |
| * [Refactor] CPU feature detection logic for SHA256Pieter Wuille2018-06-241-16/+34
| |
* | Use __cpuid_count for gnu C to avoid gitian build fail.Chun Kuan Lee2018-07-071-1/+5
|/
* Merge #13471: For AVX2 code, also check for AVX, XSAVE, and OS supportWladimir J. van der Laan2018-06-241-4/+17
|\ | | | | | | | | | | | | | | | | | | 32d153fa360f73b4999701b97d55b12318fd2659 For AVX2 code, also check for AVX, XSAVE, and OS support (Pieter Wuille) Pull request description: Fixes #12903. Tree-SHA512: 01e71efb5d3a43c49a145a5b1dc4fe7d0a491e1e78479e7df830a2aaac57c3dcfc316e28984c695206c76f93b68e4350fc037ca36756ca579b7070e39c835da2
| * For AVX2 code, also check for AVX, XSAVE, and OS supportPieter Wuille2018-06-181-4/+17
| |
* | Improve coverage of SHA256 SelfTest codePieter Wuille2018-06-121-28/+80
|/
* Merge #13393: Enable double-SHA256-for-64-byte code on 32-bit x86Wladimir J. van der Laan2018-06-121-2/+4
|\ | | | | | | | | | | | | | | | | | | | | | | 57ba401abcfe564a2c4d259e0f758401ed74616d Enable double-SHA256-for-64-byte code on 32-bit x86 (Pieter Wuille) Pull request description: The SSE4 and AVX2 double-SHA256-for-64-byte input code from #13191 compiles fine on 32-bit x86 systems, but the autodetection logic in sha256.cpp doesn't enable it. Fix this. Note that these instruction sets are only available on CPUs that support 64-bit mode as well, so it is only beneficial in the (perhaps unlikely) scenario where a 64-bit CPU is running a 32-bit Bitcoin Core binary. Tree-SHA512: 39d5963c1ba8c33932549d5fe98bd184932689a40aeba95043eca31dd6824f566197c546b60905555eccaf407408a5f0f200247bb0907450d309b0a70b245102
| * Enable double-SHA256-for-64-byte code on 32-bit x86Pieter Wuille2018-06-041-2/+4
| |
* | Use bracket syntax includes ("#include <foo.h>")practicalswift2018-06-062-4/+4
|/
* 8-way AVX2 implementation for double SHA256 on 64-byte inputsPieter Wuille2018-05-292-1/+361
|
* 4-way SSE4.1 implementation for double SHA256 on 64-byte inputsPieter Wuille2018-05-292-3/+343
|
* Specialized double sha256 for 64 byte inputsPieter Wuille2018-05-292-1/+310
|
* Refactor SHA256 codePieter Wuille2018-05-081-69/+69
|
* Consensus: Fix bug when compiler do not support __builtin_clz*5324793012018-03-011-2/+2
| | | | #ifdef is not correct since defination is defined to 0 or 1. Should change to #if
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-0312-12/+12
|
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-1612-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* Merge #11143: Fix include path for bitcoin-config.hWladimir J. van der Laan2017-09-051-1/+1
|\ | | | | | | | | | | | | | | | | | | | | 5abb93f0e Fix include path for bitcoin-config.h in crypto/common.h (danra) Pull request description: All the other files in the repo which include bitcoin-config.h do so with the appropriate subfolder prefixed: config/bitcoin-config.h The header should be included with the appropriate subfolder here as well. Tree-SHA512: abda23a9cf251553f90afe0ee1866de46ed579471f4139737239a4f9334ca817d985deac6336740898718775d1264c0b80cb348668b10a9cae970895f2de37b8
| * Fix include path for bitcoin-config.h in crypto/common.hdanra2017-08-311-1/+1
| | | | | | | | | | | | | | All the other files in the repo which include bitcoin-config.h do so with the appropriate subfolder prefixed: config/bitcoin-config.h The header should be included with the appropriate subfolder here as well. This canonicalization also allows getting rid of a bit of extra configuration in Makefile.am.
* | Merge #11176: build: Rename --enable-experimental-asm to --enable-asm and ↵Wladimir J. van der Laan2017-09-051-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enable by default 538cc0ca8 build: Mention use of asm in summary (Wladimir J. van der Laan) ce5381e7f build: Rename --enable-experimental-asm to --enable-asm and enable by default (Wladimir J. van der Laan) Pull request description: Now that 0.15 is branched off, enable assembler SHA256 optimizations by default, but still allow disabling them, for example if something goes wrong with auto-detection on a platform. Also add mention of the use of asm in the configure summary. Tree-SHA512: cd20c497f65edd6b1e8b2cc3dfe82be11fcf4777543c830ccdec6c10f25eab4576b0f2953f3957736d7e04deaa4efca777aa84b12bb1cecb40c258e86c120ec8
| * | build: Rename --enable-experimental-asm to --enable-asm and enable by defaultWladimir J. van der Laan2017-08-281-2/+2
| |/ | | | | | | Now that 0.15 is branched off, enable assembler SHA256 optimizations by default.
* / Update hmac_sha256.hUtsav Gupta2017-09-021-1/+1
|/ | | Fixed a typo
* Declare single-argument (non-converting) constructors "explicit"practicalswift2017-08-161-4/+4
| | | | In order to avoid unintended implicit conversions.
* scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift2017-08-071-1/+1
| | | | | | | | | | | | | instead of the macro NULL -BEGIN VERIFY SCRIPT- sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp -END VERIFY SCRIPT-
* Protect SSE4 code behind a compile-time flagPieter Wuille2017-07-201-1/+3
|
* Add selftest for SHA256 transformPieter Wuille2017-07-201-1/+33
|
* Add SSE4 based SHA256Pieter Wuille2017-07-202-2/+1522
|
* Add SHA256 dispatcherPieter Wuille2017-07-202-2/+17
|
* Support multi-block SHA256 transformsPieter Wuille2017-07-201-87/+90
| | | | Extracted from a patch by Wladimir van der Laan.
* Limit variable scopepracticalswift2017-06-051-2/+1
|
* Add a FastRandomContext::randrange and use itPieter Wuille2017-03-291-0/+21
|
* Add ChaCha20Pieter Wuille2017-03-292-0/+206
|
* Avoid unaligned access in crypto i/oPieter Wuille2017-01-121-10/+26
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-315-5/+5
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Update ctaesPieter Wuille2016-12-081-4/+4
|
* Fix some typosfsb40002016-11-281-1/+1
|
* crypto: add AES 128/256 CBC classesCory Fields2016-05-132-0/+196
| | | | | | The output should always match openssl's, even for failed operations. Even for a decrypt with broken padding, the output is always deterministic (and attemtps to be constant-time).
* Add ctaes-based constant time AES implementationPieter Wuille2016-05-132-0/+139
|
* Merge commit 'a545127fbccef4ee674d18d43732ce00ba97f782' as 'src/crypto/ctaes'Pieter Wuille2016-05-116-0/+939
|
* crypto: bytes counts are 64 bitWladimir J. van der Laan2016-04-154-4/+4
| | | | | | Byte counts for SHA256, SHA512, SHA1 and RIPEMD160 must be 64 bits. `size_t` has a different size per platform, causing divergent results when hashing more than 4GB of data.
* build: Endian compatibilityWladimir J. van der Laan2015-03-061-65/+11
| | | | | | | | - Detect endian instead of stopping configure on big-endian - Add `byteswap.h` and `endian.h` header for compatibility with Windows and other operating systems that don't come with them - Update `crypto/common.h` functions to use compat endian header
* Use libsecp256k1's RFC6979 implementationPieter Wuille2015-01-062-83/+0
|
* Added "Core" to copyright headerssandakersmann2014-12-1915-15/+15
| | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* Header define style cleanupsPieter Wuille2014-11-204-12/+12
|
* Add the RFC6979 PRNGPieter Wuille2014-11-202-0/+83
|
* Add HMAC-SHA256Pieter Wuille2014-11-202-0/+66
|