Givaro
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes
IntRSADom< MyRandIter > Class Template Reference

RSA domain. More...

#include <givintrsa.h>

+ Inheritance diagram for IntRSADom< MyRandIter >:
+ Collaboration diagram for IntRSADom< MyRandIter >:

Public Types

typedef IntFactorDom< MyRandIter >::Element Element
 
typedef IntFactorDom< MyRandIter >::random_generator random_generator
 
using Self_t = ZRing< Integer >
 
using Parent_t = UnparametricZRing< Integer >
 
typedef Integer Rep
 
typedef RandomIntegerIterator< false, false > RandIter
 
typedef GeneralRingNonZeroRandIter< Self_tNonZeroRandIter
 
enum  
 
using Residu_t = Integer
 
using Element_ptr = Element *
 
using ConstElement_ptr = const Element *
 
typedef const Element ConstElement
 

Public Member Functions

 IntRSADom (bool fi=false, MyRandIter g=MyRandIter())
 Constructors. More...
 
 IntRSADom (const int64_t s, bool fi=false, MyRandIter g=MyRandIter())
 
 IntRSADom (const int64_t p, const int64_t q, bool fi=false, MyRandIter g=MyRandIter())
 
 IntRSADom (const Element &n, const Element &e, const Element &d)
 
 IntRSADom (const Element &n, const Element &e)
 
const Elementgetn () const
 Accesses. More...
 
const Elementgete () const
 
const Elementgetd () const
 
std::ostream & encipher (std::ostream &, std::istream &) const
 Text conversions. More...
 
std::ostream & decipher (std::ostream &, std::istream &)
 
Elementstrong_prime (random_generator &g, int64_t psize, Element &p) const
 Strong Primes. More...
 
void keys_gen (random_generator &g, int64_t psize, int64_t qsize, Element &n, Element &e, Element &d, Element &p, Element &q) const
 Key gen. More...
 
void keys_gen (random_generator &g, int64_t psize, int64_t qsize, Element &n, Element &e, Element &d) const
 
int64_t log (const Element &n, const int64_t=10) const
 log[10] More...
 
std::ostream & ecriture_str (std::ostream &, const Element &) const
 Text conversions. More...
 
std::ostream & ecriture_str_last (std::ostream &, const Element &) const
 
std::ostream & ecriture_Int (std::ostream &, const Element &) const
 
Elementpoint_break (Element &u)
 Breaking codes : finding u knowing only m an k ... More...
 
Repfactor (Rep &r, const Rep &n, unsigned long loops=0) const
 
Repiffactorprime (Rep &r, const Rep &n, unsigned long loops=0) const
 
Repprimefactor (Rep &r, const Rep &n) const
 
bool set (Container1 &setint, Container2 &setpwd, const Rep &a, unsigned long loops=0) const
 Factors with primes. More...
 
void set (Container &, const Rep &) const
 
void Erathostene (Container &, const Rep &) const
 
RepErathostene (Rep &, const Rep &p) const
 returns a small factor More...
 
Container & divisors (Container &L, const Cont2 &Lf, const Cont3 &Le) const
 
Container & divisors (Container &, const Rep &) const
 
RepPollard (const GivRandom &, Rep &, const Rep &n, unsigned long threshold=0) const
 
RepLenstra (const GivRandom &, Rep &, const Rep &n, const Rep &B1=10000000, const unsigned long curves=30) const
 
std::ostream & write (std::ostream &o, const Rep &n) const
 
std::ostream & write (std::ostream &o, Array &, const Rep &n) const
 
std::ostream & write (std::ostream &o) const
 
std::ostream & write (std::ostream &os, const Element &a) const
 Print field element. More...
 
int isprime (const Rep &n, int r=_GIVARO_ISPRIMETESTS_) const
 
unsigned int isprimepower (Rep &, const Rep &) const
 
template<class MyRandIter >
unsigned int Miller (MyRandIter &g, const Rep &n=_GIVARO_ISPRIMETESTS_) const
 
template<class MyRandIter >
Reptest_Lehmann (MyRandIter &g, Rep &, const Rep &n=_GIVARO_ISPRIMETESTS_) const
 
template<class MyRandIter >
int Lehmann (MyRandIter &g, const Rep &n=_GIVARO_ISPRIMETESTS_) const
 
int isprime_Tabule (const int n) const
 
int isprime_Tabule2 (const int n) const
 
Repnextprime (Rep &, const Rep &, int r=_GIVARO_ISPRIMETESTS_) const
 
Repprevprime (Rep &, const Rep &, int r=_GIVARO_ISPRIMETESTS_) const
 
Repnextprimein (Rep &, int r=_GIVARO_ISPRIMETESTS_) const
 
