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

#include <bn.h>

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

Public Types

enum  { SIZE = FpDbl::SIZE * 2 }
 
typedef Fp::Dbl FpDbl
 
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 Fp2T &x)
 
 Dbl (const Fp &a, const Fp &b)
 
 Dbl (const FpDbl &a, const FpDbl &b)
 
 Dbl (const std::string &a, const std::string &b)
 
void setDirect (const mie::Vuint &a, const mie::Vuint &b)
 
void setDirect (const FpDbl &a, const FpDbl &b)
 
FpDblget ()
 
const FpDblget () const
 
void clear ()
 
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 addC (Dbl &z, const Dbl &x, const Dbl &y)
 
static void addNC_C (Dbl &z, const Dbl &x, const Dbl &y)
 
static void negC (Dbl &z, const Dbl &x)
 
static void subC (Dbl &z, const Dbl &x, const Dbl &y)
 
static void subNC_C (Dbl &z, const Dbl &x, const Dbl &y)
 
static void mul_xiC (Dbl &z, const Dbl &x)
 
static void mulOptC (Dbl &z, const Fp2T &x, const Fp2T &y, int mode)
 
static void mulOpt1C (Dbl &z, const Fp2T &x, const Fp2T &y)
 
static void mulOpt2C (Dbl &z, const Fp2T &x, const Fp2T &y)
 
static void squareC (Dbl &z, const Fp2T &x)
 
static void modC (Fp2T &z, const Dbl &x)
 

Public Attributes

FpDbl a_
 
FpDbl b_
 

Static Public Attributes

static bin_opadd = &(Fp2T<Fp>::Dbl::addC)
 
static bin_opaddNC = &(Fp2T<Fp>::Dbl::addNC_C)
 
static uni_opneg = &(Fp2T<Fp>::Dbl::negC)
 
static bin_opsub = &(Fp2T<Fp>::Dbl::subC)
 
static bin_opsubNC = &(Fp2T<Fp>::Dbl::subNC_C)
 
static void(* mulOpt1 )(Dbl &z, const Fp2T &x, const Fp2T &y)
 
static void(* mulOpt2 )(Dbl &z, const Fp2T &x, const Fp2T &y)
 
static void(* square )(Dbl &z, const Fp2T &x)
 
static void(* mod )(Fp2T &z, const Dbl &x)
 
static uni_opmul_xi = &(Fp2T<Fp>::Dbl::mul_xiC)
 

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::Fp2T< T >::Dbl

Definition at line 583 of file bn.h.

Member Typedef Documentation

◆ bin_op

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

Definition at line 649 of file bn.h.

◆ FpDbl

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

Definition at line 584 of file bn.h.

◆ uni_op

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

Definition at line 648 of file bn.h.

Member Enumeration Documentation

◆ anonymous enum

template<class T >
anonymous enum
Enumerator
SIZE 

Definition at line 585 of file bn.h.

585{ SIZE = FpDbl::SIZE * 2 };

Constructor & Destructor Documentation

◆ Dbl() [1/5]

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

Definition at line 598 of file bn.h.

598{ }

◆ Dbl() [2/5]

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

Definition at line 599 of file bn.h.

600 : a_(x.a_)
601 , b_(x.b_)
602 {
603 }
FpDbl a_
Definition bn.h:587
FpDbl b_
Definition bn.h:587

◆ Dbl() [3/5]

template<class T >
bn::Fp2T< T >::Dbl::Dbl ( const Fp & a,
const Fp & b )
inline

Definition at line 604 of file bn.h.

