Implement Equihash validator

Follows Zcash implementation as closely as possible.
This commit is contained in:
str4d
2017-12-30 23:36:23 +01:00
parent 36d7acf3f3
commit d19c9b5645
5 changed files with 415 additions and 2 deletions

View File

@@ -14,6 +14,19 @@ extern "C" {
const char* sprout_path
);
/// Validates the provided Equihash solution against
/// the given parameters, input and nonce.
bool librustzcash_eh_isvalid(
uint32_t n,
uint32_t k,
const unsigned char* input,
size_t input_len,
const unsigned char* nonce,
size_t nonce_len,
const unsigned char* soln,
size_t soln_len
);
/// Writes the "uncommitted" note value for empty leaves
/// of the merkle tree. `result` must be a valid pointer
/// to 32 bytes which will be written.