Skip to content

Commit

Permalink
Merge pull request #8 from popoffka/absolute-includes
Browse files Browse the repository at this point in the history
Refactor includes (attempt #2, with absolute paths)
  • Loading branch information
madars authored Jun 27, 2017
2 parents 523ca4b + 85cfc9a commit 0f264a2
Show file tree
Hide file tree
Showing 103 changed files with 497 additions and 499 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ endif(CCACHE_FOUND)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})

add_subdirectory(third_party)
add_subdirectory(src)
add_subdirectory(libff)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ ___libff___ is a C++ library for finite fields and elliptic curves. The library

The directory structure is as follows:

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

## Elliptic curve choices
Expand Down
4 changes: 1 addition & 3 deletions src/CMakeLists.txt → libff/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include_directories(.)

set(FF_EXTRASRCS)
set(FF_EXTRALIBS)
if(${CURVE} STREQUAL "BN128")
Expand Down Expand Up @@ -129,4 +127,4 @@ add_test(

add_dependencies(check algebra_bilinearity_test)
add_dependencies(check algebra_groups_test)
add_dependencies(check algebra_fields_test)
add_dependencies(check algebra_fields_test)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#ifndef ALT_BN128_G1_HPP_
#define ALT_BN128_G1_HPP_
#include <vector>
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
#include "algebra/curves/curve_utils.hpp"
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
#include <libff/algebra/curves/curve_utils.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
#include <libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#ifndef ALT_BN128_G2_HPP_
#define ALT_BN128_G2_HPP_
#include <vector>
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
#include "algebra/curves/curve_utils.hpp"
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
#include <libff/algebra/curves/curve_utils.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp>

namespace libff {

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

#ifndef ALT_BN128_INIT_HPP_
#define ALT_BN128_INIT_HPP_
#include "algebra/curves/public_params.hpp"
#include "algebra/fields/fp.hpp"
#include "algebra/fields/fp2.hpp"
#include "algebra/fields/fp6_3over2.hpp"
#include "algebra/fields/fp12_2over3over2.hpp"
#include <libff/algebra/curves/public_params.hpp>
#include <libff/algebra/fields/fp.hpp>
#include <libff/algebra/fields/fp2.hpp>
#include <libff/algebra/fields/fp6_3over2.hpp>
#include <libff/algebra/fields/fp12_2over3over2.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/alt_bn128/alt_bn128_pairing.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
#include <libff/algebra/curves/alt_bn128/alt_bn128_pairing.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp>
#include <cassert>
#include "common/profiling.hpp"
#include <libff/common/profiling.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef ALT_BN128_PAIRING_HPP_
#define ALT_BN128_PAIRING_HPP_
#include <vector>
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/alt_bn128/alt_bn128_pp.hpp"
#include <libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>

namespace libff {

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

#ifndef ALT_BN128_PP_HPP_
#define ALT_BN128_PP_HPP_
#include "algebra/curves/public_params.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_init.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
#include "algebra/curves/alt_bn128/alt_bn128_pairing.hpp"
#include <libff/algebra/curves/public_params.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_init.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_pairing.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/bn128/bn128_g1.hpp"
#include "algebra/curves/bn128/bn_utils.hpp"
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
#include <libff/algebra/curves/bn128/bn_utils.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#ifndef BN128_G1_HPP_
#define BN128_G1_HPP_
#include <vector>
#include "algebra/curves/bn128/bn128_init.hpp"
#include "algebra/curves/curve_utils.hpp"
#include <libff/algebra/curves/bn128/bn128_init.hpp>
#include <libff/algebra/curves/curve_utils.hpp>
#include "third_party/ate-pairing/include/bn.h"

namespace libff {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/bn128/bn128_g2.hpp"
#include "algebra/curves/bn128/bn_utils.hpp"
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
#include <libff/algebra/curves/bn128/bn_utils.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define BN128_G2_HPP_
#include <iostream>
#include <vector>
#include "algebra/curves/bn128/bn128_init.hpp"
#include "algebra/curves/curve_utils.hpp"
#include <libff/algebra/curves/bn128/bn128_init.hpp>
#include <libff/algebra/curves/curve_utils.hpp>
#include "third_party/ate-pairing/include/bn.h"

namespace libff {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/bn128/bn128_gt.hpp"
#include <libff/algebra/curves/bn128/bn128_gt.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#ifndef BN128_GT_HPP_
#define BN128_GT_HPP_
#include "algebra/fields/fp.hpp"
#include "algebra/fields/field_utils.hpp"
#include <libff/algebra/fields/fp.hpp>
#include <libff/algebra/fields/field_utils.hpp>
#include <iostream>
#include "third_party/ate-pairing/include/bn.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/bn128/bn128_init.hpp"
#include "algebra/curves/bn128/bn128_g1.hpp"
#include "algebra/curves/bn128/bn128_g2.hpp"
#include "algebra/curves/bn128/bn128_gt.hpp"
#include <libff/algebra/curves/bn128/bn128_init.hpp>
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
#include <libff/algebra/curves/bn128/bn128_gt.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#ifndef BN128_INIT_HPP_
#define BN128_INIT_HPP_
#include "algebra/curves/public_params.hpp"
#include "algebra/fields/fp.hpp"
#include <libff/algebra/curves/public_params.hpp>
#include <libff/algebra/fields/fp.hpp>
#include "third_party/ate-pairing/include/bn.h"

namespace libff {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

#include <sstream>

#include "algebra/curves/bn128/bn128_pairing.hpp"
#include "common/profiling.hpp"
#include "algebra/curves/bn128/bn128_init.hpp"
#include "algebra/curves/bn128/bn128_g1.hpp"
#include "algebra/curves/bn128/bn128_g2.hpp"
#include "algebra/curves/bn128/bn128_gt.hpp"
#include <libff/algebra/curves/bn128/bn128_pairing.hpp>
#include <libff/common/profiling.hpp>
#include <libff/algebra/curves/bn128/bn128_init.hpp>
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
#include <libff/algebra/curves/bn128/bn128_gt.hpp>

namespace libff {

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

#ifndef BN128_PAIRING_HPP_
#define BN128_PAIRING_HPP_
#include "algebra/curves/bn128/bn128_g1.hpp"
#include "algebra/curves/bn128/bn128_g2.hpp"
#include "algebra/curves/bn128/bn128_gt.hpp"
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
#include <libff/algebra/curves/bn128/bn128_gt.hpp>
#include "third_party/ate-pairing/include/bn.h"

namespace libff {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/bn128/bn128_pp.hpp"
#include "common/profiling.hpp"
#include <libff/algebra/curves/bn128/bn128_pp.hpp>
#include <libff/common/profiling.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

#ifndef BN128_PP_HPP_
#define BN128_PP_HPP_
#include "algebra/curves/public_params.hpp"
#include "algebra/curves/bn128/bn128_init.hpp"
#include "algebra/curves/bn128/bn128_g1.hpp"
#include "algebra/curves/bn128/bn128_g2.hpp"
#include "algebra/curves/bn128/bn128_gt.hpp"
#include "algebra/curves/bn128/bn128_pairing.hpp"
#include <libff/algebra/curves/public_params.hpp>
#include <libff/algebra/curves/bn128/bn128_init.hpp>
#include <libff/algebra/curves/bn128/bn128_g1.hpp>
#include <libff/algebra/curves/bn128/bn128_g2.hpp>
#include <libff/algebra/curves/bn128/bn128_gt.hpp>
#include <libff/algebra/curves/bn128/bn128_pairing.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ void bn_batch_invert(std::vector<FieldT> &vec);

} // libff

#include "algebra/curves/bn128/bn_utils.tcc"
#include <libff/algebra/curves/bn128/bn_utils.tcc>

#endif // BN_UTILS_HPP_
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#define CURVE_UTILS_HPP_
#include <cstdint>

#include "algebra/fields/bigint.hpp"
#include <libff/algebra/fields/bigint.hpp>

namespace libff {

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

} // libff
#include "algebra/curves/curve_utils.tcc"
#include <libff/algebra/curves/curve_utils.tcc>

#endif // CURVE_UTILS_HPP_
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/edwards/edwards_g1.hpp"
#include <libff/algebra/curves/edwards/edwards_g1.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#ifndef EDWARDS_G1_HPP_
#define EDWARDS_G1_HPP_
#include <vector>
#include "algebra/curves/edwards/edwards_init.hpp"
#include "algebra/curves/curve_utils.hpp"
#include <libff/algebra/curves/edwards/edwards_init.hpp>
#include <libff/algebra/curves/curve_utils.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/edwards/edwards_g2.hpp"
#include <libff/algebra/curves/edwards/edwards_g2.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define EDWARDS_G2_HPP_
#include <iostream>
#include <vector>
#include "algebra/curves/edwards/edwards_init.hpp"
#include "algebra/curves/curve_utils.hpp"
#include <libff/algebra/curves/edwards/edwards_init.hpp>
#include <libff/algebra/curves/curve_utils.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include "algebra/curves/edwards/edwards_init.hpp"
#include "algebra/curves/edwards/edwards_g1.hpp"
#include "algebra/curves/edwards/edwards_g2.hpp"
#include <libff/algebra/curves/edwards/edwards_init.hpp>
#include <libff/algebra/curves/edwards/edwards_g1.hpp>
#include <libff/algebra/curves/edwards/edwards_g2.hpp>

namespace libff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#ifndef EDWARDS_INIT_HPP_
#define EDWARDS_INIT_HPP_
#include "algebra/curves/public_params.hpp"
#include "algebra/fields/fp.hpp"
#include "algebra/fields/fp3.hpp"
#include "algebra/fields/fp6_2over3.hpp"
#include <libff/algebra/curves/public_params.hpp>
#include <libff/algebra/fields/fp.hpp>
#include <libff/algebra/fields/fp3.hpp>
#include <libff/algebra/fields/fp6_2over3.hpp>

namespace libff {

Expand Down
Loading

0 comments on commit 0f264a2

Please sign in to comment.