No description, website, or topics provided.
Assembly C PHP C++ Makefile Shell
Switch branches/tags
Nothing to show
Clone or download
xenoncat Merge pull request #6 from kost/mac-support
Initial Mac OS X support
Latest commit 6907cab Nov 1, 2016
Failed to load latest commit information.
Linux BLAKE2b C binding for tromp Oct 23, 2016
Mac Initial Mac OS X support Nov 1, 2016
Windows Add AVX1 Oct 17, 2016
notes Add files via upload Oct 14, 2016
LICENSE Initial commit Oct 13, 2016 Add AVX1 Oct 17, 2016
history.log Bug fix: 32-bit address assumption related Oct 21, 2016
untested Add files via upload Oct 26, 2016


Equihash proof-of-work solvers

cd Linux/demo


#define CONTEXT_SIZE 178033152
Application should allocate CONTEXT_SIZE bytes of memory as context for the solver. Memory alignment should be 4096. Failure to align by 32 will cause general protection exception.
Multiple threads can be launched with separate context to solve multiple instances of equihash.
Consider allocating HugePage (2MiB) for performance.

void EhPrepare(void *context, void *input);
EhPrepare takes in 136 bytes of input. The remaining 4 bytes of input is fed as nonce to EhSolver.
EhPrepare saves midstate in context, EhSolver can then be called repeatedly with different nonce.
context does not need to be initialized by the caller.

int32_t EhSolver(void *context, uint32_t nonce);
Conversion between uint32_t nonce and the byte array of block header is little endian byte order.
nonce = *(uint32_t *)(inputheader+136);
Return value is the number of solutions.
First solution is located at context byte 0.
Second solution is located at context byte 1344.
And so on.