detail/extension_params/alt_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_ALT_BN128_FP12_2OVER3OVER2_EXTENSION_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_FIELDS_ALT_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>
44 
45  template<typename BaseField>
47 
48  /************************* ALT_BN128 ***********************************/
49 
50  template<std::size_t Version>
52  : public params<fields::alt_bn128<Version>> {
53 
56 
57  public:
59 
60  constexpr static const integral_type modulus = policy_type::modulus;
61 
66 
67  /*constexpr static const std::array<non_residue_type, 12> Frobenius_coeffs_c1 =
68  {non_residue_type(0x01, 0x00),
69  non_residue_type(0x1284B71C2865A7DFE8B99FDD76E68B605C521E08292F2176D60B35DADCC9E470_cppui253,
70  0x246996F3B4FAE7E6A6327CFE12150B8E747992778EEEC7E5CA5CF05F80F362AC_cppui254),
71  non_residue_type(0x30644E72E131A0295E6DD9E7E0ACCCB0C28F069FBB966E3DE4BD44E5607CFD49_cppui254,
72  0x00),
73  non_residue_type(0x19DC81CFCC82E4BBEFE9608CD0ACAA90894CB38DBE55D24AE86F7D391ED4A67F_cppui253,
74  0xABF8B60BE77D7306CBEEE33576139D7F03A5E397D439EC7694AA2BF4C0C101_cppui248),
75  non_residue_type(0x30644E72E131A0295E6DD9E7E0ACCCB0C28F069FBB966E3DE4BD44E5607CFD48_cppui254,
76  0x00),
77  non_residue_type(0x757CAB3A41D3CDC072FC0AF59C61F302CFA95859526B0D41264475E420AC20F_cppui251,
78  0xCA6B035381E35B618E9B79BA4E2606CA20B7DFD71573C93E85845E34C4A5B9C_cppui252),
79  non_residue_type(0x30644E72E131A029B85045B68181585D97816A916871CA8D3C208C16D87CFD46_cppui254,
80  0x00),
81  non_residue_type(0x1DDF9756B8CBF849CF96A5D90A9ACCFD3B2F4C893F42A9166615563BFBB318D7_cppui253,
82  0xBFAB77F2C36B843121DC8B86F6C4CCF2307D819D98302A771C39BB757899A9B_cppui252),
83  non_residue_type(0x59E26BCEA0D48BACD4F263F1ACDB5C4F5763473177FFFFFE_cppui191, 0x00),
84  non_residue_type(0x1687CCA314AEBB6DC866E529B0D4ADCD0E34B703AA1BF84253B10EDDB9A856C8_cppui253,
85  0x2FB855BCD54A22B6B18456D34C0B44C0187DC4ADD09D90A0C58BE1EAE3BC3C46_cppui254),
86  non_residue_type(0x59E26BCEA0D48BACD4F263F1ACDB5C4F5763473177FFFFFF_cppui191, 0x00),
87  non_residue_type(0x290C83BF3D14634DB120850727BB392D6A86D50BD34B19B929BC44B896723B38_cppui254,
88  0x23BD9E3DA9136A739F668E1ADC9EF7F0F575EC93F71A8DF953C846338C32A1AB_cppui254)};*/
89 
90  constexpr static const std::array<integral_type, 12 * 2> Frobenius_coeffs_c1 = {
91  0x01,
92  0x00,
93  0x1284B71C2865A7DFE8B99FDD76E68B605C521E08292F2176D60B35DADCC9E470_cppui253,
94  0x246996F3B4FAE7E6A6327CFE12150B8E747992778EEEC7E5CA5CF05F80F362AC_cppui254,
95  0x30644E72E131A0295E6DD9E7E0ACCCB0C28F069FBB966E3DE4BD44E5607CFD49_cppui254,
96  0x00,
97  0x19DC81CFCC82E4BBEFE9608CD0ACAA90894CB38DBE55D24AE86F7D391ED4A67F_cppui253,
98  0xABF8B60BE77D7306CBEEE33576139D7F03A5E397D439EC7694AA2BF4C0C101_cppui248,
99  0x30644E72E131A0295E6DD9E7E0ACCCB0C28F069FBB966E3DE4BD44E5607CFD48_cppui254,
100  0x00,
101  0x757CAB3A41D3CDC072FC0AF59C61F302CFA95859526B0D41264475E420AC20F_cppui251,
102  0xCA6B035381E35B618E9B79BA4E2606CA20B7DFD71573C93E85845E34C4A5B9C_cppui252,
103  0x30644E72E131A029B85045B68181585D97816A916871CA8D3C208C16D87CFD46_cppui254,
104  0x00,
105  0x1DDF9756B8CBF849CF96A5D90A9ACCFD3B2F4C893F42A9166615563BFBB318D7_cppui253,
106  0xBFAB77F2C36B843121DC8B86F6C4CCF2307D819D98302A771C39BB757899A9B_cppui252,
107  0x59E26BCEA0D48BACD4F263F1ACDB5C4F5763473177FFFFFE_cppui191,
108  0x00,
109  0x1687CCA314AEBB6DC866E529B0D4ADCD0E34B703AA1BF84253B10EDDB9A856C8_cppui253,
110  0x2FB855BCD54A22B6B18456D34C0B44C0187DC4ADD09D90A0C58BE1EAE3BC3C46_cppui254,
111  0x59E26BCEA0D48BACD4F263F1ACDB5C4F5763473177FFFFFF_cppui191,
112  0x00,
113  0x290C83BF3D14634DB120850727BB392D6A86D50BD34B19B929BC44B896723B38_cppui254,
114  0x23BD9E3DA9136A739F668E1ADC9EF7F0F575EC93F71A8DF953C846338C32A1AB_cppui254};
115 
116  constexpr static const non_residue_type non_residue = non_residue_type(0x09, 0x01);
117  };
118 
119  template<std::size_t Version>
120  constexpr typename fp12_2over3over2_extension_params<
121  alt_bn128_base_field<Version>>::non_residue_type const
123 
124  template<std::size_t Version>
125  constexpr std::array<
127  12 * 2> const
129 
130  } // namespace detail
131  } // namespace fields
132  } // namespace algebra
133  } // namespace crypto3
134 } // namespace nil
135 
136 #endif // CRYPTO3_ALGEBRA_FIELDS_ALT_BN128_FP12_2OVER3OVER2_EXTENSION_PARAMS_HPP
Definition: detail/element/fp2.hpp:39
Definition: detail/element/fp6_3over2.hpp:39
policy_type::integral_type integral_type
Definition: detail/extension_params/alt_bn128/fp12_2over3over2.hpp:58
fields::fp6_3over2< base_field_type > underlying_field_type
Definition: detail/extension_params/alt_bn128/fp12_2over3over2.hpp:64
fields::fp2< base_field_type > non_residue_field_type
Definition: detail/extension_params/alt_bn128/fp12_2over3over2.hpp:62
non_residue_field_type::value_type non_residue_type
Definition: detail/extension_params/alt_bn128/fp12_2over3over2.hpp:63
underlying_field_type::value_type underlying_type
Definition: detail/extension_params/alt_bn128/fp12_2over3over2.hpp:65
Definition: pair.hpp:31
IETF IPsec groups.
Definition: alt_bn128/base_field.hpp:46
Definition: detail/extension_params/alt_bn128/fp12_2over3over2.hpp:43
Definition: detail/extension_params/alt_bn128/fp12_2over3over2.hpp:46
Definition: fp6_3over2.hpp:52
Definition: fields/params.hpp:35
field_type::integral_type integral_type
Definition: fields/params.hpp:42