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

#include <bn.h>

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

Public Types

enum  { SIZE = Fp6Dbl::SIZE * 2 }
 
typedef Fp2::Dbl Fp2Dbl
 
typedef Fp6::Dbl Fp6Dbl
 
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 Fp12T &x)
 
 Dbl (const Fp6 &a, const Fp6 &b)
 
 Dbl (const Fp6Dbl &a, const Fp6Dbl &b)
 
 Dbl (const std::string &a, const std::string &b)
 
void setDirect (const Fp6Dbl &a, const Fp6Dbl &b)
 
Fp6Dblget ()
 
const Fp6Dblget () 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 mul_Fp2_024C (Fp12T &z, const Fp6 &x)
 
static void mul_Fp2_024_Fp2_024 (Fp12T &z, const Fp6 &cv2, const Fp6 &cv3)
 
static void mod (Fp12T &z, Dbl &x)
 

Public Attributes

Fp6Dbl a_
 
Fp6Dbl b_
 

Static Public Attributes

static void(* mul_Fp2_024 )(Fp12T &z, const Fp6 &x)
 

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

Definition at line 1851 of file bn.h.

Member Typedef Documentation

◆ bin_op

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

Definition at line 1908 of file bn.h.

◆ Fp2Dbl

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

Definition at line 1852 of file bn.h.

◆ Fp6Dbl

template<class T >
Fp6::Dbl bn::Fp12T< T >::Dbl::Fp6Dbl

Definition at line 1853 of file bn.h.

◆ uni_op

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

Definition at line 1907 of file bn.h.

Member Enumeration Documentation

◆ anonymous enum

template<class T >
anonymous enum
Enumerator
SIZE 

Definition at line 1854 of file bn.h.

1854{ SIZE = Fp6Dbl::SIZE * 2 };

Constructor & Destructor Documentation

◆ Dbl() [1/5]

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

Definition at line 1867 of file bn.h.

1867{ }

◆ Dbl() [2/5]

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

Definition at line 1868 of file bn.h.

1869 : a_(x.a_)
1870 , b_(x.b_)
1871 {
1872 }
Fp6Dbl a_
Definition bn.h:1856
Fp6Dbl b_
Definition bn.h:1856

◆ Dbl() [3/5]

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

Definition at line 1873 of file bn.h.

