Skip to content

Commit

Permalink
plonk: renamed example.tcc to example.cpp. added example.cpp and bls1…
Browse files Browse the repository at this point in the history
…2_381_test_vector_transcript_hasher.cpp to CMakeLists.txt. added several headers to fix compilation errors.
Vesselin Velichkov committed Oct 13, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent df84c9c commit a2194c1
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libsnark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ if ("${IS_LIBSNARK_PARENT}")
libsnark_test(test_r1cs_ppzksnark_verifier_gadget gadgetlib1/tests/test_r1cs_ppzksnark_verifier_gadget.cpp)
libsnark_test(test_r1cs_gg_ppzksnark_verifier_gadget gadgetlib1/tests/test_r1cs_gg_ppzksnark_verifier_gadget.cpp)
libsnark_test(test_kzg10_verifier_gadget gadgetlib1/tests/test_kzg10_verifier_gadget.cpp)
libsnark_test(test_plonk zk_proof_systems/plonk/tests/test_plonk.cpp)
libsnark_test(test_plonk zk_proof_systems/plonk/tests/example.cpp zk_proof_systems/plonk/tests/bls12_381_test_vector_transcript_hasher.cpp zk_proof_systems/plonk/tests/test_plonk.cpp)

# TODO (howardwu): Resolve runtime on targets:
# libsnark_test(zk_proof_systems_uscs_ppzksnark_test zk_proof_systems/ppzksnark/uscs_ppzksnark/tests/test_uscs_ppzksnark.cpp)
2 changes: 2 additions & 0 deletions libsnark/zk_proof_systems/plonk/circuit.hpp
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@

#include "libsnark/zk_proof_systems/plonk/utils.hpp"

#include <libff/algebra/curves/public_params.hpp>

/// Declaration of Common Preprocessed Input data structures for a
/// specific arithmetic circuit.
///
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@
#ifndef LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_CPP_
#define LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_CPP_

#include "libsnark/zk_proof_systems/plonk/tests/bls12_381_test_vector_transcript_hasher.hpp"

// Implementation of the transcript hasher interface specific to the BLS12-381
// curve. See bls12_381_test_vector_transcript_hasher.hpp
namespace libsnark
Original file line number Diff line number Diff line change
@@ -9,6 +9,10 @@
#ifndef LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_HPP_
#define LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_HPP_

#include "libsnark/zk_proof_systems/plonk/utils.hpp"

#include <array>

namespace libsnark
{

@@ -118,6 +122,4 @@ class bls12_381_test_vector_transcript_hasher

} // namespace libsnark

#include "libsnark/zk_proof_systems/plonk/tests/bls12_381_test_vector_transcript_hasher.cpp"

#endif // LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_HPP_
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@

// Instantiation of the test vector values from the Python implementation
// of the Plonk protocol. \see example.hpp .
#include "libsnark/zk_proof_systems/plonk/tests/example.hpp"

namespace libsnark
{
4 changes: 0 additions & 4 deletions libsnark/zk_proof_systems/plonk/tests/example.hpp
Original file line number Diff line number Diff line change
@@ -31,8 +31,6 @@
#include "libsnark/zk_proof_systems/plonk/circuit.hpp"

#include <libff/algebra/curves/bls12_381/bls12_381_pp.hpp>
#include <libff/algebra/scalar_multiplication/multiexp.hpp>
#include <libfqfft/evaluation_domain/get_evaluation_domain.hpp>
#include <libfqfft/polynomial_arithmetic/naive_evaluate.hpp>

namespace libsnark
@@ -307,6 +305,4 @@ class plonk_example

} // namespace libsnark

#include <libsnark/zk_proof_systems/plonk/tests/example.tcc>

#endif // LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_EXAMPLE_HPP_
2 changes: 2 additions & 0 deletions libsnark/zk_proof_systems/plonk/utils.hpp
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@
#include "libsnark/zk_proof_systems/plonk/tests/example.hpp"

#include <libff/algebra/curves/public_params.hpp>
#include <libff/algebra/scalar_multiplication/multiexp.hpp>
#include <libfqfft/evaluation_domain/get_evaluation_domain.hpp>
#include <memory>

// enable debug checks. in particular enable comparisons to test

0 comments on commit a2194c1

Please sign in to comment.