Repprevprimein (Rep &, int r=_GIVARO_ISPRIMETESTS_) const
 
int local_prime (const Rep &n, int r=_GIVARO_ISPRIMETESTS_) const
 
int operator== (const Self_t &) const
 
bool operator== (const Self_t &F) const
 
int operator!= (const Self_t &) const
 
bool operator!= (const Self_t &F) const
 
template<class XXX >
XXX & convert (XXX &x, const Rep &a) const
 
T & convert (T &x, const Element &y) const
 
Repmul (Rep &r, const Rep &a, const Rep &b) const
 
Repmulin (Rep &r, const Rep &b) const
 
Repdiv (Rep &r, const Rep &a, const Rep &b) const
 
Repdivin (Rep &r, const Rep &b) const
 
Repmod (Rep &r, const Rep &a, const Rep &b) const
 
Repmodin (Rep &r, const Rep &b) const
 
Repadd (Rep &r, const Rep &a, const Rep &b) const
 
Repaddin (Rep &r, const Rep &b) const
 
Repsub (Rep &r, const Rep &a, const Rep &b) const
 
Repsubin (Rep &r, const Rep &b) const
 
Repdivmod (Rep &q, Rep &r, const Rep &a, const Rep &b) const
 
Repdivexact (Rep &q, const Rep &a, const Rep &b) const
 
Repaxpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 
Repmaxpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 
Repmaxpyin (Rep &r, const Rep &a, const Rep &b) const
 
Repaxmy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 
Repaxpyin (Rep &r, const Rep &a, const Rep &b) const
 
Repaxmyin (Rep &r, const Rep &a, const Rep &b) const
 
Repneg (Rep &r, const Rep &a) const
 
Repnegin (Rep &r) const
 
Elementquo (Element &q, const Element &a, const Element &b) const
 
Elementrem (Element &r, const Element &a, const Element &b) const
 
Elementquoin (Element &a, const Element &b) const
 
Elementremin (Element &a, const Element &b) const
 
void quoRem (Element &q, Element &r, const Element &a, const Element &b) const
 
Elementlogtwo (Element &z, const Element &x) const
 
Repgcd (Rep &g, Rep &u, Rep &v, const Rep &a, const Rep &b) const
 
Repgcd (Rep &g, const Rep &a, const Rep &b) const
 
Repgcdin (Rep &g, const Rep &a) const
 
Replcm (Rep &l, const Rep &a, const Rep &b) const
 
Replcmin (Rep &l, const Rep &a) const
 
Elementdxgcd (Element &g, Element &s, Element &t, Element &u, Element &v, const Element &a, const Element &b) const
 
Repinv (Rep &u, const Rep &a, const Rep &b) const
 
Repinvin (Rep &u, const Rep &b) const
 
Repinvmod (Rep &u, const Rep &a, const Rep &b) const
 
Repinvmodin (Rep &u, const Rep &b) const
 
bool ratrecon (Rep &num, Rep &den, const Rep &f, const Rep &m, const Rep &numbound, bool forcereduce=true, bool recurs=true) const
 
bool RationalReconstruction (Rep &, Rep &, const Rep &, const Rep &) const
 
bool RationalReconstruction (Rep &, Rep &, const Rep &, const Rep &, const Rep &, bool=true, bool=true) const
 
bool RationalReconstruction (Rep &, Rep &, const Rep &, const Rep &, const Rep &, const Rep &) const
 
Reppow (Rep &r, const Rep &n, const int64_t l) const
 
Reppow (Rep &r, const Rep &n, const uint64_t l) const
 
Reppow (Rep &r, const Rep &n, const int32_t l) const
 
Reppow (Rep &r, const Rep &n, const uint32_t l) const
 
Repsqrt (Rep &s, const Rep &n) const
 
Repsqrt (Rep &s, Rep &r, const Rep &n) const
 
int64_t logp (const Rep &a, const Rep &p) const
 
Reppowmod (Rep &r, const Rep &n, const int64_t e, const Rep &m) const
 
Reppowmod (Rep &r, const Rep &n, const Rep &e, const Rep &m) const
 
uint64_t length (const Rep &a) const
 
int sign (const Rep &a) const
 
bool isZero (const Rep &a) const
 
bool isZero (const Element &a) const
 
bool isOne (const Rep &a) const
 
bool isOne (const Element &a) const
 
bool isMOne (const Rep &a) const
 
bool isMOne (const Element &a) const
 
bool isUnit (const Rep &x) const
 isUnit More...
 
bool isUnit (const Element &a) const
 
bool isDivisor (const Element &a, const Element &b) const
 isDivisor (a, b) Test if b | a. More...
 
Elementabs (Element &x, const Element &a) const
 
Element abs (const Element &a) const
 
Elementabs (Element &x, const Element &a) const
 
