Skip to content

Commit

Permalink
Added public zkSNARK parameter generation utility.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebfull committed May 12, 2016
1 parent 2dc3599 commit 5975bf1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ src/test/test_bitcoin
src/qt/test/test_bitcoin-qt

# zerocash tests and utilities
src/zcash/GenerateParams
src/zerocash/GenerateParamsForFiles
src/zerocash/tests/merkleTest
src/zerocash/tests/utilTest
Expand Down
7 changes: 4 additions & 3 deletions src/Makefile.zcash.include
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
bin_PROGRAMS += \
zerocash/GenerateParamsForFiles \
zcash/GenerateParams \
zerocash/tests/utilTest \
zerocash/tests/zerocashTest \
zerocash/tests/test_zerocash_pour_ppzksnark

# tool for generating our public parameters
zerocash_GenerateParamsForFiles_SOURCES = zerocash/GenerateParamsForFiles.cpp
zerocash_GenerateParamsForFiles_LDADD = \
zcash_GenerateParams_SOURCES = zcash/GenerateParams.cpp
zcash_GenerateParams_LDADD = \
$(BOOST_LIBS) \
$(LIBZEROCASH) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CRYPTO) \
$(LIBZEROCASH_LIBS)

Expand Down
21 changes: 21 additions & 0 deletions src/zcash/GenerateParams.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "zcash/JoinSplit.hpp"

#include <iostream>

int main(int argc, char **argv)
{
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " provingKeyFileName verificationKeyFileName" << std::endl;
return 1;
}

std::string pkFile = argv[1];
std::string vkFile = argv[2];

auto p = ZCJoinSplit::Generate();

p->saveProvingKey(pkFile);
p->saveVerifyingKey(vkFile);

return 0;
}

0 comments on commit 5975bf1

Please sign in to comment.