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

#include <givintrsa.h>

Inheritance diagram for IntRSADom< RandIter >:

Public Types

typedef IntFactorDom< RandIter >
::Element 
Element
typedef IntFactorDom< RandIter >
::random_generator 
random_generator
typedef Integer Rep

Public Member Functions

 IntRSADom (bool fi=false, RandIter g=RandIter())
 IntRSADom (const long s, bool fi=false, RandIter g=RandIter())
 IntRSADom (const long p, const long q, bool fi=false, RandIter g=RandIter())
 IntRSADom (const Element &n, const Element &e, const Element &d)
 IntRSADom (const Element &n, const Element &e)
const Element & getn () const
const Element & gete () const
const Element & getd () const
std::ostream & encipher (std::ostream &, std::istream &) const
std::ostream & decipher (std::ostream &, std::istream &)
Element & strong_prime (random_generator &g, long psize, Element &p) const
void keys_gen (random_generator &g, long psize, long qsize, Element &n, Element &e, Element &d, Element &p, Element &q) const
void keys_gen (random_generator &g, long psize, long qsize, Element &n, Element &e, Element &d) const
long log (const Element &n, const long) const
std::ostream & ecriture_str (std::ostream &, const Element &) const
std::ostream & ecriture_str_last (std::ostream &, const Element &) const
std::ostream & ecriture_Int (std::ostream &, const Element &) const
Element & point_break (Element &u)
Rep & factor (Rep &r, const Rep &n, unsigned long loops=0) const
Rep & iffactorprime (Rep &r, const Rep &n, unsigned long loops=0) const
Rep & primefactor (Rep &r, const Rep &n) const
template<class Container1 , class Container2 >
bool set (Container1 &setint, Container2 &setpwd, const Rep &a, unsigned long loops=0) const
 Factors with primes.
template<class Container >
void set (Container &, const Rep &) const
template<class Container >
void Erathostene (Container &, const Rep &) const
Rep & Erathostene (Rep &, const Rep &p) const
 returns a small factor