Element abs (const Element &a) const
 
int32_t compare (const Rep &a, const Rep &b) const
 
long compare (const Element &a, const Element &b) const
 
bool areEqual (const Rep &a, const Rep &b) const
 
bool areNEqual (const Rep &a, const Rep &b) const
 
bool areAssociates (const Element &x, const Element &y) const
 
bool isgeq (const Rep &a, const Rep &b) const
 
bool isgeq (const int64_t b, const Rep &a) const
 
bool isgeq (const Rep &a, const int64_t b) const
 
bool isleq (const Rep &a, const Rep &b) const
 
bool isleq (const int64_t b, const Rep &a) const
 
bool isleq (const Rep &a, const int64_t b) const
 
bool isgt (const Rep &a, const Rep &b) const
 
bool isgt (const int64_t b, const Rep &a) const
 
bool isgt (const Rep &a, const int64_t b) const
 
bool islt (const Rep &a, const Rep &b) const
 
bool islt (const int64_t b, const Rep &a) const
 
bool islt (const Rep &a, const int64_t b) const
 
template<class MyRandIter >
Reprandom (MyRandIter &, Rep &r, long s=1) const
 
template<class MyRandIter >
Reprandom (MyRandIter &, Rep &r, const Rep &b) const
 
Elementrandom (const Random &g, Element &r) const
 
template<class MyRandIter >
Repnonzerorandom (MyRandIter &, Rep &r, long s=1) const
 
template<class MyRandIter >
Repnonzerorandom (MyRandIter &, Rep &r, const Rep &b) const
 
Elementnonzerorandom (const Random &g, Element &a) const
 
std::istream & read (std::istream &i)
 
std::istream & read (std::istream &is, Element &a) const
 Read field element. More...
 
Residu_t residu () const
 
Residu_t size () const
 
Residu_t cardinality () const
 
T & cardinality (T &c) const
 
Residu_t characteristic () const
 
T & characteristic (T &c) const
 
Elementinit (Element &x) const
 
Elementinit (Element &x, const T &s) const
 
Elementassign (Element &x, const Element &y) const
 
Elementreduce (Element &x, const Element &y) const
 
Elementreduce (Element &x) const
 
Element minElement () const
 
Element maxElement () const
 
Input/Output Operations
std::ostream & write (std::ostream &os, std::string F) const
 Read field. More...
 
std::istream & read (std::istream &is) const
 Read field. More...
 
Arithmetic Operations

The first argument is set and is also the return value.

Elementmul (Element &x, const Element &y, const Element &z) const
 x := y*z More...
 
Elementdiv (Element &x, const Element &y, const Element &z) const
 x := y/z More...
 
Elementmod (Element &x, const Element &y, const Element &z) const
 x := y mod z More...
 
Elementadd (Element &x, const Element &y, const Element &z) const
 x := y + z More...
 
Elementsub (Element &x, const Element &y, const Element &z) const
 x := y - z More...
 
Elementaxpy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := a*x + y More...
 
Elementmaxpy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := y - a*x More...
 
Elementmaxpyin (Element &z, const Element &a, const Element &x) const
 z := z - a*x More...
 
Elementaxmy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := a*x - y More...
 
Elementaxpyin (Element &z, const Element &a, const Element &x) const
 z := a*x + z More...
 
Elementaxmyin (Element &z, const Element &a, const Element &x) const
 z := a*x - z More...
 
Elementneg (Element &x, const Element &y) const
 x := -y More...
 
Elementinv (Element &x, const Element &y) const
 x := 1/y More...
 
Inplace Arithmetic Operations

The first argument is modified and the result is the return value.

Elementmulin (Element &x, const Element &y) const
 x := x*y More...
 
Elementdivin (Element &x, const Element &y) const
 x := x/y More...
 
Elementmodin (Element &x, const Element &y) const
 x := x mod y More...
 
Elementaddin (Element &x, const Element &y) const
 x := x + y More...
 
Elementsubin (Element &x, const Element &y) const
 x := x - y More...
 
Elementnegin (Element &x) const
 x := -x More...
 
Elementinvin (Element &x) const
 x := 1/x More...
 
Comparison Predicates
bool areEqual (const Element &x, const Element &y) const
 x == y More...
 

Static Public Member Functions

static Residu_t maxCardinality ()
 
static Residu_t minCardinality ()
 
static const std::string type_string ()
 

Data Fields

const Element one
 
const Element zero
 
const Element mOne
 

Protected Attributes

bool _fast_impl
 Fast implementation. More...
 
GivRandom _g
 

Detailed Description

template<class MyRandIter = GivRandom>
class Givaro::IntRSADom< MyRandIter >

RSA domain.

Member Typedef Documentation

◆ Element

