-
Notifications
You must be signed in to change notification settings - Fork 27
/
zeth_config.h.in
101 lines (77 loc) · 2.16 KB
/
zeth_config.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Copyright (c) 2015-2022 Clearmatics Technologies Ltd
//
// SPDX-License-Identifier: LGPL-3.0+
#ifndef __ZETH_CONFIG_H__
#define __ZETH_CONFIG_H__
// The configured options and settings for Tutorial
#define ZETH_VERSION_MAJOR @ZETH_VERSION_MAJOR@
#define ZETH_VERSION_MINOR @ZETH_VERSION_MINOR@
#define ZETH_CURVE_@ZETH_CURVE@ 1
#define ZETH_SNARK_@ZETH_SNARK@ 1
// Select the curve based on the ZETH_CURVE_* variable
#if defined(ZETH_CURVE_ALT_BN128)
#define CURVE_ALT_BN128
#include <libff/common/default_types/ec_pp.hpp>
#undef CURVE_ALT_BN128
#elif defined(ZETH_CURVE_BN128)
#define CURVE_BN128
#define BN_SUPPORT_SNARK 1
#include <libff/common/default_types/ec_pp.hpp>
#undef BN_SUPPORT_SNARK
#undef CURVE_BN128
#elif defined(ZETH_CURVE_EDWARDS)
#define CURVE_EDWARDS
#include <libff/common/default_types/ec_pp.hpp>
#undef CURVE_EDWARDS
#elif defined(ZETH_CURVE_MNT4)
#define CURVE_MNT4
#include <libff/common/default_types/ec_pp.hpp>
#undef CURVE_MNT4
#elif defined(ZETH_CURVE_MNT6)
#define CURVE_MNT6
#include <libff/common/default_types/ec_pp.hpp>
#undef CURVE_MNT6
#elif defined(ZETH_CURVE_BLS12_377)
#define CURVE_BLS12_377
#include <libff/common/default_types/ec_pp.hpp>
#undef CURVE_BLS12_377
#elif defined(ZETH_CURVE_BW6_761)
#define CURVE_BW6_761
#include <libff/common/default_types/ec_pp.hpp>
#undef CURVE_BW6_761
#else
#error "ZETH_CURVE_* variable not defined"
#endif
namespace libzeth
{
namespace defaults
{
using pp = libff::default_ec_pp;
using Field = libff::Fr<pp>;
} // namespace defaults
} // namespace libzeth
// Select a snark based on the ZETH_SNARK_* variable
#if defined(ZETH_SNARK_PGHR13)
#include "libzeth/snarks/pghr13/pghr13_api_handler.hpp"
namespace libzeth
{
namespace defaults
{
using snark = pghr13_snark<pp>;
using api_handler = pghr13_api_handler<pp>;
} // namespace defaults
} // namespace libzeth
#elif defined(ZETH_SNARK_GROTH16)
#include "libzeth/snarks/groth16/groth16_api_handler.hpp"
namespace libzeth
{
namespace defaults
{
using snark = groth16_snark<pp>;
using api_handler = groth16_api_handler<pp>;
} // namespace defaults
} // namespace libzeth
#else
#error "ZETH_SNARK_* variable not defined"
#endif
#endif // __ZETH_CONFIG_H__