Skip to content

Commit 0f264a2

Browse files
authored
Merge pull request #8 from popoffka/absolute-includes
Refactor includes (attempt #2, with absolute paths)
2 parents 523ca4b + 85cfc9a commit 0f264a2

File tree

103 files changed

+497
-499
lines changed

Some content is hidden

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

103 files changed

+497
-499
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,4 @@ endif(CCACHE_FOUND)
228228
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
229229

230230
add_subdirectory(third_party)
231-
add_subdirectory(src)
231+
add_subdirectory(libff)

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ ___libff___ is a C++ library for finite fields and elliptic curves. The library
1313

1414
The directory structure is as follows:
1515

16-
* [__src__](src): C++ source code, containing the following modules:
17-
* [__algebra__](src/algebra): fields and elliptic curve groups
18-
* [__common__](src/common): miscellaneous utilities
16+
* [__libff__](libff): C++ source code, containing the following modules:
17+
* [__algebra__](libff/algebra): fields and elliptic curve groups
18+
* [__common__](libff/common): miscellaneous utilities
1919
* [__third\_party__](third_party): third party libraries
2020

2121
## Elliptic curve choices

src/CMakeLists.txt libff/CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
include_directories(.)
2-
31
set(FF_EXTRASRCS)
42
set(FF_EXTRALIBS)
53
if(${CURVE} STREQUAL "BN128")
@@ -129,4 +127,4 @@ add_test(
129127

130128
add_dependencies(check algebra_bilinearity_test)
131129
add_dependencies(check algebra_groups_test)
132-
add_dependencies(check algebra_fields_test)
130+
add_dependencies(check algebra_fields_test)

src/algebra/curves/alt_bn128/alt_bn128_g1.cpp libff/algebra/curves/alt_bn128/alt_bn128_g1.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
8+
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>
99

1010
namespace libff {
1111

src/algebra/curves/alt_bn128/alt_bn128_g1.hpp libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#ifndef ALT_BN128_G1_HPP_
99
#define ALT_BN128_G1_HPP_
1010
#include <vector>
11-
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
12-
#include "algebra/curves/curve_utils.hpp"
11+
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
12+
#include <libff/algebra/curves/curve_utils.hpp>
1313

1414
namespace libff {
1515

src/algebra/curves/alt_bn128/alt_bn128_g2.cpp libff/algebra/curves/alt_bn128/alt_bn128_g2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
8+
#include <libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp>
99

1010
namespace libff {
1111

src/algebra/curves/alt_bn128/alt_bn128_g2.hpp libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#ifndef ALT_BN128_G2_HPP_
99
#define ALT_BN128_G2_HPP_
1010
#include <vector>
11-
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
12-
#include "algebra/curves/curve_utils.hpp"
11+
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
12+
#include <libff/algebra/curves/curve_utils.hpp>
1313

1414
namespace libff {
1515

src/algebra/curves/alt_bn128/alt_bn128_init.cpp libff/algebra/curves/alt_bn128/alt_bn128_init.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
9-
#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
10-
#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
8+
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
9+
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>
10+
#include <libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp>
1111

1212
namespace libff {
1313

src/algebra/curves/alt_bn128/alt_bn128_init.hpp libff/algebra/curves/alt_bn128/alt_bn128_init.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
#ifndef ALT_BN128_INIT_HPP_
99
#define ALT_BN128_INIT_HPP_
10-
#include "algebra/curves/public_params.hpp"
11-
#include "algebra/fields/fp.hpp"
12-
#include "algebra/fields/fp2.hpp"
13-
#include "algebra/fields/fp6_3over2.hpp"
14-
#include "algebra/fields/fp12_2over3over2.hpp"
10+
#include <libff/algebra/curves/public_params.hpp>
11+
#include <libff/algebra/fields/fp.hpp>
12+
#include <libff/algebra/fields/fp2.hpp>
13+
#include <libff/algebra/fields/fp6_3over2.hpp>
14+
#include <libff/algebra/fields/fp12_2over3over2.hpp>
1515

1616
namespace libff {
1717

src/algebra/curves/alt_bn128/alt_bn128_pairing.cpp libff/algebra/curves/alt_bn128/alt_bn128_pairing.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/alt_bn128/alt_bn128_pairing.hpp"
9-
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
10-
#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
11-
#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
8+
#include <libff/algebra/curves/alt_bn128/alt_bn128_pairing.hpp>
9+
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
10+
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>
11+
#include <libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp>
1212
#include <cassert>
13-
#include "common/profiling.hpp"
13+
#include <libff/common/profiling.hpp>
1414

1515
namespace libff {
1616

src/algebra/curves/alt_bn128/alt_bn128_pairing.hpp libff/algebra/curves/alt_bn128/alt_bn128_pairing.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef ALT_BN128_PAIRING_HPP_
99
#define ALT_BN128_PAIRING_HPP_
1010
#include <vector>
11-
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
11+
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
1212

1313
namespace libff {
1414

src/algebra/curves/alt_bn128/alt_bn128_pp.cpp libff/algebra/curves/alt_bn128/alt_bn128_pp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/alt_bn128/alt_bn128_pp.hpp"
8+
#include <libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
99

1010
namespace libff {
1111

src/algebra/curves/alt_bn128/alt_bn128_pp.hpp libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
#ifndef ALT_BN128_PP_HPP_
99
#define ALT_BN128_PP_HPP_
10-
#include "algebra/curves/public_params.hpp"
11-
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
12-
#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
13-
#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
14-
#include "algebra/curves/alt_bn128/alt_bn128_pairing.hpp"
10+
#include <libff/algebra/curves/public_params.hpp>
11+
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
12+
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>
13+
#include <libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp>
14+
#include <libff/algebra/curves/alt_bn128/alt_bn128_pairing.hpp>
1515

1616
namespace libff {
1717

src/algebra/curves/bn128/bn128_g1.cpp libff/algebra/curves/bn128/bn128_g1.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/bn128/bn128_g1.hpp"
9-
#include "algebra/curves/bn128/bn_utils.hpp"
8+
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
9+
#include <libff/algebra/curves/bn128/bn_utils.hpp>
1010

1111
namespace libff {
1212

src/algebra/curves/bn128/bn128_g1.hpp libff/algebra/curves/bn128/bn128_g1.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#ifndef BN128_G1_HPP_
99
#define BN128_G1_HPP_
1010
#include <vector>
11-
#include "algebra/curves/bn128/bn128_init.hpp"
12-
#include "algebra/curves/curve_utils.hpp"
11+
#include <libff/algebra/curves/bn128/bn128_init.hpp>
12+
#include <libff/algebra/curves/curve_utils.hpp>
1313
#include "third_party/ate-pairing/include/bn.h"
1414

1515
namespace libff {

src/algebra/curves/bn128/bn128_g2.cpp libff/algebra/curves/bn128/bn128_g2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/bn128/bn128_g2.hpp"
9-
#include "algebra/curves/bn128/bn_utils.hpp"
8+
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
9+
#include <libff/algebra/curves/bn128/bn_utils.hpp>
1010

1111
namespace libff {
1212

src/algebra/curves/bn128/bn128_g2.hpp libff/algebra/curves/bn128/bn128_g2.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#define BN128_G2_HPP_
1010
#include <iostream>
1111
#include <vector>
12-
#include "algebra/curves/bn128/bn128_init.hpp"
13-
#include "algebra/curves/curve_utils.hpp"
12+
#include <libff/algebra/curves/bn128/bn128_init.hpp>
13+
#include <libff/algebra/curves/curve_utils.hpp>
1414
#include "third_party/ate-pairing/include/bn.h"
1515

1616
namespace libff {

src/algebra/curves/bn128/bn128_gt.cpp libff/algebra/curves/bn128/bn128_gt.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/bn128/bn128_gt.hpp"
8+
#include <libff/algebra/curves/bn128/bn128_gt.hpp>
99

1010
namespace libff {
1111

src/algebra/curves/bn128/bn128_gt.hpp libff/algebra/curves/bn128/bn128_gt.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#ifndef BN128_GT_HPP_
99
#define BN128_GT_HPP_
10-
#include "algebra/fields/fp.hpp"
11-
#include "algebra/fields/field_utils.hpp"
10+
#include <libff/algebra/fields/fp.hpp>
11+
#include <libff/algebra/fields/field_utils.hpp>
1212
#include <iostream>
1313
#include "third_party/ate-pairing/include/bn.h"
1414

src/algebra/curves/bn128/bn128_init.cpp libff/algebra/curves/bn128/bn128_init.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/bn128/bn128_init.hpp"
9-
#include "algebra/curves/bn128/bn128_g1.hpp"
10-
#include "algebra/curves/bn128/bn128_g2.hpp"
11-
#include "algebra/curves/bn128/bn128_gt.hpp"
8+
#include <libff/algebra/curves/bn128/bn128_init.hpp>
9+
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
10+
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
11+
#include <libff/algebra/curves/bn128/bn128_gt.hpp>
1212

1313
namespace libff {
1414

src/algebra/curves/bn128/bn128_init.hpp libff/algebra/curves/bn128/bn128_init.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#ifndef BN128_INIT_HPP_
99
#define BN128_INIT_HPP_
10-
#include "algebra/curves/public_params.hpp"
11-
#include "algebra/fields/fp.hpp"
10+
#include <libff/algebra/curves/public_params.hpp>
11+
#include <libff/algebra/fields/fp.hpp>
1212
#include "third_party/ate-pairing/include/bn.h"
1313

1414
namespace libff {

src/algebra/curves/bn128/bn128_pairing.cpp libff/algebra/curves/bn128/bn128_pairing.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
#include <sstream>
1212

13-
#include "algebra/curves/bn128/bn128_pairing.hpp"
14-
#include "common/profiling.hpp"
15-
#include "algebra/curves/bn128/bn128_init.hpp"
16-
#include "algebra/curves/bn128/bn128_g1.hpp"
17-
#include "algebra/curves/bn128/bn128_g2.hpp"
18-
#include "algebra/curves/bn128/bn128_gt.hpp"
13+
#include <libff/algebra/curves/bn128/bn128_pairing.hpp>
14+
#include <libff/common/profiling.hpp>
15+
#include <libff/algebra/curves/bn128/bn128_init.hpp>
16+
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
17+
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
18+
#include <libff/algebra/curves/bn128/bn128_gt.hpp>
1919

2020
namespace libff {
2121

src/algebra/curves/bn128/bn128_pairing.hpp libff/algebra/curves/bn128/bn128_pairing.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
#ifndef BN128_PAIRING_HPP_
1212
#define BN128_PAIRING_HPP_
13-
#include "algebra/curves/bn128/bn128_g1.hpp"
14-
#include "algebra/curves/bn128/bn128_g2.hpp"
15-
#include "algebra/curves/bn128/bn128_gt.hpp"
13+
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
14+
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
15+
#include <libff/algebra/curves/bn128/bn128_gt.hpp>
1616
#include "third_party/ate-pairing/include/bn.h"
1717

1818
namespace libff {

src/algebra/curves/bn128/bn128_pp.cpp libff/algebra/curves/bn128/bn128_pp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/bn128/bn128_pp.hpp"
9-
#include "common/profiling.hpp"
8+
#include <libff/algebra/curves/bn128/bn128_pp.hpp>
9+
#include <libff/common/profiling.hpp>
1010

1111
namespace libff {
1212

src/algebra/curves/bn128/bn128_pp.hpp libff/algebra/curves/bn128/bn128_pp.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
#ifndef BN128_PP_HPP_
99
#define BN128_PP_HPP_
10-
#include "algebra/curves/public_params.hpp"
11-
#include "algebra/curves/bn128/bn128_init.hpp"
12-
#include "algebra/curves/bn128/bn128_g1.hpp"
13-
#include "algebra/curves/bn128/bn128_g2.hpp"
14-
#include "algebra/curves/bn128/bn128_gt.hpp"
15-
#include "algebra/curves/bn128/bn128_pairing.hpp"
10+
#include <libff/algebra/curves/public_params.hpp>
11+
#include <libff/algebra/curves/bn128/bn128_init.hpp>
12+
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
13+
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
14+
#include <libff/algebra/curves/bn128/bn128_gt.hpp>
15+
#include <libff/algebra/curves/bn128/bn128_pairing.hpp>
1616

1717
namespace libff {
1818

src/algebra/curves/bn128/bn_utils.hpp libff/algebra/curves/bn128/bn_utils.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ void bn_batch_invert(std::vector<FieldT> &vec);
1717

1818
} // libff
1919

20-
#include "algebra/curves/bn128/bn_utils.tcc"
20+
#include <libff/algebra/curves/bn128/bn_utils.tcc>
2121

2222
#endif // BN_UTILS_HPP_
File renamed without changes.

src/algebra/curves/curve_utils.hpp libff/algebra/curves/curve_utils.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#define CURVE_UTILS_HPP_
1010
#include <cstdint>
1111

12-
#include "algebra/fields/bigint.hpp"
12+
#include <libff/algebra/fields/bigint.hpp>
1313

1414
namespace libff {
1515

1616
template<typename GroupT, mp_size_t m>
1717
GroupT scalar_mul(const GroupT &base, const bigint<m> &scalar);
1818

1919
} // libff
20-
#include "algebra/curves/curve_utils.tcc"
20+
#include <libff/algebra/curves/curve_utils.tcc>
2121

2222
#endif // CURVE_UTILS_HPP_
File renamed without changes.

src/algebra/curves/edwards/edwards_g1.cpp libff/algebra/curves/edwards/edwards_g1.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/edwards/edwards_g1.hpp"
8+
#include <libff/algebra/curves/edwards/edwards_g1.hpp>
99

1010
namespace libff {
1111

src/algebra/curves/edwards/edwards_g1.hpp libff/algebra/curves/edwards/edwards_g1.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#ifndef EDWARDS_G1_HPP_
99
#define EDWARDS_G1_HPP_
1010
#include <vector>
11-
#include "algebra/curves/edwards/edwards_init.hpp"
12-
#include "algebra/curves/curve_utils.hpp"
11+
#include <libff/algebra/curves/edwards/edwards_init.hpp>
12+
#include <libff/algebra/curves/curve_utils.hpp>
1313

1414
namespace libff {
1515

src/algebra/curves/edwards/edwards_g2.cpp libff/algebra/curves/edwards/edwards_g2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/edwards/edwards_g2.hpp"
8+
#include <libff/algebra/curves/edwards/edwards_g2.hpp>
99

1010
namespace libff {
1111

src/algebra/curves/edwards/edwards_g2.hpp libff/algebra/curves/edwards/edwards_g2.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#define EDWARDS_G2_HPP_
1010
#include <iostream>
1111
#include <vector>
12-
#include "algebra/curves/edwards/edwards_init.hpp"
13-
#include "algebra/curves/curve_utils.hpp"
12+
#include <libff/algebra/curves/edwards/edwards_init.hpp>
13+
#include <libff/algebra/curves/curve_utils.hpp>
1414

1515
namespace libff {
1616

src/algebra/curves/edwards/edwards_init.cpp libff/algebra/curves/edwards/edwards_init.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include "algebra/curves/edwards/edwards_init.hpp"
9-
#include "algebra/curves/edwards/edwards_g1.hpp"
10-
#include "algebra/curves/edwards/edwards_g2.hpp"
8+
#include <libff/algebra/curves/edwards/edwards_init.hpp>
9+
#include <libff/algebra/curves/edwards/edwards_g1.hpp>
10+
#include <libff/algebra/curves/edwards/edwards_g2.hpp>
1111

1212
namespace libff {
1313

src/algebra/curves/edwards/edwards_init.hpp libff/algebra/curves/edwards/edwards_init.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
#ifndef EDWARDS_INIT_HPP_
99
#define EDWARDS_INIT_HPP_
10-
#include "algebra/curves/public_params.hpp"
11-
#include "algebra/fields/fp.hpp"
12-
#include "algebra/fields/fp3.hpp"
13-
#include "algebra/fields/fp6_2over3.hpp"
10+
#include <libff/algebra/curves/public_params.hpp>
11+
#include <libff/algebra/fields/fp.hpp>
12+
#include <libff/algebra/fields/fp3.hpp>
13+
#include <libff/algebra/fields/fp6_2over3.hpp>
1414

1515
namespace libff {
1616

0 commit comments

Comments
 (0)