typedef IntFactorDom<MyRandIter>::Element Element

◆ random_generator

◆ Self_t

using Self_t = ZRing<Integer>
inherited

◆ Parent_t

using Parent_t = UnparametricZRing<Integer>
inherited

◆ Rep

typedef Integer Rep
inherited

◆ RandIter

typedef RandomIntegerIterator<false,false> RandIter
inherited

◆ NonZeroRandIter

◆ Residu_t

using Residu_t = Integer
inherited

◆ Element_ptr

using Element_ptr = Element*
inherited

◆ ConstElement_ptr

using ConstElement_ptr = const Element*
inherited

◆ ConstElement

typedef const Element ConstElement
inherited

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Constructor & Destructor Documentation

◆ IntRSADom() [1/5]

IntRSADom ( bool  fi = false,
MyRandIter  g = MyRandIter() 
)
inline

Constructors.

◆ IntRSADom() [2/5]

IntRSADom ( const int64_t  s,
bool  fi = false,
MyRandIter  g = MyRandIter() 
)
inline

◆ IntRSADom() [3/5]

IntRSADom ( const int64_t  p,
const int64_t  q,
bool  fi = false,
MyRandIter  g = MyRandIter() 
)
inline

◆ IntRSADom() [4/5]

IntRSADom ( const Element n,
const Element e,
const Element d 
)
inline

◆ IntRSADom() [5/5]

IntRSADom ( const Element n,
const Element e 
)
inline

Member Function Documentation

◆ getn()

const Element& getn ( ) const
inline

Accesses.

◆ gete()

const Element& gete ( ) const
inline

◆ getd()

const Element& getd ( ) const
inline

◆ encipher()

std::ostream & encipher ( std::ostream &  o,
std::istream &  in 
) const

Text conversions.

◆ decipher()

std::ostream & decipher ( std::ostream &  o,
std::istream &  in 
)

◆ strong_prime()

IntRSADom< MyRandIter >::Element & strong_prime ( random_generator g,
int64_t  psize,
Element p 
) const

Strong Primes.

Bibliography:
  • J. Gordon, Strong Primes Are Easy to Find, EUROCRYPT'84, LNCS 209.

◆ keys_gen() [1/2]

void keys_gen ( random_generator g,
int64_t  psize,
int64_t  qsize,
Element n,
Element e,
Element d,
Element p,
Element q 
) const

Key gen.

Here m = p*q p and q are prime numbers of respective sizes psize, qsize Moreover p-1 and q-1 have one prime factor of respective size 2/3 since k.u = 1 mod (p-1)(q-1)

◆ keys_gen() [2/2]

void keys_gen ( random_generator g,
int64_t  psize,
int64_t  qsize,
Element n,
Element e,
Element d 
) const

◆ log()

int64_t log ( const Element n,
const int64_t  b = 10 
) const

log[10]

◆ ecriture_str()

std::ostream & ecriture_str ( std::ostream &  o,
const Element n 
) const

Text conversions.

◆ ecriture_str_last()

std::ostream & ecriture_str_last ( std::ostream &  o,
const Element n 
) const

◆ ecriture_Int()

std::ostream & ecriture_Int ( std::ostream &  o,
const Element p 
) const

◆ point_break()

IntRSADom< MyRandIter >::Element & point_break ( Element u)

Breaking codes : finding u knowing only m an k ...

◆ factor()

Rep& factor ( Rep r,
const Rep n,
unsigned long  loops = 0 
) const
inlineinherited

◆ iffactorprime()

Rep& iffactorprime ( Rep r,
const Rep n,
unsigned long  loops = 0 
) const
inlineinherited

◆ primefactor()

Rep& primefactor ( Rep r,
const Rep n 
) const
inlineinherited

◆ set() [1/2]

bool set ( Container1 &  setint,
Container2 &  setpwd,
const Rep a,
unsigned long  loops = 0 
) const
inherited

Factors with primes.

◆ set() [2/2]

void set ( Container &  Lf,
const Rep n 
) const
inherited

◆ Erathostene() [1/2]

void Erathostene ( Container &  Lf,
const Rep p 
) const
inherited

◆ Erathostene() [2/2]

Rep& Erathostene ( Rep ,
const Rep p 
) const
inherited

returns a small factor

◆ divisors() [1/2]

Container & divisors ( Container &  L,
const Cont2 &  Lf,
const Cont3 &  Le 
) const
inherited

◆ divisors() [2/2]

Container & divisors ( Container &  L,
const Rep n 
) const
inherited

◆ Pollard()

IntFactorDom< GivRandom >::Rep & Pollard ( const MyRandIter &  gen,
Rep g,
const Rep n,
unsigned long  threshold = 0 
) const
inherited

◆ Lenstra()