1874 : a_(a)
1875 , b_(b)
1876 {
1877 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ Dbl() [4/5]

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

Definition at line 1878 of file bn.h.

1879 : a_(a)
1880 , b_(b)
1881 {
1882 }

◆ Dbl() [5/5]

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

Definition at line 1883 of file bn.h.

1884 : a_(a)
1885 , b_(b)
1886 {
1887 }

Member Function Documentation

◆ add()

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

Definition at line 1910 of file bn.h.

1911 {
1912 Fp6Dbl::add(z.a_, x.a_, y.a_);
1913 Fp6Dbl::add(z.b_, x.b_, y.b_);
1914 }
uint64_t y
Definition sha3.cpp:34
static void add(Dbl &z, const Dbl &x, const Dbl &y)
Definition bn.h:1228
Here is the call graph for this function:

◆ addNC()

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

Definition at line 1916 of file bn.h.

1917 {
1918 Fp6Dbl::addNC(z.a_, x.a_, y.a_);
1919 Fp6Dbl::addNC(z.b_, x.b_, y.b_);
1920 }
static void addNC(Dbl &z, const Dbl &x, const Dbl &y)
Definition bn.h:1235
Here is the call graph for this function:

◆ get() [1/2]

template<class T >
Fp6Dbl * bn::Fp12T< T >::Dbl::get ( )
inline

Definition at line 1894 of file bn.h.

1894{ return &a_; }

◆ get() [2/2]

template<class T >
const Fp6Dbl * bn::Fp12T< T >::Dbl::get ( ) const
inline

Definition at line 1895 of file bn.h.

1895{ return &a_; }

◆ isZero()

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

Definition at line 1896 of file bn.h.

1896{ return a_.isZero() && b_.isZero(); }
bool isZero() const
Definition bn.h:1214
Here is the call graph for this function:

◆ mod()

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

Definition at line 2110 of file bn.h.

2111 {
2112 Fp6Dbl::mod(z.a_, x.a_);
2113 Fp6Dbl::mod(z.b_, x.b_);
2114 }
static void mod(Fp6T &z, const Dbl &x)
Definition bn.h:1328
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mul_Fp2_024_Fp2_024()

template<class T >
static void bn::Fp12T< T >::Dbl::mul_Fp2_024_Fp2_024 ( Fp12T & z,
const Fp6 & cv2,
const Fp6 & cv3 )
inlinestatic

Definition at line 2065 of file bn.h.

2066 {
2067 Fp2& z0 = z.a_.a_;
2068 Fp2& z1 = z.a_.b_;
2069 Fp2& z2 = z.a_.c_;
2070 Fp2& z3 = z.b_.a_;
2071 Fp2& z4 = z.b_.b_;
2072 Fp2& z5 = z.b_.c_;
2073 const Fp2& x0 = cv2.a_;
2074 const Fp2& x2 = cv2.c_;
2075 const Fp2& x4 = cv2.b_;
2076 const Fp2& y0 = cv3.a_;
2077 const Fp2& y2 = cv3.c_;
2078 const Fp2& y4 = cv3.b_;
2079 Fp2Dbl T00, T22, T44, T02, T24, T40;
2080 Fp2Dbl::mulOpt2(T00, x0, y0);
2081 Fp2Dbl::mulOpt2(T22, x2, y2);
2082 Fp2Dbl::mulOpt2(T44, x4, y4);
2083 Fp2::add(z0, x0, x2);
2084 Fp2::add(z1, y0, y2);
2085 Fp2Dbl::mulOpt2(T02, z0, z1);
2086 T02 -= T00;
2087 T02 -= T22;
2088 Fp2Dbl::mod(z2, T02);
2089 Fp2::add(z0, x2, x4);
2090 Fp2::add(z1, y2, y4);
2091 Fp2Dbl::mulOpt2(T24, z0, z1);
2092 T24 -= T22;
2093 T24 -= T44;
2094 Fp2Dbl::mul_xi(T02, T24);
2095 Fp2Dbl::mod(z3, T02);
2096 Fp2::add(z0, x4, x0);
2097 Fp2::add(z1, y4, y0);
2098 Fp2Dbl::mulOpt2(T40, z0, z1);
2099 T40 -= T00;
2100 T40 -= T44;
2101 Fp2Dbl::mod(z4, T40);
2102 Fp2Dbl::mul_xi(T02, T22);
2103 Fp2Dbl::mod(z1, T02);
2104 Fp2Dbl::mul_xi(T02, T44);
2105 T02 += T00;
2106 Fp2Dbl::mod(z0, T02);
2107 z5.clear();
2108 }
Fp2::Dbl Fp2Dbl
Definition bn.h:1852
static void(* mod)(Fp2T &z, const Dbl &x)
Definition bn.h:660
static uni_op * mul_xi
Definition bn.h:662
static void(* mulOpt2)(Dbl &z, const Fp2T &x, const Fp2T &y)
Definition bn.h:658
static void(* add)(Fp2T &z, const Fp2T &x, const Fp2T &y)
Definition bn.h:368

◆ mul_Fp2_024C()

template<class T >
static void bn::Fp12T< T >::Dbl::mul_Fp2_024C ( Fp12T & z,
const Fp6 & x )
inlinestatic

Definition at line 1964 of file bn.h.

1965 {
1966 Fp2& z0 = z.a_.a_;
1967 Fp2& z1 = z.a_.b_;
1968 Fp2& z2 = z.a_.c_;
1969 Fp2& z3 = z.b_.a_;
1970 Fp2& z4 = z.b_.b_;
1971 Fp2& z5 = z.b_.c_;
1972 const Fp2& x0 = x.a_;
1973 const Fp2& x2 = x.c_;
1974 const Fp2& x4 = x.b_;
1975 Fp2 t0, t1, t2;
1976 Fp2 s0;
1977 Fp2Dbl T3, T4;
1978 Fp2Dbl D0, D2, D4;
1979 Fp2Dbl S1;
1980 Fp2Dbl::mulOpt2(D0, z0, x0);
1981 Fp2Dbl::mulOpt2(D2, z2, x2);
1982 Fp2Dbl::mulOpt2(D4, z4, x4);
1983 Fp2::add(t2, z0, z4);
1984 Fp2::add(t1, z0, z2);
1985 Fp2::add(s0, z1, z3);
1986 s0 += z5;
1987 // For z.a_.a_ = z0.
1988 Fp2Dbl::mulOpt2(S1, z1, x2);
1989 Fp2Dbl::add(T3, S1, D4);
1990 Fp2Dbl::mul_xi(T4, T3);
1991 T4 += D0;
1992 Fp2Dbl::mod(z0, T4);
1993 // For z.a_.b_ = z1.
1994 Fp2Dbl::mulOpt2(T3, z5, x4);
1995 S1 += T3;
1996 T3 += D2;
1997 Fp2Dbl::mul_xi(T4, T3);
1998 Fp2Dbl::mulOpt2(T3, z1, x0);
1999 S1 += T3;
2000 T4 += T3;
2001 Fp2Dbl::mod(z1, T4);
2002 // For z.a_.c_ = z2.
2003 Fp2::add(t0, x0, x2);
2004 Fp2Dbl::mulOpt2(T3, t1, t0);
2005 T3 -= D0;
2006 T3 -= D2;
2007 Fp2Dbl::mulOpt2(T4, z3, x4);
2008 S1 += T4;
2009 T3 += T4;
2010 // z3 needs z2.
2011 // For z.b_.a_ = z3.
2012 Fp2::add(t0, z2, z4);
2013 Fp2Dbl::mod(z2, T3);
2014 Fp2::add(t1, x2, x4);
2015 Fp2Dbl::mulOpt2(T3, t0, t1);
2016 T3 -= D2;
2017 T3 -= D4;
2018 Fp2Dbl::mul_xi(T4, T3);
2019 Fp2Dbl::mulOpt2(T3, z3, x0);
2020 S1 += T3;
2021 T4 += T3;
2022 Fp2Dbl::mod(z3, T4);
2023 // For z.b_.b_ = z4.
2024 Fp2Dbl::mulOpt2(T3, z5, x2);
2025 S1 += T3;
2026 Fp2Dbl::mul_xi(T4, T3);
2027 Fp2::add(t0, x0, x4);
2028 Fp2Dbl::mulOpt2(T3, t2, t0);
2029 T3 -= D0;
2030 T3 -= D4;
2031 T4 += T3;
2032 Fp2Dbl::mod(z4, T4);
2033 // For z.b_.c_ = z5.
2034 Fp2::add(t0, x0, x2);
2035 t0 += x4;
2036 Fp2Dbl::mulOpt2(T3, s0, t0);
2037 T3 -= S1;
2038 Fp2Dbl::mod(z5, T3);
2039 }
static bin_op * add
Definition bn.h:651

◆ neg()

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

Definition at line 1922 of file bn.h.

1923 {
1924 Fp6Dbl::neg(z.a_, x.a_);
1925 Fp6Dbl::neg(z.b_, x.b_);
1926 }
static void neg(Dbl &z, const Dbl &x)
Definition bn.h:1242
Here is the call graph for this function:

◆ setDirect()

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

Definition at line 1889 of file bn.h.

1890 {
1891 a_ = a;
1892 b_ = b;
1893 }

◆ sub()

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

Definition at line 1928 of file bn.h.

1929 {
1930 Fp6Dbl::sub(z.a_, x.a_, y.a_);
1931 Fp6Dbl::sub(z.b_, x.b_, y.b_);
1932 }
static void sub(Dbl &z, const Dbl &x, const Dbl &y)
Definition bn.h:1249
Here is the call graph for this function:

◆ subNC()

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

Definition at line 1934 of file bn.h.

1935 {
1936 Fp6Dbl::subNC(z.a_, x.a_, y.a_);
1937 Fp6Dbl::subNC(z.b_, x.b_, y.b_);
1938 }
static void subNC(Dbl &z, const Dbl &x, const Dbl &y)
Definition bn.h:1256
Here is the call graph for this function:

◆ toString()

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

Definition at line 1858 of file bn.h.

1859 {
1860 return ("[" + a_.toString(base) + ",\n" + b_.toString(base) + "]");
1861 }
std::string toString(int base=10) const
Definition bn.h:1165
Here is the call 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 1902 of file bn.h.

1903 {
1904 return ! (x == y);
1905 }

◆ operator<<

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

Definition at line 1862 of file bn.h.

1863 {
1864 return os << x.toString();
1865 }
os_t os

◆ operator==

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

Definition at line 1898 of file bn.h.

1899 {
1900 return x.a_ == y.a_ && x.b_ == y.b_;
1901 }

Member Data Documentation

◆ a_

template<class T >
Fp6Dbl bn::Fp12T< T >::Dbl::a_

Definition at line 1856 of file bn.h.

◆ b_

template<class T >
Fp6Dbl bn::Fp12T< T >::Dbl::b_

Definition at line 1856 of file bn.h.

◆ mul_Fp2_024

template<class T >
void(* bn::Fp12T< T >::Dbl::mul_Fp2_024) (Fp12T &z, const Fp6 &x)
static

Definition at line 1963 of file bn.h.


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