-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an example of how to link to libsnark.so
Issue #18
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Set this to the directory where you installed libsnark. | ||
# If you install to linker_example (`make install PREFIX=linker_example`), | ||
# the default prefix will work. | ||
INSTALL_PREFIX=. | ||
|
||
all: | ||
$(CXX) main.cpp -o main -std=c++11 -L$(INSTALL_PREFIX)/lib -lsnark -lsupercop -lgmp -lgmpxx -I$(INSTALL_PREFIX)/include -I$(INSTALL_PREFIX)/include/libsnark -DCURVE_BN128 | ||
|
||
run: | ||
LD_LIBRARY_PATH=$(INSTALL_PREFIX)/lib ./main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <iostream> | ||
|
||
#include <gadgetlib2/examples/simple_example.hpp> | ||
#include <zk_proof_systems/ppzksnark/r1cs_ppzksnark/examples/run_r1cs_ppzksnark.hpp> | ||
|
||
int main() { | ||
const libsnark::r1cs_example<libsnark::Fr<libsnark::default_ec_pp> > example = libsnark::gen_r1cs_example_from_gadgetlib2_protoboard(100); | ||
const bool test_serialization = true; | ||
const bool bit = libsnark::run_r1cs_ppzksnark<libsnark::default_ec_pp>(example, test_serialization); | ||
std::cout << (bit ? "Success" : "Failure") << std::endl; | ||
} |