IntFactorDom< GivRandom >::Rep & Lenstra ( const MyRandIter &  gen,
Rep g,
const Rep n,
const Rep B1 = 10000000,
const unsigned long  curves = 30 
) const
inherited

◆ write() [1/5]

std::ostream & write ( std::ostream &  o,
const Rep n 
) const
inherited

◆ write() [2/5]

std::ostream & write ( std::ostream &  o,
Array &  Lf,
const Rep n 
) const
inherited

◆ write() [3/5]

std::ostream& write ( std::ostream &  o) const
inlinevirtualinherited

◆ write() [4/5]

std::ostream& write ( std::ostream &  os,
const Element x 
) const
inlinevirtualinherited

Print field element.

Returns
output stream to which field element is written.
Parameters
osoutput stream to which field element is written.
xfield element.

Reimplemented from UnparametricOperations< _Element >.

◆ write() [5/5]

std::ostream& write ( std::ostream &  os,
std::string  F 
) const
inlineinherited

Read field.

Returns
input stream from which field is read.
Parameters
isinput stream from which field is read.

◆ isprime()

int isprime ( const Rep n,
int  r = _GIVARO_ISPRIMETESTS_ 
) const
inlineinherited

◆ isprimepower()

unsigned int isprimepower ( Rep q,
const Rep u 
) const
inherited

◆ Miller()

unsigned int Miller ( MyRandIter &  g,
const Rep n = _GIVARO_ISPRIMETESTS_ 
) const
inherited

◆ test_Lehmann()

IntPrimeDom::Rep & test_Lehmann ( MyRandIter &  g,
Rep r,
const Rep n = _GIVARO_ISPRIMETESTS_ 
) const
inherited

◆ Lehmann()

int Lehmann ( MyRandIter &  g,
const Rep n = _GIVARO_ISPRIMETESTS_ 
) const
inherited

◆ isprime_Tabule()

int isprime_Tabule ( const int  n) const
inherited

◆ isprime_Tabule2()

int isprime_Tabule2 ( const int  n) const
inherited

◆ nextprime()

IntPrimeDom::Rep & nextprime ( Rep ,
const Rep ,
int  r = _GIVARO_ISPRIMETESTS_ 
) const
inherited

◆ prevprime()

IntPrimeDom::Rep & prevprime ( Rep n,
const Rep p,
int  r = _GIVARO_ISPRIMETESTS_ 
) const
inherited

◆ nextprimein()

IntPrimeDom::Rep & nextprimein ( Rep ,
int  r = _GIVARO_ISPRIMETESTS_ 
) const
inherited

◆ prevprimein()

IntPrimeDom::Rep & prevprimein ( Rep n,
int  r = _GIVARO_ISPRIMETESTS_ 
) const
inherited

◆ local_prime()

int local_prime ( const Rep n,
int  r = _GIVARO_ISPRIMETESTS_ 
) const
inlineinherited

◆ operator==() [1/2]

int operator== ( const Self_t ) const
inlineinherited

◆ operator==() [2/2]

bool operator== ( const Self_t F) const
inlineinherited

◆ operator!=() [1/2]

int operator!= ( const Self_t ) const
inlineinherited

◆ operator!=() [2/2]

bool operator!= ( const Self_t F) const
inlineinherited

◆ convert() [1/2]

XXX& convert ( XXX &  x,
const Rep a 
) const
inlineinherited

◆ convert() [2/2]

T& convert ( T &  x,
const Element y 
) const
inlineinherited

◆ mul() [1/2]

