Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
bn::Fp6T< T >::Dbl Struct Reference

#include <bn.h>

Inheritance diagram for bn::Fp6T< T >::Dbl:
Collaboration diagram for bn::Fp6T< T >::Dbl:

Public Types

enum  { SIZE = Fp2Dbl::SIZE * 3 }
 
typedef Fp::Dbl FpDbl
 
typedef Fp2::Dbl Fp2Dbl
 
typedef void uni_op(Dbl &, const Dbl &)
 
typedef void bin_op(Dbl &, const Dbl &, const Dbl &)
 

Public Member Functions

std::string toString (int base=10) const
 
 Dbl ()
 
 Dbl (const Fp6T &x)
 
 Dbl (const Fp2 &a, const Fp2 &b, const Fp2 &c)
 
 Dbl (const Fp2Dbl &a, const Fp2Dbl &b, const Fp2Dbl &c)
 
 Dbl (const std::string &a0, const std::string &a1, const std::string &b0, const std::string &b1, const std::string &c0, const std::string &c1)
 
void setDirect (const mie::Vuint &v0, const mie::Vuint &v1, const mie::Vuint &v2, const mie::Vuint &v3, const mie::Vuint &v4, const mie::Vuint &v5)
 
void setDirect (const Fp2Dbl &a, const Fp2Dbl &b, const Fp2Dbl &c)
 
Fp2Dblget ()
 
const Fp2Dblget () const
 
bool isZero () const
 
- Public Member Functions inherited from mie::local::addsubmul< Dbl, mie::local::hasNegative< Dbl > >
MIE_FORCE_INLINE Dbl & operator+= (const N &rhs)
 
MIE_FORCE_INLINE Dbl & operator-= (const Dbl &rhs)
 
MIE_FORCE_INLINE Dbl & operator*= (const Dbl &rhs)
 
- Public Member Functions inherited from mie::local::hasNegative< Dbl >
MIE_FORCE_INLINE Dbl operator- () const
 

Static Public Member Functions

static void add (Dbl &z, const Dbl &x, const Dbl &y)
 
static void addNC (Dbl &z, const Dbl &x, const Dbl &y)
 
static void neg (Dbl &z, const Dbl &x)
 
static void sub (Dbl &z, const Dbl &x, const Dbl &y)
 
static void subNC (Dbl &z, const Dbl &x, const Dbl &y)
 
static void mulC (Dbl &z, const Fp6T &x, const Fp6T &y)
 
static void mod (Fp6T &z, const Dbl &x)
 

Public Attributes

Fp2Dbl a_
 
Fp2Dbl b_
 
Fp2Dbl c_
 

Static Public Attributes

static void(* mul )(Dbl &, const Fp6T &x, const Fp6T &y)
 

Friends

std::ostream & operator<< (std::ostream &os, const Dbl &x)
 
bool operator== (const Dbl &x, const Dbl &y)
 
bool operator!= (const Dbl &x, const Dbl &y)
 

Detailed Description

template<class T>
struct bn::Fp6T< T >::Dbl

Definition at line 1158 of file bn.h.

Member Typedef Documentation

◆ bin_op

template<class T >
void bn::Fp6T< T >::Dbl::bin_op(Dbl &, const Dbl &, const Dbl &)

Definition at line 1226 of file bn.h.

◆ Fp2Dbl

template<class T >
Fp2::Dbl bn::Fp6T< T >::Dbl::Fp2Dbl

Definition at line 1160 of file bn.h.

◆ FpDbl

template<class T >
Fp::Dbl bn::Fp6T< T >::Dbl::FpDbl

Definition at line 1159 of file bn.h.

◆ uni_op

template<class T >
void bn::Fp6T< T >::Dbl::uni_op(Dbl &, const Dbl &)

Definition at line 1225 of file bn.h.

Member Enumeration Documentation

◆ anonymous enum

template<class T >
anonymous enum
Enumerator
SIZE 

Definition at line 1161 of file bn.h.

1161{ SIZE = Fp2Dbl::SIZE * 3 };

Constructor & Destructor Documentation

◆ Dbl() [1/5]

template<class T >
bn::Fp6T< T >::Dbl::Dbl ( )
inline

