Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
mie::Fp::Dbl Struct Reference

#include <zm2.h>

Inheritance diagram for mie::Fp::Dbl:
Collaboration diagram for mie::Fp::Dbl:

Public Types

enum  { SIZE = sizeof(Unit) * N * 2 }
 
typedef void uni_op(Dbl &z, const Dbl &x)
 
typedef void bin_op(Dbl &z, const Dbl &x, const Dbl &y)
 

Public Member Functions

template<class T >
void setDirect (const T &in)
 
MIE_FORCE_INLINE void clear ()
 
Unitptr ()
 
const Unitconst_ptr () const
 
mie::Vuint getDirect () const
 
MIE_FORCE_INLINE const Unitoperator[] (size_t i) const
 
MIE_FORCE_INLINE Unitoperator[] (size_t i)
 
MIE_FORCE_INLINE size_t size () const
 
std::string toString (int base=10) const
 
 Dbl ()
 
 Dbl (const Fp &x)
 
 Dbl (const std::string &str)
 
- Public Member Functions inherited from mie::local::addsubmul< Dbl, local::comparable< Dbl, 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 MIE_FORCE_INLINE void setDirect (Dbl &out, const mie::Vuint &in)
 
static MIE_FORCE_INLINE void setDirect (Dbl &out, const std::string &in)
 
static int compare (const Dbl &x, const Dbl &y)
 
static void subOpt1 (Dbl &z, const Dbl &x, const Dbl &y)
 

Static Public Attributes

static bin_opadd = &FpDbl_addC
 
static bin_opaddNC = &FpDbl_addNC_C
 
static uni_opneg = &FpDbl_negC
 
static bin_opsub = &FpDbl_subC
 
static bin_opsubNC = &FpDbl_subNC_C
 
static void(* mul )(Dbl &z, const Fp &x, const Fp &y) = &FpDbl_mulC
 
static void(* mod )(Fp &z, const Dbl &x) = &FpDbl_modC
 
static DblpNTbl_
 

Friends

std::ostream & operator<< (std::ostream &os, const Dbl &x)
 

Detailed Description

Definition at line 306 of file zm2.h.

Member Typedef Documentation

◆ bin_op

void mie::Fp::Dbl::bin_op(Dbl &z, const Dbl &x, const Dbl &y)

Definition at line 366 of file zm2.h.

◆ uni_op

void mie::Fp::Dbl::uni_op(Dbl &z, const Dbl &x)

Definition at line 365 of file zm2.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SIZE 

Definition at line 309 of file zm2.h.

309 {
310 SIZE = sizeof(Unit) * N * 2
311 };
@ N
Definition zm2.h:26
uint32_t Unit
Definition zm.h:66

Constructor & Destructor Documentation

◆ Dbl() [1/3]

mie::Fp::Dbl::Dbl ( )
inline

Definition at line 353 of file zm2.h.

353{}

◆ Dbl() [2/3]

mie::Fp::Dbl::Dbl ( const Fp & x)
inlineexplicit

Definition at line 354 of file zm2.h.

355 {
356 mul(*this, x, montgomeryR2_);
357 }
static void(* mul)(Dbl &z, const Fp &x, const Fp &y)
Definition zm2.h:393

◆ Dbl() [3/3]

mie::Fp::Dbl::Dbl ( const std::string & str)
inlineexplicit

Definition at line 358 of file zm2.h.

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

Member Function Documentation

◆ clear()

MIE_FORCE_INLINE void mie::Fp::Dbl::clear ( )
inline

Definition at line 332 of file zm2.h.

333 {
334 std::fill(v_, v_ + N * 2, 0);
335 }
Here is the caller graph for this function:

◆ compare()

static int mie::Fp::Dbl::compare ( const Dbl & x,
const Dbl & y )
inlinestatic

Definition at line 360 of file zm2.h.

361 {
362 return mie::local::PrimitiveFunction::compare(&x[0], N * 2, &y[0], N * 2);
363 }
static int compare(const Unit *x, size_t xn, const Unit *y, size_t yn)
Definition zm.h:183
Here is the call graph for this function:

◆ const_ptr()

const Unit * mie::Fp::Dbl::const_ptr ( ) const
inline

Definition at line 338 of file zm2.h.

338{ return v_; }

◆ getDirect()

mie::Vuint mie::Fp::Dbl::getDirect ( ) const
inline

Definition at line 339 of file zm2.h.

