Skip to content

Commit a2194c1

Browse files
author
Vesselin Velichkov
committed
plonk: renamed example.tcc to example.cpp. added example.cpp and bls12_381_test_vector_transcript_hasher.cpp to CMakeLists.txt. added several headers to fix compilation errors.
1 parent df84c9c commit a2194c1

File tree

7 files changed

+12
-7
lines changed

7 files changed

+12
-7
lines changed

libsnark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ if ("${IS_LIBSNARK_PARENT}")
205205
libsnark_test(test_r1cs_ppzksnark_verifier_gadget gadgetlib1/tests/test_r1cs_ppzksnark_verifier_gadget.cpp)
206206
libsnark_test(test_r1cs_gg_ppzksnark_verifier_gadget gadgetlib1/tests/test_r1cs_gg_ppzksnark_verifier_gadget.cpp)
207207
libsnark_test(test_kzg10_verifier_gadget gadgetlib1/tests/test_kzg10_verifier_gadget.cpp)
208-
libsnark_test(test_plonk zk_proof_systems/plonk/tests/test_plonk.cpp)
208+
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)
209209

210210
# TODO (howardwu): Resolve runtime on targets:
211211
# libsnark_test(zk_proof_systems_uscs_ppzksnark_test zk_proof_systems/ppzksnark/uscs_ppzksnark/tests/test_uscs_ppzksnark.cpp)

libsnark/zk_proof_systems/plonk/circuit.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

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

14+
#include <libff/algebra/curves/public_params.hpp>
15+
1416
/// Declaration of Common Preprocessed Input data structures for a
1517
/// specific arithmetic circuit.
1618
///

libsnark/zk_proof_systems/plonk/tests/bls12_381_test_vector_transcript_hasher.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_CPP_
1010
#define LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_CPP_
1111

12+
#include "libsnark/zk_proof_systems/plonk/tests/bls12_381_test_vector_transcript_hasher.hpp"
13+
1214
// Implementation of the transcript hasher interface specific to the BLS12-381
1315
// curve. See bls12_381_test_vector_transcript_hasher.hpp
1416
namespace libsnark

libsnark/zk_proof_systems/plonk/tests/bls12_381_test_vector_transcript_hasher.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#ifndef LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_HPP_
1010
#define LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_HPP_
1111

12+
#include "libsnark/zk_proof_systems/plonk/utils.hpp"
13+
14+
#include <array>
15+
1216
namespace libsnark
1317
{
1418

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

119123
} // namespace libsnark
120124

121-
#include "libsnark/zk_proof_systems/plonk/tests/bls12_381_test_vector_transcript_hasher.cpp"
122-
123125
#endif // LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_BLS12_381_TEST_VECTOR_TRANSCRIPT_HASHER_HPP_

libsnark/zk_proof_systems/plonk/tests/example.tcc renamed to libsnark/zk_proof_systems/plonk/tests/example.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

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

1415
namespace libsnark
1516
{

libsnark/zk_proof_systems/plonk/tests/example.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include "libsnark/zk_proof_systems/plonk/circuit.hpp"
3232

3333
#include <libff/algebra/curves/bls12_381/bls12_381_pp.hpp>
34-
#include <libff/algebra/scalar_multiplication/multiexp.hpp>
35-
#include <libfqfft/evaluation_domain/get_evaluation_domain.hpp>
3634
#include <libfqfft/polynomial_arithmetic/naive_evaluate.hpp>
3735

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

308306
} // namespace libsnark
309307

310-
#include <libsnark/zk_proof_systems/plonk/tests/example.tcc>
311-
312308
#endif // LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_TESTS_EXAMPLE_HPP_

libsnark/zk_proof_systems/plonk/utils.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "libsnark/zk_proof_systems/plonk/tests/example.hpp"
1313

1414
#include <libff/algebra/curves/public_params.hpp>
15+
#include <libff/algebra/scalar_multiplication/multiexp.hpp>
16+
#include <libfqfft/evaluation_domain/get_evaluation_domain.hpp>
1517
#include <memory>
1618

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

0 commit comments

Comments
 (0)