Jack Grigg
6b4f4475a5
Use fixed-size array in IsProbablyDuplicate to avoid stack protector warning
2016-08-05 17:18:47 +12:00
Jack Grigg
d4af3dd5fd
Eliminate some of the duplicates caused by truncating indices
2016-08-05 17:09:30 +12:00
Jack Grigg
51eb5273f5
Equihash: Pass each obtained solution to a callback for immediate checking
...
Closes #1143
2016-07-27 19:15:49 +12:00
Jack Grigg
215b9e139d
Use std::shared_ptr to deallocate partialSolns automatically
2016-07-23 00:31:47 +12:00
Jack Grigg
1655db285d
Move initialisations to simplify cancelled checks
2016-07-22 23:54:14 +12:00
Jack Grigg
5a360a5c6a
Fix segfault by indirectly monitoring chainActive.Tip(), locking on mutex
2016-07-21 19:34:21 +12:00
Jack Grigg
5b4ebcd5e2
Add tests that exercise the cancellation code branches
2016-07-21 16:39:32 +12:00
Jack Grigg
2dbabb1159
Make Equihash solvers cancellable
...
The miner only cancels the solver when chainActive.Tip() changes.
Closes #1055
2016-07-20 19:17:02 +12:00
Jack Grigg
1bb40a42c2
Collect all permutations of final solutions
2016-07-19 23:11:49 +12:00
Jack Grigg
d151ab4fea
Only compare the first n/(k+1) bits when sorting
2016-06-21 15:53:47 +12:00
Jack Grigg
09e9a329b7
Tweaks after review
2016-06-14 09:41:03 +12:00
Jack Grigg
933cb4cd9f
Use htole32 and htobe32 for endian conversions
2016-06-11 16:52:02 +12:00
Jack Grigg
a6dcf2ee6f
Use little-endian for hash personalisation and hashing indices
...
The test vectors have been regenerated using the basic solver.
2016-06-11 16:28:57 +12:00
Jack Grigg
d07cf62991
Speed up FullStepRow index comparison by leveraging big-endian byte layout
2016-06-11 16:28:57 +12:00
Jack Grigg
ae37d2a4cd
Increase Equihash parameters to n = 96, k = 3 (about 430 MiB)
...
Includes a tweak to set the fixed-width of the rows based on whether the first
or last round is widest. This is necessary for some parameters, these ones
included.
2016-06-11 12:15:25 +12:00
zkbot
7232b5d70a
Auto merge of #988 - str4d:optimised-equihash, r=ebfull
...
Use depth-first scan for eliminating partial solutions instead of breadth-first
This reduces the peak number of lists in-memory from 2^k to k, and enables the
solver to eliminate most duplicates before it has instantiated the full set of
leaves.
Part of #857 .
2016-06-09 22:43:09 +00:00
Simon
dca3af5bde
Update variable name.
2016-06-09 07:23:33 +08:00
Simon
574f0bca77
Update to DistinctIndices function (for issue #857 ).
...
Replaces pull request #974 .
2016-06-08 23:34:18 +08:00
Jack Grigg
0a66f01304
Use depth-first scan for eliminating partial solutions instead of breadth-first
...
This reduces the peak number of lists in-memory from 2^k to k, and enables the
solver to eliminate most duplicates before it has instantiated the full set of
leaves.
2016-06-03 17:00:03 +12:00
Jack Grigg
447444ae7a
Fix nits after review
2016-06-01 23:15:04 +12:00
Jack Grigg
d4d76536a5
Use fixed-width array for storing hash and indices
2016-05-24 23:16:53 +12:00
Jack Grigg
29d9986c83
Store full indices in the same char* as the hash
2016-05-24 23:16:52 +12:00
Jack Grigg
639c40047f
Use comparator object for sorting StepRows
2016-05-24 23:16:52 +12:00
Jack Grigg
a683cc85d9
Merge *StepRow XOR and trimming operations
2016-05-24 23:16:52 +12:00
Jack Grigg
e95747288a
Use template parameters to statically initialise Equihash
2016-05-24 23:16:50 +12:00
Jack Grigg
39f5cb35f9
Store truncated indices in the same char* as the hash (H/T tromp for the idea!)
2016-05-24 12:02:46 +12:00
Jack Grigg
c92c1f6050
Implement index-truncation Equihash optimisation
2016-05-24 12:02:46 +12:00
Jack Grigg
6afef0dd6d
Cleanups
2016-05-24 12:02:46 +12:00
Jack Grigg
a3361e778b
Refactor StepRow to make optimisation easier
2016-05-24 12:02:08 +12:00
Taylor Hornby
675e17022f
Use left shift instead of floating-point pow() in equihash.
2016-05-18 11:22:29 -06:00
Jack Grigg
6d25662f25
Implement validator and basic solver for Equihash
2016-04-08 13:56:00 +12:00
Sean Bowe
27a109af01
Improve testing and API of CSHA256 compression.
2016-03-31 16:15:07 -06:00
Sean Bowe
8466467a35
Added SHA256Compress to Bitcoin's SHA256 implementation.
2016-03-31 14:23:56 -06:00
Wladimir J. van der Laan
4414f5ffe1
build: Endian compatibility
...
- 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
2015-03-06 15:54:53 +01:00
Pieter Wuille
1a9576de9d
Use libsecp256k1's RFC6979 implementation
2015-01-06 00:28:44 +01:00
sandakersmann
f914f1a746
Added "Core" to copyright headers
...
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Pieter Wuille
9d8604f36a
Header define style cleanups
2014-11-20 17:22:06 +01:00
Pieter Wuille
3060e36098
Add the RFC6979 PRNG
2014-11-20 17:22:06 +01:00
Pieter Wuille
a8f5087e53
Add HMAC-SHA256
2014-11-20 17:22:06 +01:00
Pieter Wuille
36fa4a78ac
Split up crypto/sha2
2014-11-20 17:22:02 +01:00
Pavel Janík
84738627ce
Fix all header defines
2014-11-03 16:16:40 +01:00
Philip Kaufmann
0db65d8798
update license of compat and crypto
...
- change license to be just MIT for all files in compat and crypto
- also add missing header end comments
- ensure default header include style
2014-09-29 08:21:11 +02:00
Pieter Wuille
cf42c36e99
Apply clang-format on crypto/* and compat/*
2014-09-25 08:23:32 +02:00
Philip Kaufmann
611116d4e3
header include cleanup
...
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-14 12:43:56 +02:00
Pieter Wuille
a0495bb68c
Add <Hasher>::OUTPUT_SIZE
2014-06-21 19:47:43 +02:00
Cory Fields
f2647cc0e9
crypto: explicitly check for byte read/write functions
...
Don't depend on hard-coded platform lists
2014-06-21 19:47:43 +02:00
Pieter Wuille
7ecd9739d9
Move {Read,Write}{LE,BE}{32,64} to common.h and use builtins if possible
2014-06-21 19:47:42 +02:00
Pieter Wuille
a5bc9c0917
Add built-in RIPEMD-160 implementation
2014-06-21 19:47:42 +02:00
Pieter Wuille
13b5dfef64
Move crypto implementations to src/crypto/
2014-06-21 19:47:42 +02:00