detail/extension_params/bn128/fp6_3over2.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_FP6_3OVER2_EXTENSION_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_FIELDS_BN128_FP6_3OVER2_EXTENSION_PARAMS_HPP
28 
32 
34 
35 namespace nil {
36  namespace crypto3 {
37  namespace algebra {
38  namespace fields {
39  namespace detail {
40 
41  template<typename BaseField>
42  struct fp6_3over2_extension_params;
43 
44  /************************* BN128 ***********************************/
45 
46  template<std::size_t Version>
47  class fp6_3over2_extension_params<fields::bn128<Version>> : public params<fields::bn128<Version>> {
48 
51 
52  public:
54 
55  constexpr static const integral_type modulus = policy_type::modulus;
56 
61 
62  /*constexpr static const std::array<non_residue_type, 6> Frobenius_coeffs_c1 =
63  {non_residue_type(0x00, 0x00), non_residue_type(0x00, 0x00), non_residue_type(0x00, 0x00),
64  non_residue_type(0x00, 0x00),
65  non_residue_type(0x00, 0x00),
66  non_residue_type(0x00, 0x00)};
67 
68  constexpr static const std::array<non_residue_type, 6> Frobenius_coeffs_c2 =
69  {non_residue_type(0x00, 0x00), non_residue_type(0x00, 0x00), non_residue_type(0x00, 0x00),
70  non_residue_type(0x00, 0x00),
71  non_residue_type(0x00, 0x00),
72  non_residue_type(0x00, 0x00)};*/
73 
74  constexpr static const std::array<integral_type, 6 * 2> Frobenius_coeffs_c1 = {
75  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
76 
77  constexpr static const std::array<integral_type, 6 * 2> Frobenius_coeffs_c2 = {
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 typename fp6_3over2_extension_params<bn128_base_field<Version>>::non_residue_type const
86 
87  template<std::size_t Version>
88  constexpr std::array<typename fp6_3over2_extension_params<bn128_base_field<Version>>::integral_type,
89  6 * 2> const
91  template<std::size_t Version>
92  constexpr std::array<typename fp6_3over2_extension_params<bn128_base_field<Version>>::integral_type,
93  6 * 2> const
95 
96  } // namespace detail
97  } // namespace fields
98  } // namespace algebra
99  } // namespace crypto3
100 } // namespace nil
101 
102 #endif // CRYPTO3_ALGEBRA_FIELDS_BN128_FP6_3OVER2_EXTENSION_PARAMS_HPP
Definition: detail/element/fp2.hpp:39
fields::fp2< base_field_type > underlying_field_type
Definition: detail/extension_params/bn128/fp6_3over2.hpp:59
underlying_field_type::value_type underlying_type
Definition: detail/extension_params/bn128/fp6_3over2.hpp:60
fields::fp2< base_field_type > non_residue_field_type
Definition: detail/extension_params/bn128/fp6_3over2.hpp:57
non_residue_field_type::value_type non_residue_type
Definition: detail/extension_params/bn128/fp6_3over2.hpp:58
policy_type::integral_type integral_type
Definition: detail/extension_params/bn128/fp6_3over2.hpp:53
Definition: pair.hpp:31
IETF IPsec groups.
Definition: bn128/base_field.hpp:46
Definition: detail/extension_params/alt_bn128/fp6_3over2.hpp:42
Definition: fields/params.hpp:35
field_type::integral_type integral_type
Definition: fields/params.hpp:42