Commit Graph

7 Commits

Author SHA1 Message Date
Jack Grigg
20abe2083c Extend byte array expansion and compression methods with optional padding 2016-08-16 11:02:04 +12:00
Jack Grigg
caa0348f04 Update Equihash hash generation to match the Zcash spec
Changes:

- floor(512/n)*n/8 bytes of BLAKE2b output is split between floor(512/n)
  adjacent indices, instead of using one hash call per index.

- Parameters with n/(k+1) mod 8 != 0 will expand the BLAKE2b output to byte
  boundaries for colliding, instead of using a longer output and clearing bits.

- The genesis blocks have been regenerated.

- The test vectors have been regenerated.

- The Equihash inputs for the cancellation tests were modified to ensure that
  valid solutions were available to exercise the full solver.
2016-08-16 11:02:04 +12:00
Jack Grigg
881ffbfc87 Add methods for byte array expansion and compression
These methods convert between:

- A byte array of length NL/8, and
- An array of N blocks of ceil(L/8) bytes.
2016-08-16 11:02:00 +12:00
Jack Grigg
fa19e1b357 Add test showing bug in IsProbablyDuplicate() 2016-08-06 15:23:47 +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
1655db285d Move initialisations to simplify cancelled checks 2016-07-22 23:54:14 +12:00
Jack Grigg
5b4ebcd5e2 Add tests that exercise the cancellation code branches 2016-07-21 16:39:32 +12:00