]> Git Repo - VerusCoin.git/commitdiff
Added public zkSNARK parameter generation utility.
authorSean Bowe <[email protected]>
Thu, 5 May 2016 00:26:24 +0000 (18:26 -0600)
committerSean Bowe <[email protected]>
Thu, 12 May 2016 22:44:49 +0000 (16:44 -0600)
.gitignore
src/Makefile.zcash.include
src/zcash/GenerateParams.cpp [new file with mode: 0644]

index 5f91b9d029dc2f82f80fd31dc28da4b221e01a1d..0254fdc5f800b3e46a1f84fa81c218eccc6ac04e 100644 (file)
@@ -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
index 9a567a1772177571dabf708ee1c8ba3a436cc065..a0867171e3c1f789042e33626a37ef8aa51b58b1 100644 (file)
@@ -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)
 
diff --git a/src/zcash/GenerateParams.cpp b/src/zcash/GenerateParams.cpp
new file mode 100644 (file)
index 0000000..10ffbd0
--- /dev/null
@@ -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;
+}
This page took 0.028436 seconds and 4 git commands to generate.