detail/extension_params/edwards/fp6_2over3.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_EDWARDS_FP6_2OVER3_EXTENSION_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_FIELDS_EDWARDS_FP6_2OVER3_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>
43 
44  /************************* EDWARDS ***********************************/
45 
46  template<std::size_t Version>
48  : public params<fields::edwards_base_field<Version>> {
49 
52 
53  public:
55 
56  constexpr static const integral_type modulus = policy_type::modulus;
57 
59  typedef typename non_residue_field_type::value_type non_residue_type;
62  // typedef element_fp3<fp3_extension_params<field_type>> underlying_type;
63 
64  /*constexpr static const std::array<non_residue_type, 6> Frobenius_coeffs_c1 =
65  {non_residue_type(0x01),
66  non_residue_type(0xB35E3665A18365954D018902935D4419423F84321BC3E_cppui180),
67  non_residue_type(0xB35E3665A18365954D018902935D4419423F84321BC3D_cppui180),
68  non_residue_type(0x40D5FC9D2A395B138B924ED6342D41B6EB690B80000000_cppui183),
69  non_residue_type(0x35A01936D02124BA36C236460AF76D755745133CDE43C3_cppui182),
70  non_residue_type(0x35A01936D02124BA36C236460AF76D755745133CDE43C4_cppui182)};*/
71 
72  constexpr static const std::array<integral_type, 6> Frobenius_coeffs_c1 = {
73  0x01,
74  0xB35E3665A18365954D018902935D4419423F84321BC3E_cppui180,
75  0xB35E3665A18365954D018902935D4419423F84321BC3D_cppui180,
76  0x40D5FC9D2A395B138B924ED6342D41B6EB690B80000000_cppui183,
77  0x35A01936D02124BA36C236460AF76D755745133CDE43C3_cppui182,
78  0x35A01936D02124BA36C236460AF76D755745133CDE43C4_cppui182};
79 
80  constexpr static const non_residue_type non_residue = non_residue_type(0x3D);
81  };
82 
83  template<std::size_t Version>
84  constexpr typename fp6_2over3_extension_params<edwards_base_field<Version>>::non_residue_type const
86 
87  template<std::size_t Version>
88  constexpr typename fp6_2over3_extension_params<edwards_base_field<Version>>::integral_type const
90 
91  template<std::size_t Version>
92  constexpr std::array<
93  typename fp6_2over3_extension_params<edwards_base_field<Version>>::integral_type, 6> const
95  } // namespace detail
96  } // namespace fields
97  } // namespace algebra
98  } // namespace crypto3
99 } // namespace nil
100 
101 #endif // CRYPTO3_ALGEBRA_FIELDS_EDWARDS_FP6_2OVER3_EXTENSION_PARAMS_HPP
Definition: detail/element/fp3.hpp:39
underlying_field_type::value_type underlying_type
Definition: detail/extension_params/edwards/fp6_2over3.hpp:61
fields::fp3< base_field_type > underlying_field_type
Definition: detail/extension_params/edwards/fp6_2over3.hpp:60
policy_type::integral_type integral_type
Definition: detail/extension_params/edwards/fp6_2over3.hpp:54
base_field_type non_residue_field_type
Definition: detail/extension_params/edwards/fp6_2over3.hpp:58
non_residue_field_type::value_type non_residue_type
Definition: detail/extension_params/edwards/fp6_2over3.hpp:59
Definition: pair.hpp:31
Definition: detail/extension_params/edwards/fp6_2over3.hpp:42
IETF IPsec groups.
Definition: edwards/base_field.hpp:46
Definition: fields/params.hpp:35
field_type::integral_type integral_type
Definition: fields/params.hpp:42