algebra/include/nil/crypto3/algebra/fields/arithmetic_params/mnt6.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_MNT6_ARITHMETIC_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_FIELDS_MNT6_ARITHMETIC_PARAMS_HPP
28 
31 
35 
37 
38 namespace nil {
39  namespace crypto3 {
40  namespace algebra {
41  namespace fields {
42 
43  template<>
44  struct arithmetic_params<mnt6_base_field<298>> : public params<mnt6_base_field<298>> {
45  private:
47 
48  public:
52 
53  constexpr static const std::size_t s = 0x22;
54  constexpr static const integral_type t =
55  0xEF3DEF351CE899892769EC1523B2BBB258D73D10653ED25301E4975AB4EED0CD29_cppui264;
56  constexpr static const integral_type t_minus_1_over_2 =
57  0x779EF79A8E744CC493B4F60A91D95DD92C6B9E88329F692980F24BAD5A77686694_cppui263;
58  constexpr static const integral_type arithmetic_generator = 0x01;
59  constexpr static const integral_type geometric_generator = 0x02;
60  constexpr static const integral_type multiplicative_generator = 0x0A;
61  constexpr static const integral_type root_of_unity =
62  0xF29386B6F08DFECE98F8AA2954E2CF8650D75AE5D90488A8934C1AA0BB321B07D3B48F8379_cppui296;
63  constexpr static const integral_type nqr = 0x05;
64  constexpr static const integral_type nqr_to_t =
65  0x330D0653B5BA46A85FC6D3958E16DA566E30E50010AAC4A990E4047A12E2043EE3EF848E190_cppui298;
66  constexpr static const integral_type Rsquared =
67  0x149BB44A34202FF00DCED8E4B6D4BBD6DCF1E3A8386034F9102ADB68371465A743C68E0596B_cppui297;
68  constexpr static const integral_type Rcubed =
69  0x1A0B411C083B440F6A9ED2947CEAC13907BAB5D43C2F687B031B7F0B2B9B6DE2F1B99BD9C4B_cppui297;
70 
71  constexpr static const integral_type modulus = policy_type::modulus;
72  constexpr static const integral_type group_order =
73  0x1DE7BDE6A39D133124ED3D82A47657764B1AE7A20CA7DA4A603C92EB569DDA19A5200000000_cppui297;
74  };
75 
76  template<>
77  struct arithmetic_params<fp3<mnt6_base_field<298>>> : public params<mnt6_base_field<298>> {
78  private:
80 
81  public:
86 
87  constexpr static const std::size_t s = 0x22;
88  constexpr static const extended_integral_type t =
89  0xD0F1EB0C5D321E87BF885ACDEBEDB4C0D6B30E63AB6E7BF6417A7990679AA640A7D58FB90CC708D572D32DFD6443366D2F92F48FF1A02FDB0CC11573BAB71F8E5E05B07DEA208A7E11F3E61C9968CC65F379EFCEF9472C7FC6DEE40194CA1DF9F801DC0D24656EACC72677B_cppui860;
90  constexpr static const extended_integral_type t_minus_1_over_2 =
91  0x6878F5862E990F43DFC42D66F5F6DA606B598731D5B73DFB20BD3CC833CD532053EAC7DC8663846AB96996FEB2219B3697C97A47F8D017ED86608AB9DD5B8FC72F02D83EF510453F08F9F30E4CB46632F9BCF7E77CA3963FE36F7200CA650EFCFC00EE069232B75663933BD_cppui859;
92  constexpr static const std::array<integral_type, 3> nqr = {0x05, 0x00, 0x00};
93  constexpr static const std::array<integral_type, 3> nqr_to_t = {
94  0x1366271F76AB41CEEEE8C1E5E972F3CEC14A25F18B3F4B93642FAD4972356D977470E0FA674_cppui297, 0x00,
95  0x00};
96 
97  constexpr static const integral_type modulus = policy_type::modulus;
98  constexpr static const extended_integral_type group_order =
99  0x1A1E3D618BA643D0F7F10B59BD7DB6981AD661CC756DCF7EC82F4F320CF354C814FAB1F72198E11AAE5A65BFAC8866CDA5F25E91FE3405FB619822AE7756E3F1CBC0B60FBD44114FC23E7CC3932D198CBE6F3DF9DF28E58FF8DBDC80329943BF3F003B81A48CADD598E4CEF600000000_cppui893;
100  };
101 
102  constexpr std::size_t const arithmetic_params<mnt6_base_field<298>>::s;
103  constexpr std::size_t const arithmetic_params<fp3<mnt6_base_field<298>>>::s;
104 
105  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
107  constexpr typename arithmetic_params<fp3<mnt6_base_field<298>>>::extended_integral_type const
109 
110  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
111  arithmetic_params<mnt6_base_field<298>>::t_minus_1_over_2;
112  constexpr typename arithmetic_params<fp3<mnt6_base_field<298>>>::extended_integral_type const
113  arithmetic_params<fp3<mnt6_base_field<298>>>::t_minus_1_over_2;
114 
115  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
116  arithmetic_params<mnt6_base_field<298>>::arithmetic_generator;
117 
118  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
119  arithmetic_params<mnt6_base_field<298>>::geometric_generator;
120 
121  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
122  arithmetic_params<mnt6_base_field<298>>::multiplicative_generator;
123 
124  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
126 
127  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
129  constexpr std::array<typename arithmetic_params<fp3<mnt6_base_field<298>>>::integral_type, 3> const
131 
132  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
134  constexpr std::array<typename arithmetic_params<fp3<mnt6_base_field<298>>>::integral_type, 3> const
136 
137  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
139 
140  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
142 
143  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
145  constexpr typename arithmetic_params<fp3<mnt6_base_field<298>>>::integral_type const
147 
148  constexpr typename arithmetic_params<mnt6_base_field<298>>::integral_type const
150  constexpr typename arithmetic_params<fp3<mnt6_base_field<298>>>::extended_integral_type const
152 
153  } // namespace fields
154  } // namespace algebra
155  } // namespace crypto3
156 } // namespace nil
157 
158 #endif // CRYPTO3_ALGEBRA_FIELDS_MNT6_ARITHMETIC_PARAMS_HPP
Definition: pair.hpp:31
policy_type::extended_integral_type extended_integral_type
Definition: algebra/include/nil/crypto3/algebra/fields/arithmetic_params/mnt6.hpp:85
policy_type::modular_type modular_type
Definition: algebra/include/nil/crypto3/algebra/fields/arithmetic_params/mnt6.hpp:82
policy_type::integral_type integral_type
Definition: algebra/include/nil/crypto3/algebra/fields/arithmetic_params/mnt6.hpp:84
policy_type::modular_backend modular_backend
Definition: algebra/include/nil/crypto3/algebra/fields/arithmetic_params/mnt6.hpp:83
policy_type::integral_type integral_type
Definition: algebra/include/nil/crypto3/algebra/fields/arithmetic_params/mnt6.hpp:51
policy_type::modular_backend modular_backend
Definition: algebra/include/nil/crypto3/algebra/fields/arithmetic_params/mnt6.hpp:50
policy_type::modular_type modular_type
Definition: algebra/include/nil/crypto3/algebra/fields/arithmetic_params/mnt6.hpp:49
Definition: fields/params.hpp:58
IETF IPsec groups.
Definition: mnt6/base_field.hpp:46
Definition: fields/params.hpp:35
field_type::modular_backend modular_backend
Definition: fields/params.hpp:38
field_type::integral_type integral_type
Definition: fields/params.hpp:42
field_type::modular_type modular_type
Definition: fields/params.hpp:37
field_type::extended_integral_type extended_integral_type
Definition: fields/params.hpp:44