curves/detail/vesta/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_VESTA_PARAMS_HPP
27 #define CRYPTO3_ALGEBRA_CURVES_VESTA_PARAMS_HPP
28 
31 
33 
34 namespace nil {
35  namespace crypto3 {
36  namespace algebra {
37  namespace curves {
38  namespace detail {
39 
40 
44  template<>
45  struct vesta_params<forms::short_weierstrass> {
48 
49  constexpr static typename vesta_types::integral_type a = typename vesta_types::integral_type(0) ;
54  constexpr static typename vesta_types::integral_type b = typename vesta_types::integral_type(5) ;
60  };
61 
62  template<>
63  struct vesta_g1_params<forms::short_weierstrass>
64  : public vesta_params<forms::short_weierstrass> {
66 
67  template<typename Coordinates>
69 
70  constexpr static std::array<typename field_type::value_type,2> zero_fill = {
71  field_type::value_type::zero(), field_type::value_type::one()};
72 
73  constexpr static std::array<typename field_type::value_type, 2> one_fill = {
74  typename field_type::value_type(-1),
75  //0x7706c37b5a84128a3884a5d71811f1b55da3230ffb17a8ab0b32e48d31a6685c_cppui255),
76  typename field_type::value_type(2)};
77  //0x0f60480c7a5c0e1140340adc79d6a2bf0cb57ad049d025dc38d80c77985f0329_cppui255)};
78  };
79 
82 
83  constexpr std::array<typename vesta_g1_params<forms::short_weierstrass>::field_type::value_type, 2>
85  constexpr std::array<typename vesta_g1_params<forms::short_weierstrass>::field_type::value_type, 2>
87 
88  } // namespace detail
89  } // namespace curves
90  } // namespace algebra
91  } // namespace crypto3
92 } // namespace nil
93 
94 #endif // CRYPTO3_ALGEBRA_CURVES_VESTA_PARAMS_HPP
Definition: pair.hpp:31
typename vesta_types::g1_field_type field_type
Definition: curves/detail/vesta/params.hpp:65
constexpr static std::array< typename field_type::value_type, 2 > zero_fill
Definition: curves/detail/vesta/params.hpp:70
constexpr static std::array< typename field_type::value_type, 2 > one_fill
Definition: curves/detail/vesta/params.hpp:73
Definition: curves/detail/vesta/types.hpp:45
A struct representing a group G1 of vesta curve.
Definition: vesta/g1.hpp:45
typename vesta_types::scalar_field_type scalar_field_type
Definition: curves/detail/vesta/params.hpp:47
constexpr static vesta_types::integral_type a
Definition: curves/detail/vesta/params.hpp:49
typename vesta_types::base_field_type base_field_type
Definition: curves/detail/vesta/params.hpp:46
constexpr static vesta_types::integral_type b
Definition: curves/detail/vesta/params.hpp:54
Definition: curves/detail/vesta/types.hpp:42
fields::vesta_base_field base_field_type
Definition: curves/detail/vesta/types.hpp:50
base_field_type g1_field_type
Definition: curves/detail/vesta/types.hpp:53
fields::vesta_scalar_field scalar_field_type
Definition: curves/detail/vesta/types.hpp:51
typename base_field_type::integral_type integral_type
Definition: curves/detail/vesta/types.hpp:55
Definition: forms.hpp:34