detail/extension_params/bn128/fp12_2over3over2.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_FIELDS_BN128_FP12_2OVER3OVER2_EXTENSION_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_FIELDS_BN128_FP12_2OVER3OVER2_EXTENSION_PARAMS_HPP
28 
33 
35 
36 namespace nil {
37  namespace crypto3 {
38  namespace algebra {
39  namespace fields {
40  namespace detail {
41 
42  template<typename BaseField>
43  struct fp12_2over3over2_extension_params;
44 
45  /************************* BN128 ***********************************/
46 
47  template<std::size_t Version>
48  class fp12_2over3over2_extension_params<fields::bn128<Version>>
49  : public params<fields::bn128<Version>> {
50 
53 
54  public:
56 
57  constexpr static const integral_type modulus = policy_type::modulus;
58 
63 
64  /*constexpr static const std::array<non_residue_type, 12> Frobenius_coeffs_c1 =
65  {non_residue_type(0x00, 0x00), non_residue_type(0x00, 0x00), non_residue_type(0x00, 0x00),
66  non_residue_type(0x00, 0x00),
67  non_residue_type(0x00, 0x00),
68  non_residue_type(0x00, 0x00),
69  non_residue_type(0x00, 0x00),
70  non_residue_type(0x00, 0x00),
71  non_residue_type(0x00, 0x00),
72  non_residue_type(0x00, 0x00),
73  non_residue_type(0x00, 0x00),
74  non_residue_type(0x00, 0x00)};*/
75 
76  constexpr static const std::array<integral_type, 12 * 2> Frobenius_coeffs_c1 = {
77  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
79 
80  constexpr static const non_residue_type non_residue = non_residue_type(0x09, 0x01);
81  };
82 
83  template<std::size_t Version>
84  constexpr
85  typename fp12_2over3over2_extension_params<bn128_base_field<Version>>::non_residue_type const
87 
88  template<std::size_t Version>
89  constexpr std::array<
91  12 * 2> const fp12_2over3over2_extension_params<bn128_base_field<Version>>::Frobenius_coeffs_c1;
92  } // namespace detail
93  } // namespace fields
94  } // namespace algebra
95  } // namespace crypto3
96 } // namespace nil
97 
98 #endif // CRYPTO3_ALGEBRA_FIELDS_BN128_FP12_2OVER3OVER2_EXTENSION_PARAMS_HPP
Definition: detail/element/fp2.hpp:39
Definition: detail/element/fp6_3over2.hpp:39
fields::fp2< base_field_type > non_residue_field_type
Definition: detail/extension_params/bn128/fp12_2over3over2.hpp:59
non_residue_field_type::value_type non_residue_type
Definition: detail/extension_params/bn128/fp12_2over3over2.hpp:60
underlying_field_type::value_type underlying_type
Definition: detail/extension_params/bn128/fp12_2over3over2.hpp:62
policy_type::integral_type integral_type
Definition: detail/extension_params/bn128/fp12_2over3over2.hpp:55
fields::fp6_3over2< base_field_type > underlying_field_type
Definition: detail/extension_params/bn128/fp12_2over3over2.hpp:61
Definition: pair.hpp:31
IETF IPsec groups.
Definition: bn128/base_field.hpp:46
Definition: detail/extension_params/alt_bn128/fp12_2over3over2.hpp:43
Definition: fp6_3over2.hpp:52
Definition: fields/params.hpp:35
field_type::integral_type integral_type
Definition: fields/params.hpp:42