forms/short_weierstrass/jacobian_with_a4_0/ate_precompute_g1.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_PAIRING_SHORT_WEIERSTRASS_JACOBIAN_WITH_A4_0_ATE_PRECOMPUTE_G1_HPP
27 #define CRYPTO3_ALGEBRA_PAIRING_SHORT_WEIERSTRASS_JACOBIAN_WITH_A4_0_ATE_PRECOMPUTE_G1_HPP
28 
30 
31 namespace nil {
32  namespace crypto3 {
33  namespace algebra {
34  namespace pairing {
35 
36  template<typename CurveType>
38  using curve_type = CurveType;
40  using g1_type = typename curve_type::template g1_type<>;
41  using g1_affine_type = typename curve_type::template g1_type<curves::coordinates::affine>;
42 
43  public:
45 
46  static g1_precomputed_type process(const typename g1_type::value_type &P) {
47 
48  typename g1_affine_type::value_type Pcopy = P.to_affine();
49 
50  g1_precomputed_type result;
51  result.PX = Pcopy.X;
52  result.PY = Pcopy.Y;
53 
54  return result;
55  }
56  };
57  } // namespace pairing
58  } // namespace algebra
59  } // namespace crypto3
60 } // namespace nil
61 #endif // CRYPTO3_ALGEBRA_PAIRING_SHORT_WEIERSTRASS_JACOBIAN_WITH_A4_0_ATE_PRECOMPUTE_G1_HPP
Definition: pairing/detail/forms/short_weierstrass/jacobian_with_a4_0/types.hpp:36
Definition: forms/short_weierstrass/jacobian_with_a4_0/ate_precompute_g1.hpp:37
static g1_precomputed_type process(const typename g1_type::value_type &P)
Definition: forms/short_weierstrass/jacobian_with_a4_0/ate_precompute_g1.hpp:46
typename policy_type::ate_g1_precomputed_type g1_precomputed_type
Definition: forms/short_weierstrass/jacobian_with_a4_0/ate_precompute_g1.hpp:44
Definition: pair.hpp:31
Definition: pairing/detail/forms/short_weierstrass/jacobian_with_a4_0/types.hpp:46