Implementation of Sapling transaction verification.
This commit is contained in:
@@ -36,6 +36,46 @@ extern "C" {
|
||||
const unsigned char *b,
|
||||
unsigned char *result
|
||||
);
|
||||
|
||||
/// Creates a Sapling verification context. Please free this
|
||||
/// when you're done.
|
||||
void * librustzcash_sapling_verification_ctx_init();
|
||||
|
||||
/// Check the validity of a Sapling Spend description,
|
||||
/// accumulating the value commitment into the context.
|
||||
bool librustzcash_sapling_check_spend(
|
||||
void *ctx,
|
||||
const unsigned char *cv,
|
||||
const unsigned char *anchor,
|
||||
const unsigned char *nullifier,
|
||||
const unsigned char *rk,
|
||||
const unsigned char *zkproof,
|
||||
const unsigned char *spendAuthSig,
|
||||
const unsigned char *sighashValue
|
||||
);
|
||||
|
||||
/// Check the validity of a Sapling Output description,
|
||||
/// accumulating the value commitment into the context.
|
||||
bool librustzcash_sapling_check_output(
|
||||
void *ctx,
|
||||
const unsigned char *cv,
|
||||
const unsigned char *cm,
|
||||
const unsigned char *ephemeralKey,
|
||||
const unsigned char *zkproof
|
||||
);
|
||||
|
||||
/// Finally checks the validity of the entire Sapling
|
||||
/// transaction given valueBalance and the binding signature.
|
||||
bool librustzcash_sapling_final_check(
|
||||
void *ctx,
|
||||
int64_t valueBalance,
|
||||
const unsigned char *bindingSig,
|
||||
const unsigned char *sighashValue
|
||||
);
|
||||
|
||||
/// Frees a Sapling verification context returned from
|
||||
/// `librustzcash_sapling_verification_ctx_init`.
|
||||
void librustzcash_sapling_verification_ctx_free(void *);
|
||||
}
|
||||
|
||||
#endif // LIBRUSTZCASH_INCLUDE_H_
|
||||
|
||||
Reference in New Issue
Block a user