Skip to content

Commit 0a92e22

Browse files
authored
Merge pull request #78 from popoffka/absolute-includes
Refactor includes (attempt #2, with absolute paths)
2 parents d29ef76 + c1df6b5 commit 0a92e22

File tree

331 files changed

+1631
-1633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+1631
-1633
lines changed

.gitignore

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,46 @@ depinst/
66
depsrc/
77
README.html
88
doxygen/
9-
src/gadgetlib2/examples/tutorial
10-
src/gadgetlib2/tests/gadgetlib2_test
9+
libsnark/gadgetlib2/examples/tutorial
10+
libsnark/gadgetlib2/tests/gadgetlib2_test
1111

12-
src/algebra/curves/tests/test_bilinearity
13-
src/algebra/curves/tests/test_groups
14-
src/algebra/fields/tests/test_fields
15-
src/common/routing_algorithms/profiling/profile_routing_algorithms
16-
src/common/routing_algorithms/tests/test_routing_algorithms
17-
src/gadgetlib1/gadgets/cpu_checkers/fooram/examples/test_fooram
18-
src/gadgetlib1/gadgets/hashes/knapsack/tests/test_knapsack_gadget
19-
src/gadgetlib1/gadgets/hashes/sha256/tests/test_sha256_gadget
20-
src/gadgetlib1/gadgets/merkle_tree/tests/test_merkle_tree_gadgets
21-
src/gadgetlib1/gadgets/routing/profiling/profile_routing_gadgets
22-
src/gadgetlib1/gadgets/set_commitment/tests/test_set_commitment_gadget
23-
src/gadgetlib1/gadgets/verifiers/tests/test_r1cs_ppzksnark_verifier_gadget
24-
src/reductions/ram_to_r1cs/examples/demo_arithmetization
25-
src/relations/arithmetic_programs/qap/tests/test_qap
26-
src/relations/arithmetic_programs/ssp/tests/test_ssp
27-
src/zk_proof_systems/pcd/r1cs_pcd/r1cs_mp_ppzkpcd/profiling/profile_r1cs_mp_ppzkpcd
28-
src/zk_proof_systems/pcd/r1cs_pcd/r1cs_mp_ppzkpcd/tests/test_r1cs_mp_ppzkpcd
29-
src/zk_proof_systems/pcd/r1cs_pcd/r1cs_sp_ppzkpcd/profiling/profile_r1cs_sp_ppzkpcd
30-
src/zk_proof_systems/pcd/r1cs_pcd/r1cs_sp_ppzkpcd/tests/test_r1cs_sp_ppzkpcd
31-
src/zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/examples/demo_r1cs_ppzkadsnark
32-
src/zk_proof_systems/ppzksnark/bacs_ppzksnark/profiling/profile_bacs_ppzksnark
33-
src/zk_proof_systems/ppzksnark/bacs_ppzksnark/tests/test_bacs_ppzksnark
34-
src/zk_proof_systems/ppzksnark/r1cs_gg_ppzksnark/profiling/profile_r1cs_gg_ppzksnark
35-
src/zk_proof_systems/ppzksnark/r1cs_gg_ppzksnark/tests/test_r1cs_gg_ppzksnark
36-
src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/profiling/profile_r1cs_ppzksnark
37-
src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/tests/test_r1cs_ppzksnark
38-
src/zk_proof_systems/ppzksnark/ram_ppzksnark/examples/demo_ram_ppzksnark
39-
src/zk_proof_systems/ppzksnark/ram_ppzksnark/examples/demo_ram_ppzksnark_generator
40-
src/zk_proof_systems/ppzksnark/ram_ppzksnark/examples/demo_ram_ppzksnark_prover
41-
src/zk_proof_systems/ppzksnark/ram_ppzksnark/examples/demo_ram_ppzksnark_verifier
42-
src/zk_proof_systems/ppzksnark/ram_ppzksnark/profiling/profile_ram_ppzksnark
43-
src/zk_proof_systems/ppzksnark/ram_ppzksnark/tests/test_ram_ppzksnark
44-
src/zk_proof_systems/ppzksnark/tbcs_ppzksnark/profiling/profile_tbcs_ppzksnark
45-
src/zk_proof_systems/ppzksnark/tbcs_ppzksnark/tests/test_tbcs_ppzksnark
46-
src/zk_proof_systems/ppzksnark/uscs_ppzksnark/profiling/profile_uscs_ppzksnark
47-
src/zk_proof_systems/ppzksnark/uscs_ppzksnark/tests/test_uscs_ppzksnark
48-
src/zk_proof_systems/zksnark/ram_zksnark/profiling/profile_ram_zksnark
49-
src/zk_proof_systems/zksnark/ram_zksnark/tests/test_ram_zksnark
12+
libsnark/algebra/curves/tests/test_bilinearity
13+
libsnark/algebra/curves/tests/test_groups
14+
libsnark/algebra/fields/tests/test_fields
15+
libsnark/common/routing_algorithms/profiling/profile_routing_algorithms
16+
libsnark/common/routing_algorithms/tests/test_routing_algorithms
17+
libsnark/gadgetlib1/gadgets/cpu_checkers/fooram/examples/test_fooram
18+
libsnark/gadgetlib1/gadgets/hashes/knapsack/tests/test_knapsack_gadget
19+
libsnark/gadgetlib1/gadgets/hashes/sha256/tests/test_sha256_gadget
20+
libsnark/gadgetlib1/gadgets/merkle_tree/tests/test_merkle_tree_gadgets
21+
libsnark/gadgetlib1/gadgets/routing/profiling/profile_routing_gadgets
22+
libsnark/gadgetlib1/gadgets/set_commitment/tests/test_set_commitment_gadget
23+
libsnark/gadgetlib1/gadgets/verifiers/tests/test_r1cs_ppzksnark_verifier_gadget
24+
libsnark/reductions/ram_to_r1cs/examples/demo_arithmetization
25+
libsnark/relations/arithmetic_programs/qap/tests/test_qap
26+
libsnark/relations/arithmetic_programs/ssp/tests/test_ssp
27+
libsnark/zk_proof_systems/pcd/r1cs_pcd/r1cs_mp_ppzkpcd/profiling/profile_r1cs_mp_ppzkpcd
28+
libsnark/zk_proof_systems/pcd/r1cs_pcd/r1cs_mp_ppzkpcd/tests/test_r1cs_mp_ppzkpcd
29+
libsnark/zk_proof_systems/pcd/r1cs_pcd/r1cs_sp_ppzkpcd/profiling/profile_r1cs_sp_ppzkpcd
30+
libsnark/zk_proof_systems/pcd/r1cs_pcd/r1cs_sp_ppzkpcd/tests/test_r1cs_sp_ppzkpcd
31+
libsnark/zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/examples/demo_r1cs_ppzkadsnark
32+
libsnark/zk_proof_systems/ppzksnark/bacs_ppzksnark/profiling/profile_bacs_ppzksnark
33+
libsnark/zk_proof_systems/ppzksnark/bacs_ppzksnark/tests/test_bacs_ppzksnark
34+
libsnark/zk_proof_systems/ppzksnark/r1cs_gg_ppzksnark/profiling/profile_r1cs_gg_ppzksnark
35+
libsnark/zk_proof_systems/ppzksnark/r1cs_gg_ppzksnark/tests/test_r1cs_gg_ppzksnark
36+
libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/profiling/profile_r1cs_ppzksnark
37+
libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/tests/test_r1cs_ppzksnark
38+
libsnark/zk_proof_systems/ppzksnark/ram_ppzksnark/examples/demo_ram_ppzksnark
39+
libsnark/zk_proof_systems/ppzksnark/ram_ppzksnark/examples/demo_ram_ppzksnark_generator
40+
libsnark/zk_proof_systems/ppzksnark/ram_ppzksnark/examples/demo_ram_ppzksnark_prover
41+
libsnark/zk_proof_systems/ppzksnark/ram_ppzksnark/examples/demo_ram_ppzksnark_verifier
42+
libsnark/zk_proof_systems/ppzksnark/ram_ppzksnark/profiling/profile_ram_ppzksnark
43+
libsnark/zk_proof_systems/ppzksnark/ram_ppzksnark/tests/test_ram_ppzksnark
44+
libsnark/zk_proof_systems/ppzksnark/tbcs_ppzksnark/profiling/profile_tbcs_ppzksnark
45+
libsnark/zk_proof_systems/ppzksnark/tbcs_ppzksnark/tests/test_tbcs_ppzksnark
46+
libsnark/zk_proof_systems/ppzksnark/uscs_ppzksnark/profiling/profile_uscs_ppzksnark
47+
libsnark/zk_proof_systems/ppzksnark/uscs_ppzksnark/tests/test_uscs_ppzksnark
48+
libsnark/zk_proof_systems/zksnark/ram_zksnark/profiling/profile_ram_zksnark
49+
libsnark/zk_proof_systems/zksnark/ram_zksnark/tests/test_ram_zksnark
5050

5151
build

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,11 @@ INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
143143

144144
# libfqfft
145145
find_path(LIBFQFFT_INCLUDE_DIR NAMES libfqfft)
146-
set(LIBFQFFT_DIRECTORY ${LIBFQFFT_INCLUDE_DIR}/libfqfft)
147-
include_directories(${LIBFQFFT_DIRECTORY})
146+
include_directories(${LIBFQFFT_INCLUDE_DIR})
148147

149148
# libff
150149
find_path(LIBFF_INCLUDE_DIR NAMES libff)
151-
include_directories(${LIBFF_INCLUDE_DIR}/libff)
150+
include_directories(${LIBFF_INCLUDE_DIR})
152151
find_library(LIBFF_LIBRARIES NAMES ff libff)
153152

154153
add_definitions(
@@ -244,4 +243,4 @@ endif(CCACHE_FOUND)
244243
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
245244

246245
add_subdirectory(third_party)
247-
add_subdirectory(src)
246+
add_subdirectory(libsnark)

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ The libsnark library relies on the following:
232232
So far we have tested these only on Linux, though we have been able to make the
233233
libsnark work, with some features disabled (such as memory profiling or GTest tests),
234234
on Windows via Cygwin and on Mac OS X. See also the notes on [portability](#portability)
235-
below. (If you port libsnark to additional platforms, please let us know!)
235+
below. (If you port libsnark to additional platforms, please let us know!)
236236

237237
Concretely, here are the requisite packages in some Linux distributions:
238238

@@ -263,7 +263,7 @@ Fetch dependencies from their GitHub repos:
263263

264264
Create the Makefile:
265265

266-
$ mkdir build && cd build && cmake ..
266+
$ mkdir build && cd build && cmake ..
267267

268268
Then, to compile the library, tests, and profiling harness, run this within the `build directory:
269269

@@ -287,7 +287,7 @@ This will install `libsnark.a` into `/install/path/lib`; so your application sho
287287

288288
In addition, unless you use `WITH_SUPERCOP=OFF`, `libsnark_adsnark.a` will be installed and should be linked in using `-lsnark_adsnark`.
289289

290-
When you use compile you application against `libsnark`, you must have the same conditional defines (`#define FOO` or `g++ -DFOO`) as when you compiled `libsnark`, due to the use of templates. One way to figure out the correct conditional defines is to look at `build/src/CMakeFiles/snark.dir/flags.make` after running `cmake`. ([Issue #21](https://github.com/scipr-lab/libsnark/issues/21))
290+
When you use compile you application against `libsnark`, you must have the same conditional defines (`#define FOO` or `g++ -DFOO`) as when you compiled `libsnark`, due to the use of templates. One way to figure out the correct conditional defines is to look at `build/libsnark/CMakeFiles/snark.dir/flags.make` after running `cmake`. ([Issue #21](https://github.com/scipr-lab/libsnark/issues/21))
291291

292292
### Building on Windows using Cygwin
293293

@@ -315,16 +315,16 @@ Tutorials
315315

316316
libsnark includes a tutorial, and some usage examples, for the high-level API.
317317

318-
* `src/gadgetlib1/examples1` contains a simple example for constructing a
318+
* `libsnark/gadgetlib1/examples1` contains a simple example for constructing a
319319
constraint system using gadgetlib1.
320320

321-
* `src/gadgetlib2/examples` contains a tutorial for using gadgetlib2 to express
321+
* `libsnark/gadgetlib2/examples` contains a tutorial for using gadgetlib2 to express
322322
NP statements as constraint systems. It introduces basic terminology, design
323323
overview, and recommended programming style. It also shows how to invoke
324324
ppzkSNARKs on such constraint systems. The main file, `tutorial.cpp`, builds
325325
into a standalone executable.
326326

327-
* `src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/profiling/profile_r1cs_ppzksnark.cpp`
327+
* `libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/profiling/profile_r1cs_ppzksnark.cpp`
328328
constructs a simple constraint system and runs the ppzksnark. See below for how to
329329
run it.
330330

@@ -335,7 +335,7 @@ Executing profiling example
335335

336336
The command
337337

338-
$ src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/profiling/profile_r1cs_ppzksnark 1000 10 Fr
338+
$ libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/profiling/profile_r1cs_ppzksnark 1000 10 Fr
339339

340340
exercises the ppzkSNARK (first generator, then prover, then verifier) on an
341341
R1CS instance with 1000 equations and an input consisting of 10 field elements.
@@ -345,7 +345,7 @@ R1CS instance with 1000 equations and an input consisting of 10 field elements.
345345

346346
The command
347347

348-
$ src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/profiling/profile_r1cs_ppzksnark 1000 10 bytes
348+
$ libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/profiling/profile_r1cs_ppzksnark 1000 10 bytes
349349

350350
does the same but now the input consists of 10 bytes.
351351

@@ -487,7 +487,7 @@ Directory structure
487487

488488
The directory structure of the libsnark library is as follows:
489489

490-
* src/ --- main C++ source code, containing the following modules:
490+
* libsnark/ --- main C++ source code, containing the following modules:
491491
* common/ --- miscellaneous utilities
492492
* gadgetlib1/ --- gadgetlib1, a library to construct R1CS instances
493493
* gadgets/ --- basic gadgets for gadgetlib1
@@ -505,7 +505,7 @@ The directory structure of the libsnark library is as follows:
505505
* examples/ --- example code and tutorials for this module
506506
* tests/ --- unit tests for this module
507507

508-
In particular, the top-level API examples are at `src/r1cs_ppzksnark/examples/` and `src/gadgetlib2/examples/`.
508+
In particular, the top-level API examples are at `libsnark/r1cs_ppzksnark/examples/` and `libsnark/gadgetlib2/examples/`.
509509

510510

511511
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)