339{ return mie::Vuint(v_, N * 2); }
VuintT< local::FixedBuffer< mie::Unit, MIE_ZM_VUINT_BIT_LEN > > Vuint
Definition zm.h:1161
Here is the caller graph for this function:

◆ operator[]() [1/2]

MIE_FORCE_INLINE Unit & mie::Fp::Dbl::operator[] ( size_t i)
inline

Definition at line 341 of file zm2.h.

341{ return v_[i]; }

◆ operator[]() [2/2]

MIE_FORCE_INLINE const Unit & mie::Fp::Dbl::operator[] ( size_t i) const
inline

Definition at line 340 of file zm2.h.

340{ return v_[i]; }

◆ ptr()

Unit * mie::Fp::Dbl::ptr ( )
inline

Definition at line 337 of file zm2.h.

337{ return v_; }

◆ setDirect() [1/3]

template<class T >
void mie::Fp::Dbl::setDirect ( const T & in)
inline

Definition at line 330 of file zm2.h.

330{ setDirect(*this, in); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDirect() [2/3]

static MIE_FORCE_INLINE void mie::Fp::Dbl::setDirect ( Dbl & out,
const mie::Vuint & in )
inlinestatic

Definition at line 312 of file zm2.h.

313 {
314 const size_t n = in.size();
315 if (n < N * 2) {
316 std::copy(&in[0], &in[0] + n, out.v_);
317 std::fill(out.v_ + n, out.v_ + N * 2, 0);
318 } else {
319 // ignore in[i] for i >= N * 2
320 std::copy(&in[0], &in[0] + N * 2, out.v_);
321 }
322 }
Here is the caller graph for this function:

◆ setDirect() [3/3]

static MIE_FORCE_INLINE void mie::Fp::Dbl::setDirect ( Dbl & out,
const std::string & in )
inlinestatic

Definition at line 323 of file zm2.h.

324 {
325 mie::Vuint t(in);
326 setDirect(out, t);
327 }
Here is the call graph for this function:

◆ size()

MIE_FORCE_INLINE size_t mie::Fp::Dbl::size ( ) const
inline

Definition at line 342 of file zm2.h.

342{ return N * 2; }

◆ subOpt1()

static void mie::Fp::Dbl::subOpt1 ( Dbl & z,
const Dbl & x,
const Dbl & y )
inlinestatic

Definition at line 382 of file zm2.h.

383 {
384 assert(&z != &x);
385 assert(&z != &y);
386 addNC(z, x, pNTbl_[1]);
387 subNC(z, z, y);
388 }
static bin_op * subNC
Definition zm2.h:380
static Dbl * pNTbl_
Definition zm2.h:403
static bin_op * addNC
Definition zm2.h:372
Here is the caller graph for this function:

◆ toString()

std::string mie::Fp::Dbl::toString ( int base = 10) const
inline

Definition at line 344 of file zm2.h.

345 {
346 return ("Dbl(" + getDirect().toString(base) + ")");
347 }
std::string toString(int base=10) const
Definition zm2.h:344
mie::Vuint getDirect() const
Definition zm2.h:339
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Dbl & x )
friend

Definition at line 348 of file zm2.h.

349 {
350 return os << x.toString(os.flags() & std::ios_base::hex ? 16 : 10);
351 }
os_t os

Member Data Documentation

◆ add

FpDbl::bin_op * FpDbl::add = &FpDbl_addC
static

Definition at line 371 of file zm2.h.

◆ addNC

FpDbl::bin_op * FpDbl::addNC = &FpDbl_addNC_C
static

Definition at line 372 of file zm2.h.

◆ mod

void(* FpDbl::mod)(Fp &, const Dbl &) = &FpDbl_modC
static

Definition at line 398 of file zm2.h.

◆ mul

void(* FpDbl::mul)(Dbl &, const Fp &, const Fp &) = &FpDbl_mulC
static

Definition at line 393 of file zm2.h.

◆ neg

FpDbl::uni_op * FpDbl::neg = &FpDbl_negC
static

Definition at line 374 of file zm2.h.

◆ pNTbl_

bn::FpDbl * bn::FpDbl::pNTbl_
static

Definition at line 403 of file zm2.h.

◆ sub

FpDbl::bin_op * FpDbl::sub = &FpDbl_subC
static

Definition at line 379 of file zm2.h.

◆ subNC

FpDbl::bin_op * FpDbl::subNC = &FpDbl_subNC_C
static

Definition at line 380 of file zm2.h.


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