#include <bn.h>
|
| EcT () |
|
| EcT (const T &x, const T &y, bool verify=true) |
|
| EcT (const T &x, const T &y, const T &z, bool verify=true) |
|
void | normalize () const |
|
bool | isValid () const |
|
void | set (const T &x, const T &y, bool verify=true) |
|
void | set (const T &x, const T &y, const T &z, bool verify=true) |
|
void | clear () |
|
template<class N > |
EcT & | operator*= (const N &y) |
|
template<class N > |
EcT | operator* (const N &y) const |
|
bool | operator== (const EcT &rhs) const |
|
bool | operator!= (const EcT &rhs) const |
|
bool | isZero () const |
|
EcT & | operator+= (const EcT &rhs) |
|
EcT & | operator-= (const EcT &rhs) |
|
bool | isValid () const |
|
bool | isValid () const |
|
template<
class T>
class bn::EcT< T >
Definition at line 2815 of file bn.h.
◆ EcT() [1/3]
◆ EcT() [2/3]
bn::EcT< T >::EcT |
( |
const T & | x, |
|
|
const T & | y, |
|
|
bool | verify = true ) |
|
inline |
Definition at line 2819 of file bn.h.
2820 {
2822 }
void verify(const char *msg, const T &a, const S &b)
◆ EcT() [3/3]
bn::EcT< T >::EcT |
( |
const T & | x, |
|
|
const T & | y, |
|
|
const T & | z, |
|
|
bool | verify = true ) |
|
inline |
◆ add()
Definition at line 2871 of file bn.h.
2872 {
2874 }
void ECAdd(FF *out, const FF *a, const FF *b)
◆ clear()
◆ dbl()
Definition at line 2867 of file bn.h.
2868 {
2870 }
void ECDouble(FF *out, const FF *in)
◆ isValid() [1/3]
◆ isValid() [2/3]
Definition at line 2978 of file bn.h.
2979{
2981}
bool isOnTwistECJac3(const Fp2T< Fp > *P)
◆ isValid() [3/3]
Definition at line 2984 of file bn.h.
2985{
2987}
bool isOnECJac3(const Fp *P)
◆ isZero()
Definition at line 2911 of file bn.h.
2912 {
2913 return p[2].isZero();
2914 }
◆ mul()
Definition at line 2888 of file bn.h.
2889 {
2891 }
void ScalarMult(FF *out, const FF *in, const INT &m)
◆ neg()
Definition at line 2881 of file bn.h.
2882 {
2884 T::neg(
R.p[1],
P.p[1]);
2886 }
◆ normalize()
Definition at line 2827 of file bn.h.
2828 {
2829 if (
isZero() ||
p[2] == 1)
return;
2838 }
#define T(meth, val, expected)
◆ operator!=()
Definition at line 2907 of file bn.h.
2908 {
2910 }
bool operator==(const EcT &rhs) const
◆ operator*()
Definition at line 2895 of file bn.h.
2895{
EcT c;
mul(c, *
this, y);
return c; }
static void mul(EcT &R, const EcT &P, const N &y)
◆ operator*=()
Definition at line 2893 of file bn.h.
2893{
mul(*
this, *
this, y);
return *
this; }
◆ operator+=()
Definition at line 2942 of file bn.h.
2942{
add(*
this, *
this, rhs);
return *
this; }
static void add(EcT &R, const EcT &P, const EcT &Q)
◆ operator-=()
Definition at line 2943 of file bn.h.
2943{
sub(*
this, *
this, rhs);
return *
this; }
static void sub(EcT &R, const EcT &P, const EcT &Q)
◆ operator==()
Definition at line 2896 of file bn.h.
2897 {
2899 rhs.normalize();
2901 if (rhs.isZero()) return true;
2902 return false;
2903 }
2904 if (rhs.isZero()) return false;
2905 return p[0] == rhs.p[0] &&
p[1] == rhs.p[1];
2906 }
◆ set() [1/2]
void bn::EcT< T >::set |
( |
const T & | x, |
|
|
const T & | y, |
|
|
bool | verify = true ) |
|
inline |
Definition at line 2842 of file bn.h.
2843 {
2848 throw std::runtime_error("set(x, y) : bad point");
2849 }
2850 }
◆ set() [2/2]
void bn::EcT< T >::set |
( |
const T & | x, |
|
|
const T & | y, |
|
|
const T & | z, |
|
|
bool | verify = true ) |
|
inline |
Definition at line 2851 of file bn.h.
2852 {
2857 throw std::runtime_error("set(x, y, z) : bad point");
2858 }
2859 }
◆ sub()
Definition at line 2875 of file bn.h.
2876 {
2880 }
static void neg(EcT &R, const EcT &P)
◆ operator+
EcT operator+ |
( |
const EcT< T > & | a, |
|
|
const EcT< T > & | b ) |
|
friend |
Definition at line 2944 of file bn.h.
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
◆ operator-
EcT operator- |
( |
const EcT< T > & | a, |
|
|
const EcT< T > & | b ) |
|
friend |
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
const EcT< T > & | self ) |
|
friend |
Definition at line 2915 of file bn.h.
2916 {
2917 if (
self.isZero()) {
2919 } else {
2921 return os <<
self.p[0].toString(16) <<
'_' <<
self.p[1].toString(16);
2922 }
2923 }
@ self
the connection is to itself
◆ operator>>
std::istream & operator>> |
( |
std::istream & | is, |
|
|
EcT< T > & | self ) |
|
friend |
Definition at line 2924 of file bn.h.
2925 {
2928 if (str == "0") {
2930 } else {
2932 size_t pos =
str.find(
'_');
2933 if (pos == std::string::npos) {
2934 throw std::runtime_error("operator>>:bad format");
2935 }
2937 self.p[0].set(&str[0]);
2938 self.p[1].set(&str[pos + 1]);
2939 }
2940 return is;
2941 }
The documentation for this class was generated from the following file:
- libraries/fc/libraries/ff/depends/ate-pairing/include/bn.h