Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
bn128_gt.hpp
Go to the documentation of this file.
1
8#ifndef BN128_GT_HPP_
9#define BN128_GT_HPP_
10#include <iostream>
11
13
16
17namespace libff {
18
19class bn128_GT;
20std::ostream& operator<<(std::ostream &, const bn128_GT&);
21std::istream& operator>>(std::istream &, bn128_GT&);
22
23class bn128_GT {
24public:
27
28 bn128_GT();
29 bool operator==(const bn128_GT &other) const;
30 bool operator!=(const bn128_GT &other) const;
31
32 bn128_GT operator*(const bn128_GT &other) const;
34
35 static bn128_GT one();
36
37 void print() { std::cout << this->elem << "\n"; };
38
39 friend std::ostream& operator<<(std::ostream &out, const bn128_GT &g);
40 friend std::istream& operator>>(std::istream &in, bn128_GT &g);
41};
42
43template<mp_size_t m>
44bn128_GT operator^(const bn128_GT &rhs, const bigint<m> &lhs)
45{
46 return power<bn128_GT, m>(rhs, lhs);
47}
48
49
50template<mp_size_t m, const bigint<m>& modulus_p>
52{
53 return power<bn128_GT, m>(rhs, lhs.as_bigint());
54}
55
56} // libff
57#endif // BN128_GT_HPP_
BN parameter.
bigint< n > as_bigint() const
static bn128_GT one()
Definition bn128_gt.cpp:42
bool operator!=(const bn128_GT &other) const
Definition bn128_gt.cpp:23
bn128_GT unitary_inverse() const
Definition bn128_gt.cpp:35
friend std::ostream & operator<<(std::ostream &out, const bn128_GT &g)
Definition bn128_gt.cpp:47
bool operator==(const bn128_GT &other) const
Definition bn128_gt.cpp:18
static bn128_GT GT_one
Definition bn128_gt.hpp:25
bn::Fp12 elem
Definition bn128_gt.hpp:26
friend std::istream & operator>>(std::istream &in, bn128_GT &g)
Definition bn128_gt.cpp:58
bn128_GT operator*(const bn128_GT &other) const
Definition bn128_gt.cpp:28
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)
FieldT power(const FieldT &base, const bigint< m > &exponent)