Add a tool for profiling the creation of JoinSplits
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
bin_PROGRAMS += \
|
bin_PROGRAMS += \
|
||||||
zcash/GenerateParams
|
zcash/GenerateParams \
|
||||||
|
zcash/CreateJoinSplit
|
||||||
|
|
||||||
# tool for generating our public parameters
|
# tool for generating our public parameters
|
||||||
zcash_GenerateParams_SOURCES = zcash/GenerateParams.cpp
|
zcash_GenerateParams_SOURCES = zcash/GenerateParams.cpp
|
||||||
@@ -9,3 +10,13 @@ zcash_GenerateParams_LDADD = \
|
|||||||
$(LIBBITCOIN_UTIL) \
|
$(LIBBITCOIN_UTIL) \
|
||||||
$(LIBBITCOIN_CRYPTO) \
|
$(LIBBITCOIN_CRYPTO) \
|
||||||
$(LIBZCASH_LIBS)
|
$(LIBZCASH_LIBS)
|
||||||
|
|
||||||
|
# tool for profiling the creation of joinsplits
|
||||||
|
zcash_CreateJoinSplit_SOURCES = zcash/CreateJoinSplit.cpp
|
||||||
|
zcash_CreateJoinSplit_LDADD = \
|
||||||
|
$(LIBBITCOIN_COMMON) \
|
||||||
|
$(LIBBITCOIN_UTIL) \
|
||||||
|
$(LIBBITCOIN_CRYPTO) \
|
||||||
|
$(LIBZCASH) \
|
||||||
|
$(BOOST_LIBS) \
|
||||||
|
$(LIBZCASH_LIBS)
|
||||||
|
|||||||
32
src/zcash/CreateJoinSplit.cpp
Normal file
32
src/zcash/CreateJoinSplit.cpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
// Copyright (c) 2016 The Zcash developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#include "../util.h"
|
||||||
|
#include "primitives/transaction.h"
|
||||||
|
#include "zcash/JoinSplit.hpp"
|
||||||
|
|
||||||
|
using namespace libzcash;
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
auto p = ZCJoinSplit::Unopened();
|
||||||
|
p->loadVerifyingKey((ZC_GetParamsDir() / "sprout-verifying.key").string());
|
||||||
|
p->setProvingKeyPath((ZC_GetParamsDir() / "sprout-proving.key").string());
|
||||||
|
p->loadProvingKey();
|
||||||
|
|
||||||
|
// construct a proof.
|
||||||
|
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
|
uint256 anchor = ZCIncrementalMerkleTree().root();
|
||||||
|
uint256 pubKeyHash;
|
||||||
|
|
||||||
|
JSDescription jsdesc(*p,
|
||||||
|
pubKeyHash,
|
||||||
|
anchor,
|
||||||
|
{JSInput(), JSInput()},
|
||||||
|
{JSOutput(), JSOutput()},
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user