Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fp6_2over3.hpp
Go to the documentation of this file.
1
10#ifndef FP6_2OVER3_HPP_
11#define FP6_2OVER3_HPP_
15
16namespace libff {
17
26template<mp_size_t n, const bigint<n>& modulus>
27class Fp6_2over3_model;
28
29template<mp_size_t n, const bigint<n>& modulus>
30std::ostream& operator<<(std::ostream &, const Fp6_2over3_model<n, modulus> &);
31
32template<mp_size_t n, const bigint<n>& modulus>
33std::istream& operator>>(std::istream &, Fp6_2over3_model<n, modulus> &);
34
35template<mp_size_t n, const bigint<n>& modulus>
37public:
41 typedef my_Fp3 my_Fpe;
42
44 static my_Fp Frobenius_coeffs_c1[6]; // non_residue^((modulus^i-1)/6) for i=0,1,2,3,4,5
45
48 Fp6_2over3_model(const my_Fp3& c0, const my_Fp3& c1) : c0(c0), c1(c1) {};
49
50 void print() const { printf("c0/c1:\n"); c0.print(); c1.print(); }
51 void clear() { c0.clear(); c1.clear(); }
52
56
57 bool is_zero() const { return c0.is_zero() && c1.is_zero(); }
58 bool operator==(const Fp6_2over3_model &other) const;
59 bool operator!=(const Fp6_2over3_model &other) const;
60
68 Fp6_2over3_model Frobenius_map(unsigned long power) const;
71
72 static my_Fp3 mul_by_non_residue(const my_Fp3 &elem);
73
74 template<mp_size_t m>
76
77 static bigint<n> base_field_char() { return modulus; }
78 static constexpr size_t extension_degree() { return 6; }
79
80 friend std::ostream& operator<< <n, modulus>(std::ostream &out, const Fp6_2over3_model<n, modulus> &el);
81 friend std::istream& operator>> <n, modulus>(std::istream &in, Fp6_2over3_model<n, modulus> &el);
82};
83
84template<mp_size_t n, const bigint<n>& modulus>
85std::ostream& operator<<(std::ostream& out, const std::vector<Fp6_2over3_model<n, modulus> > &v);
86
87template<mp_size_t n, const bigint<n>& modulus>
88std::istream& operator>>(std::istream& in, std::vector<Fp6_2over3_model<n, modulus> > &v);
89
90template<mp_size_t n, const bigint<n>& modulus>
92
93template<mp_size_t n, const bigint<n>& modulus, mp_size_t m>
95
96template<mp_size_t n, const bigint<n>& modulus, mp_size_t m, const bigint<m>& exp_modulus>
98
99template<mp_size_t n, const bigint<n>& modulus>
101
102template<mp_size_t n, const bigint<n>& modulus>
104
105} // libff
106#include <libff/algebra/fields/fp6_2over3.tcc>
107
108#endif // FP6_2OVER3_HPP_
void clear()
Definition fp3.hpp:54
void print() const
Definition fp3.hpp:55
bool is_zero() const
Definition fp3.hpp:61
Fp6_2over3_model unitary_inverse() const
Fp6_2over3_model operator+(const Fp6_2over3_model &other) const
static Fp6_2over3_model< n, modulus > random_element()
Fp6_2over3_model cyclotomic_squared() const
Fp6_2over3_model inverse() const
Fp6_2over3_model(const my_Fp3 &c0, const my_Fp3 &c1)
Fp3_model< n, modulus > my_Fp3
static constexpr size_t extension_degree()
Fp6_2over3_model squared() const
Fp6_2over3_model cyclotomic_exp(const bigint< m > &exponent) const
static Fp6_2over3_model< n, modulus > one()
bool operator==(const Fp6_2over3_model &other) const
static my_Fp3 mul_by_non_residue(const my_Fp3 &elem)
Fp_model< n, modulus > my_Fp
static Fp6_2over3_model< n, modulus > zero()
Fp6_2over3_model Frobenius_map(unsigned long power) const
friend std::ostream & operator(std::ostream &out, const Fp6_2over3_model< n, modulus > &el)
Fp2_model< n, modulus > my_Fp2
static bigint< n > base_field_char()
Fp6_2over3_model operator*(const Fp6_2over3_model &other) const
Fp6_2over3_model operator-() const
Fp6_2over3_model mul_by_2345(const Fp6_2over3_model &other) const
bool operator!=(const Fp6_2over3_model &other) const
Fp6_2over3_model operator-(const Fp6_2over3_model &other) const
static my_Fp Frobenius_coeffs_c1[6]
bn128_GT operator^(const bn128_GT &rhs, const bigint< m > &lhs)
Definition bn128_gt.hpp:44
std::istream & operator>>(std::istream &in, alt_bn128_G1 &g)
std::ostream & operator<<(std::ostream &out, const alt_bn128_G1 &g)
alt_bn128_G1 operator*(const bigint< m > &lhs, const alt_bn128_G1 &rhs)
FieldT power(const FieldT &base, const bigint< m > &exponent)