Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor includes #77

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,11 @@ INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )

# libfqfft
find_path(LIBFQFFT_INCLUDE_DIR NAMES libfqfft)
set(LIBFQFFT_DIRECTORY ${LIBFQFFT_INCLUDE_DIR}/libfqfft)
include_directories(${LIBFQFFT_DIRECTORY})
include_directories(${LIBFQFFT_INCLUDE_DIR})

# libff
find_path(LIBFF_INCLUDE_DIR NAMES libff)
include_directories(${LIBFF_INCLUDE_DIR}/libff)
include_directories(${LIBFF_INCLUDE_DIR})
find_library(LIBFF_LIBRARIES NAMES ff libff)

add_definitions(
Expand Down
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include_directories(.)

set(SNARK_EXTRALIBS)
if(${CURVE} STREQUAL "BN128")
set(
Expand Down
4 changes: 2 additions & 2 deletions src/common/data_structures/accumulation_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#ifndef ACCUMULATION_VECTOR_HPP_
#define ACCUMULATION_VECTOR_HPP_

#include "common/data_structures/sparse_vector.hpp"
#include "sparse_vector.hpp"

namespace libsnark {

Expand Down Expand Up @@ -69,6 +69,6 @@ std::istream& operator>>(std::istream &in, accumulation_vector<T> &v);

} // libsnark

#include "common/data_structures/accumulation_vector.tcc"
#include "accumulation_vector.tcc"

#endif // ACCUMULATION_VECTOR_HPP_
2 changes: 1 addition & 1 deletion src/common/data_structures/integer_permutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "common/data_structures/integer_permutation.hpp"
#include "integer_permutation.hpp"

#include <algorithm>
#include <cassert>
Expand Down
4 changes: 2 additions & 2 deletions src/common/data_structures/merkle_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <map>
#include <vector>
#include "common/utils.hpp"
#include <libff/common/utils.hpp>

namespace libsnark {

Expand Down Expand Up @@ -66,6 +66,6 @@ class merkle_tree {

} // libsnark

#include "common/data_structures/merkle_tree.tcc"
#include "merkle_tree.tcc"

#endif // MERKLE_TREE_HPP_
4 changes: 2 additions & 2 deletions src/common/data_structures/merkle_tree.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include <algorithm>

#include "common/profiling.hpp"
#include "common/utils.hpp"
#include <libff/common/profiling.hpp>
#include <libff/common/utils.hpp>

namespace libsnark {

Expand Down
4 changes: 2 additions & 2 deletions src/common/data_structures/set_commitment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "common/data_structures/set_commitment.hpp"
#include "common/serialization.hpp"
#include "set_commitment.hpp"
#include <libff/common/serialization.hpp>

namespace libsnark {

Expand Down
8 changes: 4 additions & 4 deletions src/common/data_structures/set_commitment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#ifndef SET_COMMITMENT_HPP_
#define SET_COMMITMENT_HPP_

#include "common/utils.hpp"
#include "common/data_structures/merkle_tree.hpp"
#include "gadgetlib1/gadgets/hashes/hash_io.hpp" // TODO: the current structure is suboptimal
#include <libff/common/utils.hpp>
#include "merkle_tree.hpp"
#include "../../gadgetlib1/gadgets/hashes/hash_io.hpp" // TODO: the current structure is suboptimal

namespace libsnark {

Expand Down Expand Up @@ -55,6 +55,6 @@ class set_commitment_accumulator {
/* note that set_commitment has both .cpp, for implementation of
non-templatized code (methods of set_membership_proof) and .tcc
(implementation of set_commitment_accumulator<HashT> */
#include "common/data_structures/set_commitment.tcc"
#include "set_commitment.tcc"

#endif // SET_COMMITMENT_HPP_
2 changes: 1 addition & 1 deletion src/common/data_structures/sparse_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ std::istream& operator>>(std::istream& in, sparse_vector<T> &v);

} // libsnark

#include "common/data_structures/sparse_vector.tcc"
#include "sparse_vector.tcc"

#endif // SPARSE_VECTOR_HPP_
2 changes: 1 addition & 1 deletion src/common/data_structures/sparse_vector.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef SPARSE_VECTOR_TCC_
#define SPARSE_VECTOR_TCC_

#include "algebra/scalar_multiplication/multiexp.hpp"
#include <libff/algebra/scalar_multiplication/multiexp.hpp>

#include <numeric>

Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/bacs_ppzksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef BACS_PPZKSNARK_PP_HPP_
#define BACS_PPZKSNARK_PP_HPP_

#include "common/default_types/ec_pp.hpp"
#include <libff/common/default_types/ec_pp.hpp>

namespace libsnark {
typedef libff::default_ec_pp default_bacs_ppzksnark_pp;
Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/r1cs_gg_ppzksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef R1CS_GG_PPZKSNARK_PP_HPP_
#define R1CS_GG_PPZKSNARK_PP_HPP_

#include "common/default_types/ec_pp.hpp"
#include <libff/common/default_types/ec_pp.hpp>

namespace libsnark {
typedef libff::default_ec_pp default_r1cs_gg_ppzksnark_pp;
Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/r1cs_ppzkadsnark_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "common/default_types/r1cs_ppzkadsnark_pp.hpp"
#include "r1cs_ppzkadsnark_pp.hpp"

namespace libsnark {

Expand Down
6 changes: 3 additions & 3 deletions src/common/default_types/r1cs_ppzkadsnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#ifndef R1CS_PPZKADSNARK_PP_HPP_
#define R1CS_PPZKADSNARK_PP_HPP_

#include "common/default_types/r1cs_ppzksnark_pp.hpp"
#include "zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/examples/prf/aes_ctr_prf.hpp"
#include "zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/examples/signature/ed25519_signature.hpp"
#include "r1cs_ppzksnark_pp.hpp"
#include "../../zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/examples/prf/aes_ctr_prf.hpp"
#include "../../zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/examples/signature/ed25519_signature.hpp"

namespace libsnark {

Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/r1cs_ppzkpcd_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "common/default_types/r1cs_ppzkpcd_pp.hpp"
#include "r1cs_ppzkpcd_pp.hpp"

namespace libsnark {

Expand Down
4 changes: 2 additions & 2 deletions src/common/default_types/r1cs_ppzkpcd_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

/*********************** Define default PCD cycle ***************************/

#include "algebra/curves/mnt/mnt4/mnt4_pp.hpp"
#include "algebra/curves/mnt/mnt6/mnt6_pp.hpp"
#include <libff/algebra/curves/mnt/mnt4/mnt4_pp.hpp>
#include <libff/algebra/curves/mnt/mnt6/mnt6_pp.hpp>

namespace libsnark {

Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/r1cs_ppzksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef R1CS_PPZKSNARK_PP_HPP_
#define R1CS_PPZKSNARK_PP_HPP_

#include "common/default_types/ec_pp.hpp"
#include <libff/common/default_types/ec_pp.hpp>

namespace libsnark {
typedef libff::default_ec_pp default_r1cs_ppzksnark_pp;
Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/ram_ppzksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef RAM_PPZKSNARK_PP_HPP_
#define RAM_PPZKSNARK_PP_HPP_

#include "common/default_types/tinyram_ppzksnark_pp.hpp"
#include "tinyram_ppzksnark_pp.hpp"

namespace libsnark {

Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/ram_zksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef RAM_ZKSNARK_PP_HPP_
#define RAM_ZKSNARK_PP_HPP_

#include "common/default_types/tinyram_zksnark_pp.hpp"
#include "tinyram_zksnark_pp.hpp"

namespace libsnark {

Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/tbcs_ppzksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef TBCS_PPZKSNARK_PP_HPP_
#define TBCS_PPZKSNARK_PP_HPP_

#include "common/default_types/ec_pp.hpp"
#include <libff/common/default_types/ec_pp.hpp>

namespace libsnark {
typedef libff::default_ec_pp default_tbcs_ppzksnark_pp;
Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/tinyram_ppzksnark_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "common/default_types/tinyram_ppzksnark_pp.hpp"
#include "tinyram_ppzksnark_pp.hpp"

namespace libsnark {

Expand Down
4 changes: 2 additions & 2 deletions src/common/default_types/tinyram_ppzksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#ifndef TINYRAM_PPZKSNARK_PP_HPP_
#define TINYRAM_PPZKSNARK_PP_HPP_

#include "common/default_types/r1cs_ppzksnark_pp.hpp"
#include "relations/ram_computations/rams/tinyram/tinyram_params.hpp"
#include "r1cs_ppzksnark_pp.hpp"
#include "../../relations/ram_computations/rams/tinyram/tinyram_params.hpp"

namespace libsnark {

Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/tinyram_zksnark_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "common/default_types/tinyram_zksnark_pp.hpp"
#include "tinyram_zksnark_pp.hpp"

namespace libsnark {

Expand Down
4 changes: 2 additions & 2 deletions src/common/default_types/tinyram_zksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#ifndef TINYRAM_PPZKSNARK_PP_HPP_
#define TINYRAM_PPZKSNARK_PP_HPP_

#include "common/default_types/r1cs_ppzkpcd_pp.hpp"
#include "relations/ram_computations/rams/tinyram/tinyram_params.hpp"
#include "r1cs_ppzkpcd_pp.hpp"
#include "../../relations/ram_computations/rams/tinyram/tinyram_params.hpp"

namespace libsnark {

Expand Down
2 changes: 1 addition & 1 deletion src/common/default_types/uscs_ppzksnark_pp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef USCS_PPZKSNARK_PP_HPP_
#define USCS_PPZKSNARK_PP_HPP_

#include "common/default_types/ec_pp.hpp"
#include <libff/common/default_types/ec_pp.hpp>

namespace libsnark {
typedef libff::default_ec_pp default_uscs_ppzksnark_pp;
Expand Down
2 changes: 1 addition & 1 deletion src/common/libsnark_serialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#ifndef LIBSNARK_SERIALIZATION_HPP_
#define LIBSNARK_SERIALIZATION_HPP_

#include "common/serialization.hpp"
#include <libff/common/serialization.hpp>

namespace libsnark {
using libff::consume_newline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <cassert>

#include "common/routing_algorithms/as_waksman_routing_algorithm.hpp"
#include "as_waksman_routing_algorithm.hpp"

namespace libsnark {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
#include <map>
#include <vector>

#include "common/utils.hpp"
#include "common/data_structures/integer_permutation.hpp"
#include <libff/common/utils.hpp>
#include "../data_structures/integer_permutation.hpp"

namespace libsnark {

Expand Down
2 changes: 1 addition & 1 deletion src/common/routing_algorithms/benes_routing_algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "common/routing_algorithms/benes_routing_algorithm.hpp"
#include "benes_routing_algorithm.hpp"
#include <cassert>

namespace libsnark {
Expand Down
4 changes: 2 additions & 2 deletions src/common/routing_algorithms/benes_routing_algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

#include <vector>

#include "common/data_structures/integer_permutation.hpp"
#include "common/utils.hpp"
#include "../data_structures/integer_permutation.hpp"
#include <libff/common/utils.hpp>

namespace libsnark {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

#include <algorithm>

#include "common/profiling.hpp"
#include "common/routing_algorithms/as_waksman_routing_algorithm.hpp"
#include "common/routing_algorithms/benes_routing_algorithm.hpp"
#include <libff/common/profiling.hpp>
#include "../as_waksman_routing_algorithm.hpp"
#include "../benes_routing_algorithm.hpp"

using namespace libsnark;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

#include <cassert>

#include "common/profiling.hpp"
#include "common/routing_algorithms/benes_routing_algorithm.hpp"
#include "common/routing_algorithms/as_waksman_routing_algorithm.hpp"
#include <libff/common/profiling.hpp>
#include "../benes_routing_algorithm.hpp"
#include "../as_waksman_routing_algorithm.hpp"

using namespace libsnark;

Expand Down
4 changes: 2 additions & 2 deletions src/gadgetlib1/constraint_profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "gadgetlib1/constraint_profiling.hpp"
#include "common/profiling.hpp"
#include "constraint_profiling.hpp"
#include <libff/common/profiling.hpp>

namespace libsnark {

Expand Down
4 changes: 2 additions & 2 deletions src/gadgetlib1/examples/simple_example.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef SIMPLE_EXAMPLE_HPP_
#define SIMPLE_EXAMPLE_HPP_

#include "relations/constraint_satisfaction_problems/r1cs/examples/r1cs_examples.hpp"
#include "../../relations/constraint_satisfaction_problems/r1cs/examples/r1cs_examples.hpp"

namespace libsnark {

Expand All @@ -18,6 +18,6 @@ r1cs_example<FieldT> gen_r1cs_example_from_protoboard(const size_t num_constrain

} // libsnark

#include "gadgetlib1/examples/simple_example.tcc"
#include "simple_example.tcc"

#endif // SIMPLE_EXAMPLE_HPP_
2 changes: 1 addition & 1 deletion src/gadgetlib1/examples/simple_example.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef SIMPLE_EXAMPLE_TCC_
#define SIMPLE_EXAMPLE_TCC_

#include "gadgetlib1/gadgets/basic_gadgets.hpp"
#include "../gadgets/basic_gadgets.hpp"

namespace libsnark {

Expand Down
4 changes: 2 additions & 2 deletions src/gadgetlib1/gadget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef GADGET_HPP_
#define GADGET_HPP_

#include "gadgetlib1/protoboard.hpp"
#include "protoboard.hpp"

namespace libsnark {

Expand All @@ -22,6 +22,6 @@ class gadget {
};

} // libsnark
#include "gadgetlib1/gadget.tcc"
#include "gadget.tcc"

#endif // GADGET_HPP_
Loading