605 : a_(a)
606 , b_(b)
607 {
608 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ Dbl() [4/5]

template<class T >
bn::Fp2T< T >::Dbl::Dbl ( const FpDbl & a,
const FpDbl & b )
inline

Definition at line 609 of file bn.h.

610 : a_(a)
611 , b_(b)
612 {
613 }

◆ Dbl() [5/5]

template<class T >
bn::Fp2T< T >::Dbl::Dbl ( const std::string & a,
const std::string & b )
inline

Definition at line 614 of file bn.h.

615 : a_(a)
616 , b_(b)
617 {
618 }

Member Function Documentation

◆ addC()

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

Definition at line 664 of file bn.h.

665 {
666 FpDbl::add(z.a_, x.a_, y.a_);
667 FpDbl::add(z.b_, x.b_, y.b_);
668 }
uint64_t y
Definition sha3.cpp:34
static bin_op * add
Definition zm2.h:371

◆ addNC_C()

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

Definition at line 670 of file bn.h.

671 {
672 FpDbl::addNC(z.a_, x.a_, y.a_);
673 FpDbl::addNC(z.b_, x.b_, y.b_);
674 }
static bin_op * addNC
Definition zm2.h:372

◆ clear()

template<class T >
void bn::Fp2T< T >::Dbl::clear ( )
inline

Definition at line 632 of file bn.h.

633 {
634 a_.clear();
635 b_.clear();
636 }
MIE_FORCE_INLINE void clear()
Definition zm2.h:332
Here is the call graph for this function:

◆ get() [1/2]

template<class T >
FpDbl * bn::Fp2T< T >::Dbl::get ( )
inline

Definition at line 630 of file bn.h.

630{ return &a_; }

◆ get() [2/2]

template<class T >
const FpDbl * bn::Fp2T< T >::Dbl::get ( ) const
inline

Definition at line 631 of file bn.h.

631{ return &a_; }

◆ isZero()

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

Definition at line 637 of file bn.h.

638 {
639 return a_.isZero() && b_.isZero();
640 }
Here is the caller graph for this function:

◆ modC()

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

Definition at line 766 of file bn.h.

767 {
768 FpDbl::mod(z.a_, x.a_);
769 FpDbl::mod(z.b_, x.b_);
770 }
static void(* mod)(Fp &z, const Dbl &x)
Definition zm2.h:398

◆ mul_xiC()

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

Definition at line 717 of file bn.h.

718 {
719 assert(&z != &x);
720 FpDbl::sub(z.a_, x.a_, x.b_);
721 FpDbl::add(z.b_, x.b_, x.a_);
722 }
static bin_op * sub
Definition zm2.h:379

◆ mulOpt1C()

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

Definition at line 745 of file bn.h.

746 {
747 mulOptC(z, x, y, 1);
748 }
static void mulOptC(Dbl &z, const Fp2T &x, const Fp2T &y, int mode)
Definition bn.h:725
Here is the call graph for this function:

◆ mulOpt2C()

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

Definition at line 750 of file bn.h.

751 {
752 mulOptC(z, x, y, 2);
753 }
Here is the call graph for this function:

◆ mulOptC()

template<class T >
static void bn::Fp2T< T >::Dbl::mulOptC ( Dbl & z,
const Fp2T & x,
const Fp2T & y,
int mode )
inlinestatic

Definition at line 725 of file bn.h.

726 {
727 FpDbl d0;
728 Fp s, t;
729 Fp::addNC(s, x.a_, x.b_);
730 Fp::addNC(t, y.a_, y.b_);
731 FpDbl::mul(d0, x.b_, y.b_);
732 FpDbl::mul(z.a_, x.a_, y.a_);
733 FpDbl::mul(z.b_, s, t);
734 FpDbl::subNC(z.b_, z.b_, z.a_);
735 FpDbl::subNC(z.b_, z.b_, d0);
736
737 if (mode == 1) {
738 FpDbl::subOpt1(z.a_, z.a_, d0);
739
740 } else {
741 FpDbl::sub(z.a_, z.a_, d0);
742 }
743 }
static void(* addNC)(Fp &out, const Fp &x, const Fp &y)
Definition zm2.h:86
#define d0
Fp::Dbl FpDbl
Definition bn.h:584
static void subOpt1(Dbl &z, const Dbl &x, const Dbl &y)
Definition zm2.h:382
static bin_op * subNC
Definition zm2.h:380
static void(* mul)(Dbl &z, const Fp &x, const Fp &y)
Definition zm2.h:393
char * s
Here is the call graph for this function:
Here is the caller graph for this function:

◆ negC()

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

Definition at line 676 of file bn.h.

677 {
678 FpDbl::neg(z.a_, x.a_);
679 FpDbl::neg(z.b_, x.b_);
680 }
static uni_op * neg
Definition zm2.h:374

◆ setDirect() [1/2]

template<class T >
void bn::Fp2T< T >::Dbl::setDirect ( const FpDbl & a,
const FpDbl & b )
inline

Definition at line 625 of file bn.h.

626 {
627 a_ = a;
628 b_ = b;
629 }

◆ setDirect() [2/2]

template<class T >
void bn::Fp2T< T >::Dbl::setDirect ( const mie::Vuint & a,
const mie::Vuint & b )
inline

Definition at line 620 of file bn.h.

621 {
624 }
static MIE_FORCE_INLINE void setDirect(Dbl &out, const mie::Vuint &in)
Definition zm2.h:312
Here is the call graph for this function:
Here is the caller graph for this function:

◆ squareC()

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

Definition at line 755 of file bn.h.

756 {
757 Fp t0, t1;
758 Fp::addNC(t0, x.b_, x.b_);
759 FpDbl::mul(z.b_, t0, x.a_);
760 Fp::addNC(t1, x.a_, Fp::getDirectP(1)); // RRR
761 Fp::subNC(t1, t1, x.b_);
762 Fp::addNC(t0, x.a_, x.b_);
763 FpDbl::mul(z.a_, t0, t1);
764 }
static const Fp & getDirectP(int n)
Definition zm2.cpp:126
static void(* subNC)(Fp &out, const Fp &x, const Fp &y)
Definition zm2.h:87
Here is the call graph for this function:

◆ subC()

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

Definition at line 682 of file bn.h.

683 {
684 FpDbl::sub(z.a_, x.a_, y.a_);
685 FpDbl::sub(z.b_, x.b_, y.b_);
686 }

◆ subNC_C()

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

Definition at line 688 of file bn.h.

689 {
690 FpDbl::subNC(z.a_, x.a_, y.a_);
691 FpDbl::subNC(z.b_, x.b_, y.b_);
692 }

◆ toString()

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

Definition at line 589 of file bn.h.

590 {
591 return ("[" + a_.toString(base) + "," + b_.toString(base) + "]");
592 }
std::string toString(int base=10) const
Definition zm2.h:344
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 646 of file bn.h.

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

◆ operator<<

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

Definition at line 593 of file bn.h.

594 {
595 return os << x.toString();
596 }
os_t os

◆ operator==

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

Definition at line 642 of file bn.h.

643 {
644 return x.a_ == y.a_ && x.b_ == y.b_;
645 }

Member Data Documentation

◆ a_

template<class T >
FpDbl bn::Fp2T< T >::Dbl::a_

Definition at line 587 of file bn.h.

◆ add

template<class Fp >
Fp2T< Fp >::Dbl::bin_op * bn::Fp2T< Fp >::Dbl::add = &(Fp2T<Fp>::Dbl::addC)
static

Definition at line 651 of file bn.h.

◆ addNC

template<class Fp >
Fp2T< Fp >::Dbl::bin_op * bn::Fp2T< Fp >::Dbl::addNC = &(Fp2T<Fp>::Dbl::addNC_C)
static

Definition at line 652 of file bn.h.

◆ b_

template<class T >
FpDbl bn::Fp2T< T >::Dbl::b_

Definition at line 587 of file bn.h.

◆ mod

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

Definition at line 660 of file bn.h.

◆ mul_xi

template<class Fp >
Fp2T< Fp >::Dbl::uni_op * bn::Fp2T< Fp >::Dbl::mul_xi = &(Fp2T<Fp>::Dbl::mul_xiC)
static

Definition at line 662 of file bn.h.

◆ mulOpt1

template<class T >
void(* bn::Fp2T< T >::Dbl::mulOpt1) (Dbl &z, const Fp2T &x, const Fp2T &y)
static

Definition at line 657 of file bn.h.

◆ mulOpt2

template<class T >
void(* bn::Fp2T< T >::Dbl::mulOpt2) (Dbl &z, const Fp2T &x, const Fp2T &y)
static

Definition at line 658 of file bn.h.

◆ neg

template<class Fp >
Fp2T< Fp >::Dbl::uni_op * bn::Fp2T< Fp >::Dbl::neg = &(Fp2T<Fp>::Dbl::negC)
static

Definition at line 653 of file bn.h.

◆ square

template<class T >
void(* bn::Fp2T< T >::Dbl::square) (Dbl &z, const Fp2T &x)
static

Definition at line 659 of file bn.h.

◆ sub

template<class Fp >
Fp2T< Fp >::Dbl::bin_op * bn::Fp2T< Fp >::Dbl::sub = &(Fp2T<Fp>::Dbl::subC)
static

Definition at line 654 of file bn.h.

◆ subNC

template<class Fp >
Fp2T< Fp >::Dbl::bin_op * bn::Fp2T< Fp >::Dbl::subNC = &(Fp2T<Fp>::Dbl::subNC_C)
static

Definition at line 655 of file bn.h.


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