IntRSADom< MyRandIter > Class Template Referenceabstract

RSA domain. More...

`#include <givintrsa.h>`

Inheritance diagram for IntRSADom< MyRandIter >:
[legend]
Collaboration diagram for IntRSADom< MyRandIter >:
[legend]

## Public Member Functions

| IntRSADom (bool fi=false, MyRandIter g=MyRandIter())
| Constructors.
const Element & | getn () const
| Accesses.
std::ostream & | encipher (std::ostream &, std::istream &) const
| Text conversions.
Element & | strong_prime (random_generator &g, int64_t psize, Element &p) const
| Strong Primes.
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.
int64_t | log (const Element &n, const int64_t=10) const
| log[10]
std::ostream & | ecriture_str (std::ostream &, const Element &) const
| Text conversions.
Element & | point_break (Element &u)
| Breaking codes : finding u knowing only m an k ...
bool | set (Container1 &setint, Container2 &setpwd, const Rep &a, unsigned long loops=0) const
| Factors with primes.
bool | isUnit (const Rep &x) const
| isUnit
bool | isDivisor (const Element &a, const Element &b) const
| isDivisor (a, b) Test if b | a.
Input/Output Operations
std::ostream & | write (std::ostream &os, const Element &x) const
| Print field element.
std::istream & | read (std::istream &is) const
| Read field.
virtual std::istream & | read (std::istream &is, Element &x) const
| Read field element.
Arithmetic Operations
The first argument is set and is also the return value.
Element & | mul (Element &x, const Element &y, const Element &z) const
| x := y*z
Element & | div (Element &x, const Element &y, const Element &z) const
| x := y/z
Element & | div (Element &x, const Element &y, const Element &z) const
| x := y/z
Element & | mod (Element &x, const Element &y, const Element &z) const
| x := y mod z
Element & | mod (Element &x, const Element &y, const Element &z) const
| x := y mod z
Element & | add (Element &x, const Element &y, const Element &z) const
| x := y + z
Element & | sub (Element &x, const Element &y, const Element &z) const
| x := y - z
Element & | axpy (Element &z, const Element &a, const Element &x, const Element &y) const
| z := a*x + y
Element & | maxpy (Element &z, const Element &a, const Element &x, const Element &y) const
| z := y - a*x
Element & | maxpyin (Element &z, const Element &a, const Element &x) const
| z := z - a*x
Element & | axmy (Element &z, const Element &a, const Element &x, const Element &y) const
| z := a*x - y
Element & | axpyin (Element &z, const Element &a, const Element &x) const
| z := a*x + z
Element & | axmyin (Element &z, const Element &a, const Element &x) const
| z := a*x - z
Element & | neg (Element &x, const Element &y) const
| x := -y
Element & | inv (Element &x, const Element &y) const
| x := 1/y
Element & | inv (Element &x, const Element &y) const
| x := 1/y
Inplace Arithmetic Operations
The first argument is modified and the result is the return value.
Element & | mulin (Element &x, const Element &y) const
| x := x*y
Element & | divin (Element &x, const Element &y) const
| x := x/y
Element & | divin (Element &x, const Element &y) const
| x := x/y
Element & | modin (Element &x, const Element &y) const
| x := x mod y
Element & | modin (Element &x, const Element &y) const
| x := x mod y
Element & | addin (Element &x, const Element &y) const
| x := x + y
Element & | subin (Element &x, const Element &y) const
| x := x - y
Element & | negin (Element &x) const
| x := -x
Element & | invin (Element &x) const
| x := 1/x
Comparison Predicates
bool | areEqual (const Element &x, const Element &y) const
| x == y
Data Object Management.
first argument is set and the value is also returned.

## Protected Attributes

bool | _fast_impl
| Fast implementation.

## Detailed Description

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

RSA domain.

Examples
  examples/Integer/RSA_breaking.C, examples/Integer/RSA_decipher.C, examples/Integer/RSA_encipher.C, examples/Integer/RSA_keys_generator.C, and examples/Integer/givaro-ssh-keygen.C.

## Member Function Documentation

## strong_prime()

template<class MyRandIter>

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()

template<class MyRandIter>

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)

## write() [1/2]

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

inline inherited

Read field.

Returns
  input stream from which field is read.

Parameters

  is | input stream from which field is read.

## write() [2/2]

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

inline inherited

Print field element.

Returns
  output stream to which field element is written.

Parameters

  os | output stream to which field element is written.
  x | field element.

## read() [1/2]

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

inline inherited

Read field.

Returns
  input stream from which field is read.

Parameters

  is | input stream from which field is read.

## read() [2/2]

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

inline virtual inherited

Read field element.

Returns
  input stream from which field element is read.

Parameters

  is | input stream from which field element is read.
  x | field element.

## Field Documentation

## _fast_impl

template<class MyRandIter = GivRandom>

bool _fast_impl

protected

Fast implementation.

Means simple enciphering key, and deciphering via chinese remaindering.

Warning
  this means less security !

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

- givintrsa.h
- givintrsa.inl