Skip to content

Refactor includes #7

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

Closed
wants to merge 2 commits into from
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
4 changes: 1 addition & 3 deletions src/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)
2 changes: 1 addition & 1 deletion src/algebra/curves/alt_bn128/alt_bn128_g1.cpp
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 "alt_bn128_g1.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/alt_bn128/alt_bn128_g1.hpp
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 "alt_bn128_init.hpp"
#include "../curve_utils.hpp"

namespace libff {

Expand Down
2 changes: 1 addition & 1 deletion src/algebra/curves/alt_bn128/alt_bn128_g2.cpp
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 "alt_bn128_g2.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/alt_bn128/alt_bn128_g2.hpp
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 "alt_bn128_init.hpp"
#include "../curve_utils.hpp"

namespace libff {

Expand Down
6 changes: 3 additions & 3 deletions src/algebra/curves/alt_bn128/alt_bn128_init.cpp
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 "alt_bn128_init.hpp"
#include "alt_bn128_g1.hpp"
#include "alt_bn128_g2.hpp"

namespace libff {

Expand Down
10 changes: 5 additions & 5 deletions src/algebra/curves/alt_bn128/alt_bn128_init.hpp
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 "../public_params.hpp"
#include "../../fields/fp.hpp"
#include "../../fields/fp2.hpp"
#include "../../fields/fp6_3over2.hpp"
#include "../../fields/fp12_2over3over2.hpp"

namespace libff {

Expand Down
10 changes: 5 additions & 5 deletions src/algebra/curves/alt_bn128/alt_bn128_pairing.cpp
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 "alt_bn128_pairing.hpp"
#include "alt_bn128_init.hpp"
#include "alt_bn128_g1.hpp"
#include "alt_bn128_g2.hpp"
#include <cassert>
#include "common/profiling.hpp"
#include "../../../common/profiling.hpp"

namespace libff {

Expand Down
2 changes: 1 addition & 1 deletion src/algebra/curves/alt_bn128/alt_bn128_pairing.hpp
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 "alt_bn128_init.hpp"

namespace libff {

Expand Down
2 changes: 1 addition & 1 deletion src/algebra/curves/alt_bn128/alt_bn128_pp.cpp
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 "alt_bn128_pp.hpp"

namespace libff {

Expand Down
10 changes: 5 additions & 5 deletions src/algebra/curves/alt_bn128/alt_bn128_pp.hpp
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 "../public_params.hpp"
#include "alt_bn128_init.hpp"
#include "alt_bn128_g1.hpp"
#include "alt_bn128_g2.hpp"
#include "alt_bn128_pairing.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/bn128/bn128_g1.cpp
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 "bn128_g1.hpp"
#include "bn_utils.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/bn128/bn128_g1.hpp
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 "bn128_init.hpp"
#include "../curve_utils.hpp"
#include "third_party/ate-pairing/include/bn.h"

namespace libff {
Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/bn128/bn128_g2.cpp
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 "bn128_g2.hpp"
#include "bn_utils.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/bn128/bn128_g2.hpp
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 "bn128_init.hpp"
#include "../curve_utils.hpp"
#include "third_party/ate-pairing/include/bn.h"

namespace libff {
Expand Down
2 changes: 1 addition & 1 deletion src/algebra/curves/bn128/bn128_gt.cpp
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 "bn128_gt.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/bn128/bn128_gt.hpp
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 "../../fields/fp.hpp"
#include "../../fields/field_utils.hpp"
#include <iostream>
#include "third_party/ate-pairing/include/bn.h"

Expand Down
8 changes: 4 additions & 4 deletions src/algebra/curves/bn128/bn128_init.cpp
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 "bn128_init.hpp"
#include "bn128_g1.hpp"
#include "bn128_g2.hpp"
#include "bn128_gt.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/bn128/bn128_init.hpp
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 "../public_params.hpp"
#include "../../fields/fp.hpp"
#include "third_party/ate-pairing/include/bn.h"

namespace libff {
Expand Down
12 changes: 6 additions & 6 deletions src/algebra/curves/bn128/bn128_pairing.cpp
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 "bn128_pairing.hpp"
#include "../../../common/profiling.hpp"
#include "bn128_init.hpp"
#include "bn128_g1.hpp"
#include "bn128_g2.hpp"
#include "bn128_gt.hpp"

namespace libff {

Expand Down
6 changes: 3 additions & 3 deletions src/algebra/curves/bn128/bn128_pairing.hpp
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 "bn128_g1.hpp"
#include "bn128_g2.hpp"
#include "bn128_gt.hpp"
#include "third_party/ate-pairing/include/bn.h"

namespace libff {
Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/bn128/bn128_pp.cpp
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 "bn128_pp.hpp"
#include "../../../common/profiling.hpp"

namespace libff {

Expand Down
12 changes: 6 additions & 6 deletions src/algebra/curves/bn128/bn128_pp.hpp
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 "../public_params.hpp"
#include "bn128_init.hpp"
#include "bn128_g1.hpp"
#include "bn128_g2.hpp"
#include "bn128_gt.hpp"
#include "bn128_pairing.hpp"

namespace libff {

Expand Down
2 changes: 1 addition & 1 deletion src/algebra/curves/bn128/bn_utils.hpp
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 "bn_utils.tcc"

#endif // BN_UTILS_HPP_
4 changes: 2 additions & 2 deletions src/algebra/curves/curve_utils.hpp
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 "../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 "curve_utils.tcc"

#endif // CURVE_UTILS_HPP_
2 changes: 1 addition & 1 deletion src/algebra/curves/edwards/edwards_g1.cpp
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 "edwards_g1.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/edwards/edwards_g1.hpp
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 "edwards_init.hpp"
#include "../curve_utils.hpp"

namespace libff {

Expand Down
2 changes: 1 addition & 1 deletion src/algebra/curves/edwards/edwards_g2.cpp
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 "edwards_g2.hpp"

namespace libff {

Expand Down
4 changes: 2 additions & 2 deletions src/algebra/curves/edwards/edwards_g2.hpp
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 "edwards_init.hpp"
#include "../curve_utils.hpp"

namespace libff {

Expand Down
6 changes: 3 additions & 3 deletions src/algebra/curves/edwards/edwards_init.cpp
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 "edwards_init.hpp"
#include "edwards_g1.hpp"
#include "edwards_g2.hpp"

namespace libff {

Expand Down
8 changes: 4 additions & 4 deletions src/algebra/curves/edwards/edwards_init.hpp
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 "../public_params.hpp"
#include "../../fields/fp.hpp"
#include "../../fields/fp3.hpp"
#include "../../fields/fp6_2over3.hpp"

namespace libff {

Expand Down
10 changes: 5 additions & 5 deletions src/algebra/curves/edwards/edwards_pairing.cpp
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/edwards/edwards_pairing.hpp"
#include "algebra/curves/edwards/edwards_init.hpp"
#include "edwards_pairing.hpp"
#include "edwards_init.hpp"
#include <cassert>
#include "algebra/curves/edwards/edwards_g1.hpp"
#include "algebra/curves/edwards/edwards_g2.hpp"
#include "common/profiling.hpp"
#include "edwards_g1.hpp"
#include "edwards_g2.hpp"
#include "../../../common/profiling.hpp"

namespace libff {

Expand Down
Loading