frp_v1.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_FRP_V1_HPP
27 #define CRYPTO3_ALGEBRA_CURVES_FRP_V1_HPP
28 
31 
33 
34 namespace nil {
35  namespace crypto3 {
36  namespace algebra {
37  namespace curves {
38 
39  template<std::size_t PBits>
40  struct frp_v1 { };
41 
42  template<>
43  struct frp_v1<256> {
44  constexpr static const std::size_t base_field_bits = 256;
46  typedef typename base_field_type::integral_type integral_type;
47  constexpr static const integral_type base_field_modulus = base_field_type::modulus;
48 
49  constexpr static const std::size_t scalar_field_bits = 256;
51  constexpr static const integral_type scalar_field_modulus = scalar_field_type::modulus;
52 
53  constexpr static const integral_type p = base_field_modulus;
54  constexpr static const integral_type q = scalar_field_modulus;
55 
56  constexpr static const integral_type a =
57  0xF1FD178C0B3AD58F10126DE8CE42435B3961ADBCABC8CA6DE8FCF353D86E9C00_cppui256;
58  constexpr static const integral_type b =
59  0xEE353FCA5428A9300D4ABA754A44C00FDFEC0C9AE4B1A1803075ED967B7BB73F_cppui256;
60  constexpr static const integral_type x =
61  0xB6B3D4C356C139EB31183D4749D423958C27D2DCAF98B70164C97A2DD98F5CFF_cppui256;
62  constexpr static const integral_type y =
63  0x6142E0F7C8B204911F9271F0F3ECEF8C2701C307E8E4C9E183115A1554062CFB_cppui256;
64  };
65  } // namespace curves
66  } // namespace algebra
67  } // namespace crypto3
68 } // namespace nil
69 
70 #endif // CRYPTO3_ALGEBRA_CURVES_FRP_V1_HPP
frp_v1_base_field< Version > frp_v1_fq
Definition: frp_v1/base_field.hpp:77
Definition: pair.hpp:31
base_field_type::integral_type integral_type
Definition: frp_v1.hpp:46
fields::frp_v1_fq< base_field_bits > base_field_type
Definition: frp_v1.hpp:45
fields::frp_v1_fr< scalar_field_bits > scalar_field_type
Definition: frp_v1.hpp:50
Definition: frp_v1.hpp:40
IETF IPsec groups.
Definition: frp_v1/scalar_field.hpp:46