pairing/detail/edwards/183/params.hpp
Go to the documentation of this file.
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2020-2021 Mikhail Komarov <nemo@nil.foundation>
3 // Copyright (c) 2020-2021 Nikita Kaskov <nbering@nil.foundation>
4 //
5 // MIT License
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
8 // of this software and associated documentation files (the "Software"), to deal
9 // in the Software without restriction, including without limitation the rights
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 // copies of the Software, and to permit persons to whom the Software is
12 // furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included in all
15 // copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 // SOFTWARE.
24 //---------------------------------------------------------------------------//
25 
26 #ifndef CRYPTO3_ALGEBRA_PAIRING_EDWARDS_183_PAIRING_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_PAIRING_EDWARDS_183_PAIRING_PARAMS_HPP
28 
30 
31 namespace nil {
32  namespace crypto3 {
33  namespace algebra {
34  namespace pairing {
35  namespace detail {
36 
37  template<typename CurveType>
38  class pairing_params;
39 
40  template<>
41  class pairing_params<curves::edwards<183>> {
43 
44  public:
45  using integral_type = typename curve_type::base_field_type::integral_type;
46  using extended_integral_type = typename curve_type::base_field_type::extended_integral_type;
47 
48  constexpr static const std::size_t integral_type_max_bits =
49  curve_type::base_field_type::modulus_bits;
50 
51  constexpr static const integral_type ate_loop_count =
52  integral_type(0xE841DEEC0A9E39280000003_cppui92);
53 
54  constexpr static const integral_type final_exponent_last_chunk_abs_of_w0 =
55  integral_type(0x3A1077BB02A78E4A00000003_cppui94);
56  constexpr static const bool final_exponent_last_chunk_is_w0_neg = true;
57 
58  constexpr static const integral_type final_exponent_last_chunk_w1 = integral_type(0x4);
59 
60  constexpr static const extended_integral_type final_exponent = extended_integral_type(
61  0x11128FF78CE1BA3ED7BDC08DC0E8027077FC9348F971A3EF1053C9D33B1AA7CEBA86030D02292F9F5E784FDE9EE9D0176DBE7DA7ECBBCB64CDC0ACD4E64D7156C2F84EE1AAFA1098707148DB1E4797E330E5D507E78D8246A4843B4A174E7CD7CA937BDC5D67A6176F9A48984764500000000_cppui913);
62 
63  using g2_field_type_value = typename curve_type::template g2_type<>::field_type::value_type;
64 
65  constexpr static const g2_field_type_value twist =
66  curve_type::template g2_type<>::value_type::twist;
67  };
68 
69  constexpr typename pairing_params<curves::edwards<183>>::integral_type const
70  pairing_params<curves::edwards<183>>::ate_loop_count;
71  constexpr typename pairing_params<curves::edwards<183>>::integral_type const
72  pairing_params<curves::edwards<183>>::final_exponent_last_chunk_abs_of_w0;
73 
74  constexpr typename pairing_params<curves::edwards<183>>::integral_type const
75  pairing_params<curves::edwards<183>>::final_exponent_last_chunk_w1;
76 
77  constexpr typename pairing_params<curves::edwards<183>>::extended_integral_type const
78  pairing_params<curves::edwards<183>>::final_exponent;
79 
80  constexpr bool const pairing_params<curves::edwards<183>>::final_exponent_last_chunk_is_w0_neg;
81 
82  } // namespace detail
83  } // namespace pairing
84  } // namespace algebra
85  } // namespace crypto3
86 } // namespace nil
87 
88 #endif // CRYPTO3_ALGEBRA_PAIRING_EDWARDS_183_PAIRING_PARAMS_HPP
typename curve_type::base_field_type::extended_integral_type extended_integral_type
Definition: pairing/detail/edwards/183/params.hpp:46
typename curve_type::base_field_type::integral_type integral_type
Definition: pairing/detail/edwards/183/params.hpp:45
typename curve_type::template g2_type<>::field_type::value_type g2_field_type_value
Definition: pairing/detail/edwards/183/params.hpp:63
Definition: pairing/detail/alt_bn128/params.hpp:38
edwards_base_field< Version > edwards
Definition: edwards/base_field.hpp:86
Definition: pair.hpp:31
A struct representing a Edwards curve, providing 128 bits of security.
Definition: curves/edwards.hpp:51