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>
|
|
|
|
|
2018-04-12 03:51:30 +00:00
|
|
|
struct librustzcash_params {
|
|
|
|
};
|
|
|
|
|
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-12 03:51:30 +00:00
|
|
|
|
|
|
|
/// Initializes some parameters for sapling-crypto,
|
|
|
|
/// returning a pointer to the parameters. You should
|
|
|
|
/// free this when you're done with
|
2018-04-12 21:01:48 +00:00
|
|
|
/// `librustzcash_free_params()`.
|
2018-04-12 03:51:30 +00:00
|
|
|
librustzcash_params* librustzcash_init_params();
|
|
|
|
|
|
|
|
/// Frees some parameters that were previously returned
|
|
|
|
/// from `librustzcash_init_params()`. Only call this
|
|
|
|
/// once.
|
|
|
|
void librustzcash_free_params(librustzcash_params* params);
|
|
|
|
|
|
|
|
/// Computes a merkle tree hash for a given depth.
|
|
|
|
/// The `depth` parameter should not be larger than
|
|
|
|
/// 62.
|
|
|
|
///
|
|
|
|
/// Params must be a valid pointer that was returned
|
|
|
|
/// from `librustzcash_init_params()`.
|
|
|
|
///
|
|
|
|
/// `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(
|
|
|
|
const librustzcash_params* params,
|
|
|
|
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_
|