curves/params/wnaf/edwards.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_WNAF_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_CURVES_EDWARDS_WNAF_PARAMS_HPP
28 
30 
32 
33 namespace nil {
34  namespace crypto3 {
35  namespace algebra {
36  namespace curves {
37 
38  template<typename GroupType>
39  struct wnaf_params;
40 
41  /************************* EDWARDS-183 ***********************************/
42 
43  template<>
44  struct wnaf_params<typename edwards<183>::g1_type<>> {
45 
46  constexpr static const std::array<std::size_t, 4> wnaf_window_table = {9, 14, 24, 117};
47  };
48 
49  template<>
50  struct wnaf_params<typename edwards<183>::g2_type<>> {
51 
52  constexpr static const std::array<std::size_t, 4> wnaf_window_table = {6, 12, 42, 97};
53  };
54 
55  /************************* EDWARDS-183 definitions ***********************************/
56 
57  constexpr std::array<std::size_t, 4> const
58  wnaf_params<typename edwards<183>::g1_type<>>::wnaf_window_table;
59  constexpr std::array<std::size_t, 4> const
60  wnaf_params<typename edwards<183>::g2_type<>>::wnaf_window_table;
61 
62  } // namespace curves
63  } // namespace algebra
64  } // namespace crypto3
65 } // namespace nil
66 
67 #endif // CRYPTO3_ALGEBRA_CURVES_EDWARDS_WNAF_PARAMS_HPP
Definition: pair.hpp:31
A struct representing a Edwards curve, providing 128 bits of security.
Definition: curves/edwards.hpp:51
Definition: curves/params/wnaf/alt_bn128.hpp:39