template<class Container , class Cont2 , class Cont3 >
Container & divisors (Container &L, const Cont2 &Lf, const Cont3 &Le) const
template<class Container >
Container & divisors (Container &, const Rep &) const
Rep & Pollard (const RandIter &, Rep &, const Rep &n, unsigned long threshold=0) const
Rep & Lenstra (const RandIter &, Rep &, const Rep &n, const Rep &B1=10000000, const unsigned long curves=30) const
std::ostream & write (std::ostream &o, const Rep &n) const
template<class Array >
std::ostream & write (std::ostream &o, Array &, const Rep &n) const
std::ostream & write (std::ostream &o) const
std::ostream & write (std::ostream &o, const Rep &n) const
int isprime (const Rep &n, int r=_GIVARO_ISPRIMETESTS_) const
unsigned int isprimepower (Rep &, const Rep &) const
template<class RandIter >
unsigned int Miller (RandIter &g, const Rep &n=_GIVARO_ISPRIMETESTS_) const
template<class RandIter >
Rep & test_Lehmann (RandIter &g, Rep &, const Rep &n=_GIVARO_ISPRIMETESTS_) const
template<class RandIter >
int Lehmann (RandIter &g, const Rep &n=_GIVARO_ISPRIMETESTS_) const
int isprime_Tabule (const int n) const
int isprime_Tabule2 (const int n) const
Rep & nextprime (Rep &, const Rep &, int r=_GIVARO_ISPRIMETESTS_) const
Rep & prevprime (Rep &, const Rep &, int r=_GIVARO_ISPRIMETESTS_) const
Rep & nextprimein (Rep &, int r=_GIVARO_ISPRIMETESTS_) const
Rep & prevprimein (Rep &, int r=_GIVARO_ISPRIMETESTS_) const
int local_prime (const Rep &n, int r=_GIVARO_ISPRIMETESTS_) const
int operator== (const IntegerDom &) const
int operator!= (const IntegerDom &) const
Rep & init (Rep &a) const
Rep & init (Rep &a, const Rep &b) const
Rep & read (Rep &a, const long i) const
Rep & read (Rep &a, const unsigned long i) const
Rep & read (Rep &a, const int i) const
Rep & read (Rep &a, const unsigned int i) const
std::istream & read (std::istream &i)
std::istream & read (std::istream &i, Rep &n) const
Rep & convert (Rep &a, const Rep &b) const
template<class XXX >
XXX & convert (XXX &x, const Rep &a) const
Rep & assign (Rep &a, const Rep &b) const
const Rep & access (const Rep &a) const
Rep & mul (Rep &r, const Rep &a, const Rep &b) const
Rep & div (Rep &r, const Rep &a, const Rep &b) const
Rep & mod (Rep &r, const Rep &a, const Rep &b) const
Rep & add (Rep &r, const Rep &a, const Rep &b) const
Rep & sub (Rep &r, const Rep &a, const Rep &b) const
Rep & divmod (Rep &q, Rep &r, const Rep &a, const Rep &b) const
Rep & divexact (Rep &q, const Rep &a, const Rep &b) const
Rep & mulin (Rep &r, const Rep &a) const
Rep & divin (Rep &r, const Rep &a) const
Rep & modin (Rep &r, const Rep &a) const
Rep & addin (Rep &r, const Rep &a) const
Rep & subin (Rep &r, const Rep &a) const
Rep & axpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
Rep & maxpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
Rep & maxpyin (Rep &r, const Rep &a, const Rep &b) const
Rep & axmy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
Rep & axpyin (Rep &r, const Rep &a, const Rep &b) const
Rep & axmyin (Rep &r, const Rep &a, const Rep &b) const
Rep & neg (Rep &r, const Rep &a) const
Rep & negin (Rep &r) const
Rep & gcd (Rep &g, Rep &u, Rep &v, const Rep &a, const Rep &b) const
Rep & gcd (Rep &g, const Rep &a, const Rep &b) const
Rep & lcm (Rep &l, const Rep &a, const Rep &b) const
Rep & lcmin (Rep &l, const Rep &a) const
Rep & inv (Rep &u, const Rep &a, const Rep &b) const
Rep & invin (Rep &u, const Rep &b) const
Rep & pow (Rep &r, const Rep &n, const long l) const
Rep & pow (Rep &r, const Rep &n, const unsigned long l) const
Rep & pow (Rep &r, const Rep &n, const int l) const
Rep & pow (Rep &r, const Rep &n, const unsigned int l) const
Rep & sqrt (Rep &s, const Rep &n) const
Rep & sqrt (Rep &s, Rep &r, const Rep &n) const
long logp (const Rep &a, const Rep &p) const
Rep & powmod (Rep &r, const Rep &n, const long e, const Rep &m) const
Rep & powmod (Rep &r, const Rep &n, const Rep &e, const Rep &m) const
unsigned long length (const Rep &a) const
int sign (const Rep &a) const
bool isZero (const Rep &a) const
bool isOne (const Rep &a) const
bool areEqual (const Rep &a, const Rep &b) const
bool areNEqual (const Rep &a, const Rep &b) const
bool isgeq (const Rep &a, const Rep &b) const
bool isgeq (const long b, const Rep &a) const
bool isgeq (const Rep &a, const long b) const
bool isleq (const Rep &a, const Rep &b) const
bool isleq (const long b, const Rep &a) const
bool isleq (const Rep &a, const long b) const
bool isgt (const Rep &a, const Rep &b) const
bool isgt (const long b, const Rep &a) const
bool isgt (const Rep &a, const long b) const
bool islt (const Rep &a, const Rep &b) const
bool islt (const long b, const Rep &a) const
bool islt (const Rep &a, const long b) const
template<class RandIter >
Rep & random (RandIter &, Rep &r, long s=1) const
template<class RandIter >
Rep & random (RandIter &, Rep &r, const Rep &b) const
template<class RandIter >
Rep & nonzerorandom (RandIter &, Rep &r, long s=1) const
template<class RandIter >
Rep & nonzerorandom (RandIter &, Rep &r, const Rep &b) const

