Browse Source

Add a tool for profiling the creation of JoinSplits

v1.0.9-lin
Jack Grigg 8 years ago
parent
commit
d0ce704abe
No known key found for this signature in database GPG Key ID: 6A6914DAFBEA00DA
  1. 13
      src/Makefile.zcash.include
  2. 32
      src/zcash/CreateJoinSplit.cpp

13
src/Makefile.zcash.include

@ -1,5 +1,6 @@
bin_PROGRAMS += \
zcash/GenerateParams
zcash/GenerateParams \
zcash/CreateJoinSplit
# tool for generating our public parameters
zcash_GenerateParams_SOURCES = zcash/GenerateParams.cpp
@ -9,3 +10,13 @@ zcash_GenerateParams_LDADD = \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CRYPTO) \
$(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

@ -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);
}
}
Loading…
Cancel
Save