Rep& mul ( Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ mul() [2/2]

Element& mul ( Element x,
const Element y,
const Element z 
) const
inlinevirtualinherited

x := y*z

Implements RingInterface< _Element >.

◆ mulin() [1/2]

Rep& mulin ( Rep r,
const Rep b 
) const
inlineinherited

◆ mulin() [2/2]

Element& mulin ( Element x,
const Element y 
) const
inlinevirtualinherited

x := x*y

Implements RingInterface< _Element >.

◆ div() [1/2]

Rep& div ( Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ div() [2/2]

Element& div ( Element x,
const Element y,
const Element z 
) const
inlineinherited

x := y/z

◆ divin() [1/2]

Rep& divin ( Rep r,
const Rep b 
) const
inlineinherited

◆ divin() [2/2]

Element& divin ( Element x,
const Element y 
) const
inlineinherited

x := x/y

◆ mod() [1/2]

Rep& mod ( Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ mod() [2/2]

Element& mod ( Element x,
const Element y,
const Element z 
) const
inlineinherited

x := y mod z

◆ modin() [1/2]

Rep& modin ( Rep r,
const Rep b 
) const
inlineinherited

◆ modin() [2/2]

Element& modin ( Element x,
const Element y 
) const
inlineinherited

x := x mod y

◆ add() [1/2]

Rep& add ( Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ add() [2/2]

Element& add ( Element x,
const Element y,
const Element z 
) const
inlinevirtualinherited

x := y + z

Implements RingInterface< _Element >.

◆ addin() [1/2]

Rep& addin ( Rep r,
const Rep b 
) const
inlineinherited

◆ addin() [2/2]

Element& addin ( Element x,
const Element y 
) const
inlinevirtualinherited

x := x + y

Implements RingInterface< _Element >.

◆ sub() [1/2]

Rep& sub ( Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ sub() [2/2]

Element& sub ( Element x,
const Element y,
const Element z 
) const
inlinevirtualinherited

x := y - z

Implements RingInterface< _Element >.

◆ subin() [1/2]

Rep& subin ( Rep r,
const Rep b 
) const
inlineinherited

◆ subin() [2/2]

Element& subin ( Element x,
const Element y 
) const
inlinevirtualinherited

x := x - y

Implements RingInterface< _Element >.

◆ divmod()

Rep& divmod ( Rep q,
Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ divexact()

Rep& divexact ( Rep q,
const Rep a,
const Rep b 
) const
inlineinherited

◆ axpy() [1/2]

Rep& axpy ( Rep r,
const Rep a,
const Rep b,
const Rep c 
) const
inlineinherited

◆ axpy() [2/2]

Element& axpy ( Element z,
const Element a,
const Element x,
const Element y 
) const
inlinevirtualinherited

z := a*x + y

Implements RingInterface< _Element >.

◆ maxpy() [1/2]

Rep& maxpy ( Rep r,
const Rep a,
const Rep b,
const Rep c 
) const
inlineinherited

◆ maxpy() [2/2]

Element& maxpy ( Element z,
const Element a,
const Element x,
const Element y 
) const
inlinevirtualinherited

z := y - a*x

Implements RingInterface< _Element >.

◆ maxpyin() [1/2]

Rep& maxpyin ( Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ maxpyin() [2/2]

Element& maxpyin ( Element z,
const Element a,
const Element x 
) const
inlinevirtualinherited

z := z - a*x

Implements RingInterface< _Element >.

◆ axmy() [1/2]

Rep& axmy ( Rep r,
const Rep a,
const Rep b,
const Rep c 
) const
inlineinherited

◆ axmy() [2/2]

Element& axmy ( Element z,
const Element a,
const Element x,
const Element y 
) const
inlinevirtualinherited

z := a*x - y

Implements RingInterface< _Element >.

◆ axpyin() [1/2]

Rep& axpyin ( Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ axpyin() [2/2]

Element& axpyin ( Element z,
const Element a,
const Element x 
) const
inlinevirtualinherited

z := a*x + z

Implements RingInterface< _Element >.

◆ axmyin() [1/2]

Rep& axmyin ( Rep r,
const Rep a,
const Rep b 
) const
inlineinherited

◆ axmyin() [2/2]

Element& axmyin ( Element z,
const Element a,
const Element x 
) const
inlinevirtualinherited

z := a*x - z

Implements RingInterface< _Element >.

◆ neg() [1/2]

Rep& neg ( Rep r,
const Rep a 
) const
inlineinherited

◆ neg() [2/2]

Element& neg ( Element x,
const Element y 
) const
inlinevirtualinherited

x := -y

Implements RingInterface< _Element >.

◆ negin() [1/2]

Rep& negin ( Rep r) const
inlineinherited

◆ negin() [2/2]

Element& negin ( Element x) const
inlinevirtualinherited

x := -x

Implements RingInterface< _Element >.

◆ quo()

Element& quo ( Element q,
const Element a,
const Element b 
) const
inlineinherited

◆ rem()

Element& rem ( Element r,
const Element a,
const Element b 
) const
inlineinherited

◆ quoin()

Element& quoin ( Element a,
const Element b 
) const
inlineinherited

◆ remin()

Element& remin ( Element a,
const Element b 
) const
inlineinherited

◆ quoRem()

void quoRem ( Element q,
Element r,
const Element a,
const Element b 
) const
inlineinherited

◆ logtwo()

Element& logtwo ( Element z,
const Element x 
) const
inlineinherited

◆ gcd() [1/2]

Rep& gcd ( Rep g,
Rep u,
Rep v,
const Rep a,
const Rep b 
) const
inlineinherited

◆ gcd() [2/2]

Rep& gcd ( Rep g,
const Rep a,
const Rep b 
) const
inlineinherited

◆ gcdin()

Rep& gcdin ( Rep g,
const Rep a 
) const
inlineinherited

◆ lcm()

Rep& lcm ( Rep l,
const Rep a,
const Rep b 
) const
inlineinherited

◆ lcmin()

Rep& lcmin ( Rep l,
const Rep a 
) const
inlineinherited

◆ dxgcd()

Element& dxgcd ( Element g,
Element s,
Element t,
Element u,
Element v,
const Element a,
const Element b 
) const
inlineinherited

◆ inv() [1/2]

Rep& inv ( Rep u,
const Rep a,
const Rep b 
) const
inlineinherited

◆ inv() [2/2]

Element& inv ( Element x,
const Element y 
) const
inlineinherited

x := 1/y

◆ invin() [1/2]

Rep& invin ( Rep u,
const Rep b 
) const
inlineinherited

◆ invin() [2/2]

Element& invin ( Element x) const
inlineinherited

x := 1/x

◆ invmod()

Rep& invmod ( Rep u,
const Rep a,
const Rep b 
) const
inlineinherited

◆ invmodin()

Rep& invmodin ( Rep u,
const Rep b 
) const
inlineinherited

◆ ratrecon()

bool ratrecon ( Rep num,
Rep den,
const Rep f,
const Rep m,
const Rep numbound,
bool  forcereduce = true,
bool  recurs = true 
) const
inherited

◆ RationalReconstruction() [1/3]

bool RationalReconstruction ( Rep a,
Rep b,
const Rep x,
const Rep m 
) const
inherited

◆ RationalReconstruction() [2/3]

bool RationalReconstruction ( Rep a,
Rep b,
const Rep x,
const Rep m,
const Rep bound,
bool  forcereduce = true,
bool  recurs = true 
) const
inherited

◆ RationalReconstruction() [3/3]

bool RationalReconstruction ( Rep a,
Rep b,
const Rep x,
const Rep m,
const Rep a_bound,
const Rep b_bound 
) const
inherited

◆ pow() [1/4]

Rep& pow ( Rep r,
const Rep n,
const int64_t  l 
) const
inlineinherited

◆ pow() [2/4]

Rep& pow ( Rep r,
const Rep n,
const uint64_t  l 
) const
inlineinherited

◆ pow() [3/4]

Rep& pow ( Rep r,
const Rep n,
const int32_t  l 
) const
inlineinherited

◆ pow() [4/4]

Rep& pow ( Rep r,
const Rep n,
const uint32_t  l 
) const
inlineinherited

◆ sqrt() [1/2]

Rep& sqrt ( Rep s,
const Rep n 
) const
inlineinherited

◆ sqrt() [2/2]

Rep& sqrt ( Rep s,
Rep r,
const Rep n 
) const
inlineinherited

◆ logp()

int64_t logp ( const Rep a,
const Rep p 
) const
inlineinherited

◆ powmod() [1/2]

Rep& powmod ( Rep r,
const Rep n,
const int64_t  e,
const Rep m 
) const
inlineinherited

◆ powmod() [2/2]

Rep& powmod ( Rep r,
const Rep n,
const Rep e,
const Rep m 
) const
inlineinherited

◆ length()

uint64_t length ( const Rep a) const
inlineinherited

◆ sign()

int sign ( const Rep a) const
inlineinherited

◆ isZero() [1/2]

bool isZero ( const Rep a) const
inlineinherited

◆ isZero() [2/2]

bool isZero ( const Element a) const
inlinevirtualinherited

◆ isOne() [1/2]

bool isOne ( const Rep a) const
inlineinherited

◆ isOne() [2/2]

bool isOne ( const Element a) const
inlinevirtualinherited

◆ isMOne() [1/2]

bool isMOne ( const Rep a) const
inlineinherited

◆ isMOne() [2/2]

bool isMOne ( const Element a) const
inlinevirtualinherited

◆ isUnit() [1/2]

bool isUnit ( const Rep x) const
inlineinherited

isUnit

◆ isUnit() [2/2]

bool isUnit ( const Element a) const
inlinevirtualinherited

◆ isDivisor()

bool isDivisor ( const Element a,
const Element b 
) const
inlineinherited

isDivisor (a, b) Test if b | a.

◆ abs() [1/4]

Element& abs ( Element x,
const Element a 
) const
inlineinherited

◆ abs() [2/4]

Element abs ( const Element a) const
inlineinherited

◆ abs() [3/4]

Element& abs ( Element x,
const Element a 
) const
inlineinherited

◆ abs() [4/4]

Element abs ( const Element a) const
inlineinherited

◆ compare() [1/2]

int32_t compare ( const Rep a,
const Rep b 
) const
inlineinherited

◆ compare() [2/2]

long compare ( const Element a,
const Element b 
) const
inlineinherited

◆ areEqual() [1/2]

bool areEqual ( const Rep a,
const Rep b 
) const
inlineinherited

◆ areEqual() [2/2]

bool areEqual ( const Element x,
const Element y 
) const
inlinevirtualinherited

x == y

Implements RingInterface< _Element >.

◆ areNEqual()

bool areNEqual ( const Rep a,
const Rep b 
) const
inlineinherited

◆ areAssociates()

bool areAssociates ( const Element x,
const Element y 
) const
inlineinherited

◆ isgeq() [1/3]

bool isgeq ( const Rep a,
const Rep b 
) const
inlineinherited

◆ isgeq() [2/3]

bool isgeq ( const int64_t  b,
const Rep a 
) const
inlineinherited

◆ isgeq() [3/3]

bool isgeq ( const Rep a,
const int64_t  b 
) const
inlineinherited

◆ isleq() [1/3]

bool isleq ( const Rep a,
const Rep b 
) const
inlineinherited

◆ isleq() [2/3]

bool isleq ( const int64_t  b,
const Rep a 
) const
inlineinherited

◆ isleq() [3/3]

bool isleq ( const Rep a,
const int64_t  b 
) const
inlineinherited

◆ isgt() [1/3]

bool isgt ( const Rep a,
const Rep b 
) const
inlineinherited

◆ isgt() [2/3]

bool isgt ( const int64_t  b,
const Rep a 
) const
inlineinherited

◆ isgt() [3/3]

bool isgt ( const Rep a,
const int64_t  b 
) const
inlineinherited

◆ islt() [1/3]

bool islt ( const Rep a,
const Rep b 
) const
inlineinherited

◆ islt() [2/3]

bool islt ( const int64_t  b,
const Rep a 
) const
inlineinherited

◆ islt() [3/3]

bool islt ( const Rep a,
const int64_t  b 
) const
inlineinherited

◆ random() [1/3]

Rep& random ( MyRandIter &  ,
Rep r,
long  s = 1 
) const
inlineinherited

◆ random() [2/3]

Rep& random ( MyRandIter &  ,
Rep r,
const Rep b 
) const
inlineinherited

◆ random() [3/3]

Element& random ( const Random &  g,
Element r 
) const
inlineinherited

◆ nonzerorandom() [1/3]

Rep& nonzerorandom ( MyRandIter &  ,
Rep r,
long  s = 1 
) const
inlineinherited

◆ nonzerorandom() [2/3]

Rep& nonzerorandom ( MyRandIter &  ,
Rep r,
const Rep b 
) const
inlineinherited

◆ nonzerorandom() [3/3]

Element& nonzerorandom ( const Random &  g,
Element a 
) const
inlineinherited

◆ read() [1/3]

std::istream& read ( std::istream &  i)
inlineinherited

◆ read() [2/3]

std::istream& read ( std::istream &  is,
Element x 
) const
inlinevirtualinherited

Read field element.

Returns
input stream from which field element is read.
Parameters
isinput stream from which field element is read.
xfield element.

Reimplemented from UnparametricOperations< _Element >.

◆ read() [3/3]

std::istream& read ( std::istream &  is) const
inlineinherited

Read field.

Returns
input stream from which field is read.
Parameters
isinput stream from which field is read.

◆ residu()

Residu_t residu ( ) const
inlineinherited

◆ size()

Residu_t size ( ) const
inlineinherited

◆ cardinality() [1/2]

Residu_t cardinality ( ) const
inlineinherited

◆ cardinality() [2/2]

T& cardinality ( T &  c) const
inlineinherited

◆ characteristic() [1/2]

Residu_t characteristic ( ) const
inlineinherited

◆ characteristic() [2/2]

T& characteristic ( T &  c) const
inlineinherited

◆ maxCardinality()

static Residu_t maxCardinality ( )
inlinestaticinherited

◆ minCardinality()

static Residu_t minCardinality ( )
inlinestaticinherited

◆ init() [1/2]

Element& init ( Element x) const
inlinevirtualinherited

◆ init() [2/2]

Element& init ( Element x,
const T &  s 
) const
inlineinherited

◆ assign()

Element& assign ( Element x,
const Element y 
) const
inlinevirtualinherited

◆ reduce() [1/2]

Element& reduce ( Element x,
const Element y 
) const
inlineinherited

◆ reduce() [2/2]

Element& reduce ( Element x) const
inlineinherited

◆ minElement()

Element minElement ( ) const
inlineinherited

◆ maxElement()

Element maxElement ( ) const
inlineinherited

◆ type_string()

static const std::string type_string ( )
inlinestaticinherited

Field Documentation

◆ _fast_impl

bool _fast_impl
protected

Fast implementation.

Means simple enciphering key, and deciphering via chinese remaindering.

Warning
this means less security !

◆ _g

GivRandom _g
protectedinherited

◆ one

const Element one
inherited

◆ zero

const Element zero
inherited

◆ mOne

const Element mOne
inherited

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