Definition at line 1174 of file bn.h.

1174{ }

◆ Dbl() [2/5]

template<class T >
bn::Fp6T< T >::Dbl::Dbl ( const Fp6T & x)
inline

Definition at line 1175 of file bn.h.

1176 : a_(x.a_)
1177 , b_(x.b_)
1178 , c_(x.c_)
1179 {
1180 }
Fp2Dbl c_
Definition bn.h:1163
Fp2Dbl b_
Definition bn.h:1163
Fp2Dbl a_
Definition bn.h:1163

◆ Dbl() [3/5]

template<class T >
bn::Fp6T< T >::Dbl::Dbl ( const Fp2 & a,
const Fp2 & b,
const Fp2 & c )
inline

Definition at line 1181 of file bn.h.

1182 : a_(a)
1183 , b_(b)
1184 , c_(c)
1185 {
1186 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ Dbl() [4/5]

template<class T >
bn::Fp6T< T >::Dbl::Dbl ( const Fp2Dbl & a,
const Fp2Dbl & b,
const Fp2Dbl & c )
inline

Definition at line 1187 of file bn.h.

1188 : a_(a)
1189 , b_(b)
1190 , c_(c)
1191 {
1192 }

◆ Dbl() [5/5]

template<class T >
bn::Fp6T< T >::Dbl::Dbl ( const std::string & a0,
const std::string & a1,
const std::string & b0,
const std::string & b1,
const std::string & c0,
const std::string & c1 )
inline

Definition at line 1193 of file bn.h.

1194 : a_(a0, a1)
1195 , b_(b0, b1)
1196 , c_(c0, c1)
1197 {
1198 }

Member Function Documentation

◆ add()

template<class T >
static void bn::Fp6T< T >::Dbl::add ( Dbl & z,
const Dbl & x,
const Dbl & y )
inlinestatic

Definition at line 1228 of file bn.h.

1229 {
1230 Fp2Dbl::add(z.a_, x.a_, y.a_);
1231 Fp2Dbl::add(z.b_, x.b_, y.b_);
1232 Fp2Dbl::add(z.c_, x.c_, y.c_);
1233 }
uint64_t y
Definition sha3.cpp:34
static bin_op * add
Definition bn.h:651
Here is the caller graph for this function:

◆ addNC()

template<class T >
static void bn::Fp6T< T >::Dbl::addNC ( Dbl & z,
const Dbl & x,
const Dbl & y )
inlinestatic

Definition at line 1235 of file bn.h.

1236 {
1237 Fp2Dbl::addNC(z.a_, x.a_, y.a_);
1238 Fp2Dbl::addNC(z.b_, x.b_, y.b_);
1239 Fp2Dbl::addNC(z.c_, x.c_, y.c_);
1240 }
static bin_op * addNC
Definition bn.h:652
Here is the caller graph for this function:

◆ get() [1/2]

template<class T >
Fp2Dbl * bn::Fp6T< T >::Dbl::get ( )
inline

Definition at line 1212 of file bn.h.

1212{ return &a_; }

◆ get() [2/2]

template<class T >
const Fp2Dbl * bn::Fp6T< T >::Dbl::get ( ) const
inline

Definition at line 1213 of file bn.h.

1213{ return &a_; }

◆ isZero()

template<class T >
bool bn::Fp6T< T >::Dbl::isZero ( ) const
inline

Definition at line 1214 of file bn.h.

1215 {
1216 return a_.isZero() && b_.isZero() && c_.isZero();
1217 }
bool isZero() const
Definition bn.h:637
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mod()

template<class T >
static void bn::Fp6T< T >::Dbl::mod ( Fp6T & z,
const Dbl & x )
inlinestatic

Definition at line 1328 of file bn.h.

1329 {
1330 Fp2Dbl::mod(z.a_, x.a_);
1331 Fp2Dbl::mod(z.b_, x.b_);
1332 Fp2Dbl::mod(z.c_, x.c_);
1333 }
static void(* mod)(Fp2T &z, const Dbl &x)
Definition bn.h:660
Here is the caller graph for this function:

◆ mulC()

template<class T >
static void bn::Fp6T< T >::Dbl::mulC ( Dbl & z,
const Fp6T & x,
const Fp6T & y )
inlinestatic

c1 except xi * t2 term

Definition at line 1268 of file bn.h.

1269 {
1270 Fp2 t0, t1;
1271 Fp2Dbl T0, T1, T2;
1272 // # 1
1273 Fp2Dbl::mulOpt1(T0, x.a_, y.a_);
1274 Fp2Dbl::mulOpt1(T1, x.b_, y.b_);
1275 Fp2Dbl::mulOpt1(T2, x.c_, y.c_);
1276 // # 2
1277 Fp2::addNC(t0, x.b_, x.c_);
1278 Fp2::addNC(t1, y.b_, y.c_);
1279 // # 3
1280 Fp2Dbl::mulOpt2(z.c_, t0, t1);
1281 // # 4
1282 Fp2Dbl::addNC(z.b_, T1, T2);
1283 // # 5
1284 FpDbl::sub(z.c_.a_, z.c_.a_, z.b_.a_);
1285 // # 6
1286 FpDbl::subNC(z.c_.b_, z.c_.b_, z.b_.b_);
1287 // # 7
1288 Fp2Dbl::mul_xi(z.b_, z.c_);
1289 // # 8
1290 Fp2Dbl::add(z.a_, z.b_, T0);
1291 // # 9
1292 Fp2::addNC(t0, x.a_, x.b_);
1293 Fp2::addNC(t1, y.a_, y.b_);
1294 // # 10
1295 Fp2Dbl::mulOpt2(z.c_, t0, t1);
1296 // # 11
1297 Fp2Dbl::addNC(z.b_, T0, T1);
1298 // # 12
1299 FpDbl::sub(z.c_.a_, z.c_.a_, z.b_.a_);
1300 // # 13
1301 FpDbl::subNC(z.c_.b_, z.c_.b_, z.b_.b_);
1303 // # 14, 15
1304#ifdef BN_SUPPORT_SNARK
1305 Fp2Dbl::mul_xi(z.b_, T2); // store xi * t2 term
1306#else
1307 FpDbl::subOpt1(z.b_.a_, T2.a_, T2.b_);
1308 FpDbl::add(z.b_.b_, T2.a_, T2.b_);
1309#endif
1310 // # 16
1311 Fp2Dbl::add(z.b_, z.b_, z.c_);
1312 // # 17
1313 Fp2::addNC(t0, x.a_, x.c_);
1314 Fp2::addNC(t1, y.a_, y.c_);
1315 // # 18
1316 Fp2Dbl::mulOpt2(z.c_, t0, t1);
1317 // # 19
1318 Fp2Dbl::addNC(T2, T2, T0);
1319 // # 20
1320 FpDbl::sub(z.c_.a_, z.c_.a_, T2.a_);
1321 // # 22
1322 FpDbl::add(z.c_.a_, z.c_.a_, T1.a_);
1323 // # 21
1324 FpDbl::subNC(z.c_.b_, z.c_.b_, T2.b_);
1325 // # 23
1326 FpDbl::addNC(z.c_.b_, z.c_.b_, T1.b_);
1327 }
static uni_op * mul_xi
Definition bn.h:662
static void(* mulOpt1)(Dbl &z, const Fp2T &x, const Fp2T &y)
Definition bn.h:657
static void(* mulOpt2)(Dbl &z, const Fp2T &x, const Fp2T &y)
Definition bn.h:658
static void(* addNC)(Fp2T &z, const Fp2T &x, const Fp2T &y)
Definition bn.h:369
Fp2::Dbl Fp2Dbl
Definition bn.h:1160
static void subOpt1(Dbl &z, const Dbl &x, const Dbl &y)
Definition zm2.h:382
static bin_op * sub
Definition zm2.h:379
static bin_op * subNC
Definition zm2.h:380
static bin_op * addNC
Definition zm2.h:372
static bin_op * add
Definition zm2.h:371
Here is the call graph for this function:

◆ neg()

template<class T >
static void bn::Fp6T< T >::Dbl::neg ( Dbl & z,
const Dbl & x )
inlinestatic

Definition at line 1242 of file bn.h.

1243 {
1244 Fp2Dbl::neg(z.a_, x.a_);
1245 Fp2Dbl::neg(z.b_, x.b_);
1246 Fp2Dbl::neg(z.c_, x.c_);
1247 }
static uni_op * neg
Definition bn.h:653
Here is the caller graph for this function:

◆ setDirect() [1/2]

template<class T >
void bn::Fp6T< T >::Dbl::setDirect ( const Fp2Dbl & a,
const Fp2Dbl & b,
const Fp2Dbl & c )
inline

Definition at line 1206 of file bn.h.

1207 {
1208 a_ = a;
1209 b_ = b;
1210 c_ = c;
1211 }

◆ setDirect() [2/2]

template<class T >
void bn::Fp6T< T >::Dbl::setDirect ( const mie::Vuint & v0,
const mie::Vuint & v1,
const mie::Vuint & v2,
const mie::Vuint & v3,
const mie::Vuint & v4,
const mie::Vuint & v5 )
inline

Definition at line 1200 of file bn.h.

1201 {
1202 a_.setDirect(v0, v1);
1203 b_.setDirect(v2, v3);
1204 c_.setDirect(v4, v5);
1205 }
void setDirect(const mie::Vuint &a, const mie::Vuint &b)
Definition bn.h:620
Here is the call graph for this function:

◆ sub()

template<class T >
static void bn::Fp6T< T >::Dbl::sub ( Dbl & z,
const Dbl & x,
const Dbl & y )
inlinestatic

Definition at line 1249 of file bn.h.

1250 {
1251 Fp2Dbl::sub(z.a_, x.a_, y.a_);
1252 Fp2Dbl::sub(z.b_, x.b_, y.b_);
1253 Fp2Dbl::sub(z.c_, x.c_, y.c_);
1254 }
static bin_op * sub
Definition bn.h:654
Here is the caller graph for this function:

◆ subNC()

template<class T >
static void bn::Fp6T< T >::Dbl::subNC ( Dbl & z,
const Dbl & x,
const Dbl & y )
inlinestatic

Definition at line 1256 of file bn.h.

1257 {
1258 Fp2Dbl::subNC(z.a_, x.a_, y.a_);
1259 Fp2Dbl::subNC(z.b_, x.b_, y.b_);
1260 Fp2Dbl::subNC(z.c_, x.c_, y.c_);
1261 }
static bin_op * subNC
Definition bn.h:655
Here is the caller graph for this function:

◆ toString()

template<class T >
std::string bn::Fp6T< T >::Dbl::toString ( int base = 10) const
inline

Definition at line 1165 of file bn.h.

1166 {
1167 return ("[" + a_.toString(base) + ",\n" + b_.toString(base) + ",\n" + c_.toString() + "]");
1168 }
std::string toString(int base=10) const
Definition bn.h:589
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

template<class T >
bool operator!= ( const Dbl & x,
const Dbl & y )
friend

Definition at line 1223 of file bn.h.

1223{ return !(x == y); }

◆ operator<<

template<class T >
std::ostream & operator<< ( std::ostream & os,
const Dbl & x )
friend

Definition at line 1169 of file bn.h.

1170 {
1171 return os << x.toString();
1172 }
os_t os

◆ operator==

template<class T >
bool operator== ( const Dbl & x,
const Dbl & y )
friend

Definition at line 1219 of file bn.h.

1220 {
1221 return x.a_ == y.a_ && x.b_ == y.b_ && x.c_ == y.c_;
1222 }

Member Data Documentation

◆ a_

template<class T >
Fp2Dbl bn::Fp6T< T >::Dbl::a_

Definition at line 1163 of file bn.h.

◆ b_

template<class T >
Fp2Dbl bn::Fp6T< T >::Dbl::b_

Definition at line 1163 of file bn.h.

◆ c_

template<class T >
Fp2Dbl bn::Fp6T< T >::Dbl::c_

Definition at line 1163 of file bn.h.

◆ mul

template<class T >
void(* bn::Fp6T< T >::Dbl::mul) (Dbl &, const Fp6T &x, const Fp6T &y)
static

Definition at line 1262 of file bn.h.


The documentation for this struct was generated from the following file: