pirate-librustzcash/include/librustzcash.h

42 lines
1.2 KiB
C
Raw Normal View History

2017-03-17 17:25:08 +00:00
#ifndef LIBRUSTZCASH_INCLUDE_H_
#define LIBRUSTZCASH_INCLUDE_H_
2017-03-17 17:34:30 +00:00
#include <stdint.h>
2017-03-17 17:25:08 +00:00
extern "C" {
2017-03-17 17:36:32 +00:00
uint64_t librustzcash_xor(uint64_t a, uint64_t b);
2018-04-17 20:16:14 +00:00
/// Loads the zk-SNARK parameters into memory and saves
/// paths as necessary. Only called once.
void librustzcash_init_zksnark_params(
const char* spend_path,
const char* output_path,
const char* sprout_path
);
/// 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.
void librustzcash_tree_uncommitted(
unsigned char *result
);
/// Computes a merkle tree hash for a given depth.
/// The `depth` parameter should not be larger than
/// 62.
///
/// `a` and `b` each must be of length 32, and must each
/// be scalars of BLS12-381.
///
/// The result of the merkle tree hash is placed in
/// `result`, which must also be of length 32.
void librustzcash_merkle_hash(
size_t depth,
const unsigned char *a,
const unsigned char *b,
unsigned char *result
);
2017-03-17 17:25:08 +00:00
}
#endif // LIBRUSTZCASH_INCLUDE_H_