Clearmatics Libff  0.1
C++ library for Finite Fields and Elliptic Curves
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
libff::bn128_GT Class Reference

#include <bn128_gt.hpp>

Collaboration diagram for libff::bn128_GT:
Collaboration graph
[legend]

Public Member Functions

 bn128_GT ()
 
bool operator== (const bn128_GT &other) const
 
bool operator!= (const bn128_GT &other) const
 
bn128_GT operator* (const bn128_GT &other) const
 
bn128_GT unitary_inverse () const
 
void print ()
 

Static Public Member Functions

static bn128_GT one ()
 

Public Attributes

bn::Fp12 elem
 

Static Public Attributes

static bn128_GT GT_one
 

Friends

std::ostream & operator<< (std::ostream &out, const bn128_GT &g)
 
std::istream & operator>> (std::istream &in, bn128_GT &g)
 

Detailed Description

Definition at line 23 of file bn128_gt.hpp.

Constructor & Destructor Documentation

◆ bn128_GT()

libff::bn128_GT::bn128_GT ( )

Definition at line 14 of file bn128_gt.cpp.

14 { this->elem.clear(); }

Member Function Documentation

◆ one()

bn128_GT libff::bn128_GT::one ( )
static

Definition at line 40 of file bn128_gt.cpp.

40 { return GT_one; }

◆ operator!=()

bool libff::bn128_GT::operator!= ( const bn128_GT other) const

Definition at line 21 of file bn128_gt.cpp.

22 {
23  return !(operator==(other));
24 }
Here is the call graph for this function:

◆ operator*()

bn128_GT libff::bn128_GT::operator* ( const bn128_GT other) const

Definition at line 26 of file bn128_gt.cpp.

27 {
28  bn128_GT result;
29  bn::Fp12::mul(result.elem, this->elem, other.elem);
30  return result;
31 }

◆ operator==()

bool libff::bn128_GT::operator== ( const bn128_GT other) const

Definition at line 16 of file bn128_gt.cpp.

17 {
18  return (this->elem == other.elem);
19 }
Here is the caller graph for this function:

◆ print()

void libff::bn128_GT::print ( )
inline

Definition at line 38 of file bn128_gt.hpp.

38 { std::cout << this->elem << "\n"; };

◆ unitary_inverse()

bn128_GT libff::bn128_GT::unitary_inverse ( ) const

Definition at line 33 of file bn128_gt.cpp.

34 {
35  bn128_GT result(*this);
36  bn::Fp6::neg(result.elem.b_, result.elem.b_);
37  return result;
38 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const bn128_GT g 
)
friend

Definition at line 42 of file bn128_gt.cpp.

43 {
44 #ifndef BINARY_OUTPUT
45  out << g.elem.a_ << OUTPUT_SEPARATOR << g.elem.b_;
46 #else
47  out.write((char *)&g.elem.a_, sizeof(g.elem.a_));
48  out.write((char *)&g.elem.b_, sizeof(g.elem.b_));
49 #endif
50  return out;
51 }

◆ operator>>

std::istream& operator>> ( std::istream &  in,
bn128_GT g 
)
friend

Definition at line 53 of file bn128_gt.cpp.

54 {
55 #ifndef BINARY_OUTPUT
56  in >> g.elem.a_;
58  in >> g.elem.b_;
59 #else
60  in.read((char *)&g.elem.a_, sizeof(g.elem.a_));
61  in.read((char *)&g.elem.b_, sizeof(g.elem.b_));
62 #endif
63  return in;
64 }

Member Data Documentation

◆ elem

bn::Fp12 libff::bn128_GT::elem

Definition at line 27 of file bn128_gt.hpp.

◆ GT_one

bn128_GT libff::bn128_GT::GT_one
static

Definition at line 26 of file bn128_gt.hpp.


The documentation for this class was generated from the following files:
libff::bn128_GT::operator==
bool operator==(const bn128_GT &other) const
Definition: bn128_gt.cpp:16
libff::bn128_GT::elem
bn::Fp12 elem
Definition: bn128_gt.hpp:27
OUTPUT_SEPARATOR
#define OUTPUT_SEPARATOR
Definition: serialization.hpp:69
libff::consume_OUTPUT_SEPARATOR
void consume_OUTPUT_SEPARATOR(std::istream &in)
libff::bn128_GT::bn128_GT
bn128_GT()
Definition: bn128_gt.cpp:14
libff::bn128_GT::GT_one
static bn128_GT GT_one
Definition: bn128_gt.hpp:26