Load Sapling testnet parameters into memory.

This commit is contained in:
Sean Bowe
2018-04-17 14:44:53 -06:00
parent ec6021950d
commit acfcdb94b9
5 changed files with 97 additions and 6 deletions

View File

@@ -7,6 +7,8 @@
#include <libsnark/common/default_types/r1cs_ppzksnark_pp.hpp>
#include <libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp>
#include "librustzcash.h"
struct ECCryptoClosure
{
ECCVerifyHandle handle;
@@ -24,6 +26,20 @@ int main(int argc, char **argv) {
boost::filesystem::path pk_path = ZC_GetParamsDir() / "sprout-proving.key";
boost::filesystem::path vk_path = ZC_GetParamsDir() / "sprout-verifying.key";
params = ZCJoinSplit::Prepared(vk_path.string(), pk_path.string());
boost::filesystem::path sapling_spend = ZC_GetParamsDir() / "sapling-spend-testnet.params";
boost::filesystem::path sapling_output = ZC_GetParamsDir() / "sapling-output-testnet.params";
boost::filesystem::path sprout_groth16 = ZC_GetParamsDir() / "sprout-groth16-testnet.params";
std::string sapling_spend_str = sapling_spend.string();
std::string sapling_output_str = sapling_output.string();
std::string sprout_groth16_str = sprout_groth16.string();
librustzcash_init_zksnark_params(
sapling_spend_str.c_str(),
sapling_output_str.c_str(),
sprout_groth16_str.c_str()
);
testing::InitGoogleMock(&argc, argv);
return RUN_ALL_TESTS();