Add function librustzcash_sapling_compute_nf.

Also add function priv_get_note to refactor common code from librustzcash_sapling_compute_cm.
This commit is contained in:
Simon
2018-06-07 10:36:52 -07:00
parent 2e8a11a1da
commit 8ec096bdeb
2 changed files with 107 additions and 28 deletions

View File

@@ -102,6 +102,23 @@ extern "C" {
/// `librustzcash_sapling_verification_ctx_init`.
void librustzcash_sapling_verification_ctx_free(void *);
/// Compute a Sapling nullifier.
///
/// The `diversifier` parameter must be 11 bytes in length.
/// The `pk_d`, `r`, `ak` and `nk` parameters must be of length 32.
/// The result is also of length 32 and placed in `result`.
/// Returns false if the diversifier or pk_d is not valid
bool librustzcash_sapling_compute_nf(
const unsigned char *diversifier,
const unsigned char *pk_d,
const uint64_t value,
const unsigned char *r,
const unsigned char *ak,
const unsigned char *nk,
const uint64_t position,
unsigned char *result
);
/// Compute a Sapling commitment.
///
/// The `diversifier` parameter must be 11 bytes in length.