Data Fields

const Integer one
const Integer zero

Protected Attributes

bool _fast_impl
RandIter _g

Detailed Description

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

Examples:

examples/Integer/RSA_breaking.C, examples/Integer/RSA_decipher.C, examples/Integer/RSA_encipher.C, and examples/Integer/RSA_keys_generator.C.


Member Typedef Documentation

typedef IntFactorDom<RandIter>::Element Element

Reimplemented from IntegerDom.

Reimplemented from IntFactorDom< RandIter >.

typedef Integer Rep [inherited]

Constructor & Destructor Documentation

IntRSADom ( bool  fi = false,
RandIter  g = RandIter() 
) [inline]
IntRSADom ( const long  s,
bool  fi = false,
RandIter  g = RandIter() 
) [inline]
IntRSADom ( const long  p,
const long  q,
bool  fi = false,
RandIter  g = RandIter() 
) [inline]
IntRSADom ( const Element &  n,
const Element &  e,
const Element &  d 
) [inline]
IntRSADom ( const Element &  n,
const Element &  e 
) [inline]

Member Function Documentation

const Element& getn ( ) const [inline]
const Element& gete ( ) const [inline]
const Element& getd ( ) const [inline]
std::ostream & encipher ( std::ostream &  o,
std::istream &  in 
) const
std::ostream & decipher ( std::ostream &  o,
std::istream &  in 
)
IntRSADom< RandIter >::Element & strong_prime ( random_generator &  g,
long  psize,
Element &  p 
) const
void keys_gen ( random_generator &  g,
long  psize,
long  qsize,
Element &  n,
Element &  e,
Element &  d,
Element &  p,
Element &  q 
) const
void keys_gen ( random_generator &  g,
long  psize,
long  qsize,
Element &  n,
Element &  e,
Element &  d 
) const
long log ( const Element &  n,
const long  b = 10 
) const
std::ostream & ecriture_str ( std::ostream &  o,
const Element &  n 
) const
std::ostream & ecriture_str_last ( std::ostream &  o,
const Element &  n 
) const
std::ostream & ecriture_Int ( std::ostream &  o,
const Element &  p 
) const
IntRSADom< RandIter >::Element & point_break ( Element &  u)
Rep& factor ( Rep &  r,
const Rep &  n,
unsigned long  loops = 0 
) const [inline, inherited]
Rep& iffactorprime ( Rep &  r,
const Rep &  n,
unsigned long  loops = 0 
) const [inline, inherited]
Rep& primefactor ( Rep &  r,
const Rep &  n 
) const [inline, inherited]
bool set ( Container1 &  setint,
Container2 &  setpwd,
const Rep &  a,
unsigned long  loops = 0 
) const [inherited]

Factors with primes.

void set ( Container &  Lf,
const Rep &  n 
) const [inherited]
void Erathostene ( Container &  Lf,
const Rep &  p 
) const [inherited]
Rep& Erathostene ( Rep &  ,
const Rep &  p 
) const [inherited]

returns a small factor

