Skip to content

Commit 95c05af

Browse files
Refuse to compile when curve not selected.
1 parent a44f482 commit 95c05af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libff/common/default_types/ec_pp.hpp

+9
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,47 @@
1616
/************************ Pick the elliptic curve ****************************/
1717

1818
#ifdef CURVE_ALT_BN128
19+
#define LIBFF_DEFAULT_EC_PP_DEFINED
1920
#include <libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
2021
namespace libff {
2122
typedef alt_bn128_pp default_ec_pp;
2223
} // libff
2324
#endif
2425

2526
#ifdef CURVE_BN128
27+
#define LIBFF_DEFAULT_EC_PP_DEFINED
2628
#include <libff/algebra/curves/bn128/bn128_pp.hpp>
2729
namespace libff {
2830
typedef bn128_pp default_ec_pp;
2931
} // libff
3032
#endif
3133

3234
#ifdef CURVE_EDWARDS
35+
#define LIBFF_DEFAULT_EC_PP_DEFINED
3336
#include <libff/algebra/curves/edwards/edwards_pp.hpp>
3437
namespace libff {
3538
typedef edwards_pp default_ec_pp;
3639
} // libff
3740
#endif
3841

3942
#ifdef CURVE_MNT4
43+
#define LIBFF_DEFAULT_EC_PP_DEFINED
4044
#include <libff/algebra/curves/mnt/mnt4/mnt4_pp.hpp>
4145
namespace libff {
4246
typedef mnt4_pp default_ec_pp;
4347
} // libff
4448
#endif
4549

4650
#ifdef CURVE_MNT6
51+
#define LIBFF_DEFAULT_EC_PP_DEFINED
4752
#include <libff/algebra/curves/mnt/mnt6/mnt6_pp.hpp>
4853
namespace libff {
4954
typedef mnt6_pp default_ec_pp;
5055
} // libff
5156
#endif
5257

58+
#ifndef LIBFF_DEFAULT_EC_PP_DEFINED
59+
#error You must define one of the CURVE_* symbols to pick a curve for pairings.
60+
#endif
61+
5362
#endif // EC_PP_HPP_

0 commit comments

Comments
 (0)