Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fp6_3over2.hpp
Go to the documentation of this file.
1
10#ifndef FP6_3OVER2_HPP_
11#define FP6_3OVER2_HPP_
12#include <vector>
13
16
17namespace libff {
18
19template<mp_size_t n, const bigint<n>& modulus>
20class Fp6_3over2_model;
21
22template<mp_size_t n, const bigint<n>& modulus>
23std::ostream& operator<<(std::ostream &, const Fp6_3over2_model<n, modulus> &);
24
25template<mp_size_t n, const bigint<n>& modulus>
26std::istream& operator>>(std::istream &, Fp6_3over2_model<n, modulus> &);
27
36template<mp_size_t n, const bigint<n>& modulus>
38public:
41
43 static my_Fp2 Frobenius_coeffs_c1[6]; // non_residue^((modulus^i-1)/3) for i=0,1,2,3,4,5
44 static my_Fp2 Frobenius_coeffs_c2[6]; // non_residue^((2*modulus^i-2)/3) for i=0,1,2,3,4,5
45
48 Fp6_3over2_model(const my_Fp2& c0, const my_Fp2& c1, const my_Fp2& c2) : c0(c0), c1(c1), c2(c2) {};
49
50 void clear() { c0.clear(); c1.clear(); c2.clear(); }
51 void print() const { printf("c0/c1/c2:\n"); c0.print(); c1.print(); c2.print(); }
52
56
57 bool is_zero() const { return c0.is_zero() && c1.is_zero() && c2.is_zero(); }
58 bool operator==(const Fp6_3over2_model &other) const;
59 bool operator!=(const Fp6_3over2_model &other) const;
60
67 Fp6_3over2_model Frobenius_map(unsigned long power) const;
68
69 static my_Fp2 mul_by_non_residue(const my_Fp2 &elt);
70
71 template<mp_size_t m>
73
74 static bigint<n> base_field_char() { return modulus; }
75 static size_t extension_degree() { return 6; }
76
77 friend std::ostream& operator<< <n, modulus>(std::ostream &out, const Fp6_3over2_model<n, modulus> &el);
78 friend std::istream& operator>> <n, modulus>(std::istream &in, Fp6_3over2_model<n, modulus> &el);
79};
80
81template<mp_size_t n, const bigint<n>& modulus>
82std::ostream& operator<<(std::ostream& out, const std::vector<Fp6_3over2_model<n, modulus> > &v);
83
84template<mp_size_t n, const bigint<n>& modulus>
85std::istream& operator>>(std::istream& in, std::vector<Fp6_3over2_model<n, modulus> > &v);
86
87template<mp_size_t n, const bigint<n>& modulus>
89
90template<mp_size_t n, const bigint<n>& modulus>
92
93template<mp_size_t n, const bigint<n>& modulus>
95
96template<mp_size_t n, const bigint<n>& modulus>
98
99template<mp_size_t n, const bigint<n>& modulus>
101
102} // libff
103#include <libff/algebra/fields/fp6_3over2.tcc>
104
105#endif // FP6_3OVER2_HPP_
bool is_zero() const
Definition fp2.hpp:60
void print() const
Definition fp2.hpp:54
void clear()
Definition fp2.hpp:53
static Fp6_3over2_model< n, modulus > zero()
bool operator!=(const Fp6_3over2_model &other) const
Fp6_3over2_model operator*(const Fp6_3over2_model &other) const
Fp6_3over2_model operator^(const bigint< m > &other) const
Fp6_3over2_model Frobenius_map(unsigned long power) const
static bigint< n > base_field_char()
Fp2_model< n, modulus > my_Fp2
Fp6_3over2_model operator-() const
static my_Fp2 Frobenius_coeffs_c2[6]
static my_Fp2 mul_by_non_residue(const my_Fp2 &elt)
static my_Fp2 Frobenius_coeffs_c1[6]
friend std::ostream & operator(std::ostream &out, const Fp6_3over2_model< n, modulus > &el)
Fp6_3over2_model operator-(const Fp6_3over2_model &other) const
static Fp6_3over2_model< n, modulus > one()
Fp6_3over2_model inverse() const
bool operator==(const Fp6_3over2_model &other) const
static my_Fp2 non_residue
Fp6_3over2_model operator+(const Fp6_3over2_model &other) const
static size_t extension_degree()
static Fp6_3over2_model< n, modulus > random_element()
Fp6_3over2_model squared() const
Fp_model< n, modulus > my_Fp
Fp6_3over2_model(const my_Fp2 &c0, const my_Fp2 &c1, const my_Fp2 &c2)
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)