twisted_edwards_params.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_CURVES_EDWARDS_183_TWISTED_EDWARDS_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_CURVES_EDWARDS_183_TWISTED_EDWARDS_PARAMS_HPP
28 
31 
32 namespace nil {
33  namespace crypto3 {
34  namespace algebra {
35  namespace curves {
36  namespace detail {
37 
38  template<>
39  struct edwards_params<183, forms::twisted_edwards> {
40 
43 
44  constexpr static const typename edwards_types<183>::integral_type a =
45  typename edwards_types<183>::integral_type(0x01);
46  constexpr static const typename edwards_types<183>::integral_type d =
48  };
49 
50  template<>
51  struct edwards_g1_params<183, forms::twisted_edwards>
52  : public edwards_params<183, forms::twisted_edwards> {
53 
55 
56  template<typename Coordinates>
58 
59  constexpr static const std::array<typename field_type::value_type, 2> zero_fill =
61 
62  constexpr static const std::array<typename field_type::value_type, 2> one_fill =
64  };
65 
66  template<>
67  struct edwards_g2_params<183, forms::twisted_edwards>
68  : public edwards_params<183, forms::twisted_edwards> {
69 
71 
72  template<typename Coordinates>
74 
75  constexpr static const std::array<typename field_type::value_type, 2> zero_fill =
77 
78  constexpr static const std::array<typename field_type::value_type, 2> one_fill =
80  };
81 
86 
87  constexpr std::array<
90  constexpr std::array<
93 
94  constexpr std::array<
97  constexpr std::array<
100 
101  } // namespace detail
102  } // namespace curves
103  } // namespace algebra
104  } // namespace crypto3
105 } // namespace nil
106 
107 #endif // CRYPTO3_ALGEBRA_CURVES_EDWARDS_183_TWISTED_EDWARDS_PARAMS_HPP
Definition: pair.hpp:31
typename edwards_types< 183 >::g1_field_type field_type
Definition: twisted_edwards_params.hpp:54
edwards_types< 183 >::g1_type< forms::twisted_edwards, Coordinates > group_type
Definition: twisted_edwards_params.hpp:57
Definition: curves/detail/edwards/types.hpp:51
typename edwards_types< 183 >::g2_field_type field_type
Definition: twisted_edwards_params.hpp:70
edwards_types< 183 >::g2_type< forms::twisted_edwards, Coordinates > group_type
Definition: twisted_edwards_params.hpp:73
Definition: curves/detail/edwards/types.hpp:54
typename edwards_types< 183 >::scalar_field_type scalar_field_type
Definition: twisted_edwards_params.hpp:42
typename edwards_types< 183 >::base_field_type base_field_type
Definition: twisted_edwards_params.hpp:41
Definition: curves/detail/edwards/types.hpp:48
A struct representing details about base and scalar fields.
Definition: curves/detail/edwards/types.hpp:61
typename base_field_type::integral_type integral_type
Definition: curves/detail/edwards/types.hpp:69
Definition: forms.hpp:34