Container & divisors ( Container &  L,
const Cont2 &  Lf,
const Cont3 &  Le 
) const [inherited]
Container & divisors ( Container &  L,
const Rep &  n 
) const [inherited]
IntFactorDom< RandIter >::Rep & Pollard ( const RandIter &  gen,
Rep &  g,
const Rep &  n,
unsigned long  threshold = 0 
) const [inherited]
IntFactorDom< RandIter >::Rep & Lenstra ( const RandIter &  gen,
Rep &  g,
const Rep &  n,
const Rep &  B1 = 10000000,
const unsigned long  curves = 30 
) const [inherited]
std::ostream & write ( std::ostream &  o,
const Rep &  n 
) const [inherited]
std::ostream & write ( std::ostream &  o,
Array &  Lf,
const Rep &  n 
) const [inherited]
std::ostream& write ( std::ostream &  o) const [inline, inherited]
std::ostream& write ( std::ostream &  o,
const Rep &  n 
) const [inline, inherited]
int isprime ( const Rep &  n,
int  r = _GIVARO_ISPRIMETESTS_ 
) const [inline, inherited]
unsigned int isprimepower ( Rep &  q,
const Rep &  u 
) const [inherited]
unsigned int Miller ( RandIter &  g,
const Rep &  n = _GIVARO_ISPRIMETESTS_ 
) const [inherited]
IntPrimeDom::Rep & test_Lehmann ( RandIter &  g,
Rep &  r,
const Rep &  n = _GIVARO_ISPRIMETESTS_ 
) const [inherited]
int Lehmann ( RandIter &  g,
const Rep &  n = _GIVARO_ISPRIMETESTS_ 
) const [inherited]
int isprime_Tabule ( const int  n) const [inherited]
int isprime_Tabule2 ( const int  n) const [inherited]
IntPrimeDom::Rep & nextprime ( Rep &  n,
const Rep &  p,
int  r = _GIVARO_ISPRIMETESTS_ 
) const [inherited]
IntPrimeDom::Rep & prevprime ( Rep &  n,
const Rep &  p,
int  r = _GIVARO_ISPRIMETESTS_ 
) const [inherited]
IntPrimeDom::Rep & nextprimein ( Rep &  n,
int  r = _GIVARO_ISPRIMETESTS_ 
) const [inherited]
IntPrimeDom::Rep & prevprimein ( Rep &  n,
int  r = _GIVARO_ISPRIMETESTS_ 
) const [inherited]
int local_prime ( const Rep &  n,
int  r = _GIVARO_ISPRIMETESTS_ 
) const [inline, inherited]
int operator== ( const IntegerDom &  ) const [inline, inherited]
int operator!= ( const IntegerDom &  ) const [inline, inherited]
Rep& init ( Rep &  a) const [inline, inherited]
Rep& init ( Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& read ( Rep &  a,
const long  i 
) const [inline, inherited]
Rep& read ( Rep &  a,
const unsigned long  i 
) const [inline, inherited]
Rep& read ( Rep &  a,
const int  i 
) const [inline, inherited]
Rep& read ( Rep &  a,
const unsigned int  i 
) const [inline, inherited]
std::istream& read ( std::istream &  i) [inline, inherited]
std::istream& read ( std::istream &  i,
Rep &  n 
) const [inline, inherited]
Rep& convert ( Rep &  a,
const Rep &  b 
) const [inline, inherited]
XXX& convert ( XXX &  x,
const Rep &  a 
) const [inline, inherited]
Rep& assign ( Rep &  a,
const Rep &  b 
) const [inline, inherited]
const Rep& access ( const Rep &  a) const [inline, inherited]
Rep& mul ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& div ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& mod ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& add ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& sub ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& divmod ( Rep &  q,
Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& divexact ( Rep &  q,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& mulin ( Rep &  r,
const Rep &  a 
) const [inline, inherited]
Rep& divin ( Rep &  r,
const Rep &  a 
) const [inline, inherited]
Rep& modin ( Rep &  r,
const Rep &  a 
) const [inline, inherited]
Rep& addin ( Rep &  r,
const Rep &  a 
) const [inline, inherited]
Rep& subin ( Rep &  r,
const Rep &  a 
) const [inline, inherited]
Rep& axpy ( Rep &  r,
const Rep &  a,
const Rep &  b,
const Rep &  c 
) const [inline, inherited]
Rep& maxpy ( Rep &  r,
const Rep &  a,
const Rep &  b,
const Rep &  c 
) const [inline, inherited]
Rep& maxpyin ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& axmy ( Rep &  r,
const Rep &  a,
const Rep &  b,
const Rep &  c 
) const [inline, inherited]
Rep& axpyin ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& axmyin ( Rep &  r,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& neg ( Rep &  r,
const Rep &  a 
) const [inline, inherited]
Rep& negin ( Rep &  r) const [inline, inherited]
Rep& gcd ( Rep &  g,
Rep &  u,
Rep &  v,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& gcd ( Rep &  g,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& lcm ( Rep &  l,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& lcmin ( Rep &  l,
const Rep &  a 
) const [inline, inherited]
Rep& inv ( Rep &  u,
const Rep &  a,
const Rep &  b 
) const [inline, inherited]
Rep& invin ( Rep &  u,
const Rep &  b 
) const [inline, inherited]
Rep& pow ( Rep &  r,
const Rep &  n,
const long  l 
) const [inline, inherited]
Rep& pow ( Rep &  r,
const Rep &  n,
const unsigned long  l 
) const [inline, inherited]
Rep& pow ( Rep &  r,
const Rep &  n,
const int  l 
) const [inline, inherited]
Rep& pow ( Rep &  r,
const Rep &  n,
const unsigned int  l 
) const [inline, inherited]
Rep& sqrt ( Rep &  s,
const Rep &  n 
) const [inline, inherited]
Rep& sqrt ( Rep &  s,
Rep &  r,
const Rep &  n 
) const [inline, inherited]
long logp ( const Rep &  a,
const Rep &  p 
) const [inline, inherited]
Rep& powmod ( Rep &  r,
const Rep &  n,
const long  e,
const Rep &  m 
) const [inline, inherited]
Rep& powmod ( Rep &  r,
const Rep &  n,
const Rep &  e,
const Rep &  m 
) const [inline, inherited]
unsigned long length ( const Rep &  a) const [inline, inherited]
int sign ( const Rep &  a) const [inline, inherited]
bool isZero ( const Rep &  a) const [inline, inherited]
bool isOne ( const Rep &  a) const [inline, inherited]
bool areEqual ( const Rep &  a,
const Rep &  b 
) const [inline, inherited]
bool areNEqual ( const Rep &  a,
const Rep &  b 
) const [inline, inherited]
bool isgeq ( const Rep &  a,
const Rep &  b 
) const [inline, inherited]
bool isgeq ( const long  b,
const Rep &  a 
) const [inline, inherited]
bool isgeq ( const Rep &  a,
const long  b 
) const [inline, inherited]
bool isleq ( const Rep &  a,
const Rep &  b 
) const [inline, inherited]
bool isleq ( const long  b,
const Rep &  a 
) const [inline, inherited]
bool isleq ( const Rep &  a,
const long  b 
) const [inline, inherited]
bool isgt ( const Rep &  a,
const Rep &  b 
) const [inline, inherited]
bool isgt ( const long  b,
const Rep &  a 
) const [inline, inherited]
bool isgt ( const Rep &  a,
const long  b 
) const [inline, inherited]
bool islt ( const Rep &  a,
const Rep &  b 
) const [inline, inherited]
bool islt ( const long  b,
const Rep &  a 
) const [inline, inherited]
bool islt ( const Rep &  a,
const long  b 
) const [inline, inherited]
Rep& random ( RandIter &  ,
Rep &  r,
long  s = 1 
) const [inline, inherited]
Rep& random ( RandIter &  ,
Rep &  r,
const Rep &  b 
) const [inline, inherited]
Rep& nonzerorandom ( RandIter &  ,
Rep &  r,
long  s = 1 
) const [inline, inherited]
Rep& nonzerorandom ( RandIter &  ,
Rep &  r,
const Rep &  b 
) const [inline, inherited]

Field Documentation

bool _fast_impl [protected]
RandIter _g [protected, inherited]
const Integer one [inherited]
const Integer zero [inherited]

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