CN_Residue Class Reference

List of all members.

Public Member Functions

 CN_Residue ()
void init (const mpz_t M)
 CN_Residue (const mpz_t M)
 ~CN_Residue ()
void mod (mpz_t res, const mpz_t a)
 CN_Residue ()
void init (const mpz_t M)
 CN_Residue (const mpz_t M)
 ~CN_Residue ()
void redc (mpz_t res, const mpz_t T)
 reduce-operation
void convert (mpz_t x) const
 convert to N-residue
void convert_back (mpz_t x) const
 convert N-residue back to normal-form
int invert (mpz_t res, const mpz_t T) const
 res = T^(-1) mod N (in N-residue)

Private Attributes

mpz_t N
mpz_t R
mpz_t h
unsigned int k
mpz_t Ri
mpz_t Ns
mpz_t m
mpz_t t


Detailed Description

Definition at line 17 of file modular_arithmetic.cc.


Constructor & Destructor Documentation

CN_Residue::CN_Residue (  )  [inline]

Definition at line 25 of file modular_arithmetic.cc.

References cout, endl(), h, k, mpz_init(), N, and R.

Referenced by CN_Residue().

Here is the call graph for this function:

CN_Residue::CN_Residue ( const mpz_t  M  )  [inline, explicit]

Definition at line 38 of file modular_arithmetic.cc.

References CN_Residue(), and init().

Here is the call graph for this function:

CN_Residue::~CN_Residue (  )  [inline]

Definition at line 43 of file modular_arithmetic.cc.

References h, mpz_clear(), N, and R.

Here is the call graph for this function:

CN_Residue::CN_Residue (  )  [inline]

Definition at line 34 of file modular_mult.cc.

References cout, endl(), k, m, mpz_init(), N, Ns, R, Ri, and t.

Here is the call graph for this function:

CN_Residue::CN_Residue ( const mpz_t  M  )  [inline, explicit]

Definition at line 51 of file modular_mult.cc.

References CN_Residue(), and init().

Here is the call graph for this function:

CN_Residue::~CN_Residue (  )  [inline]

Definition at line 56 of file modular_mult.cc.

References m, mpz_clear(), N, Ns, R, Ri, and t.

Here is the call graph for this function:


Member Function Documentation

void CN_Residue::init ( const mpz_t  M  )  [inline]

Definition at line 31 of file modular_arithmetic.cc.

References h, k, mpz_cdiv_q(), mpz_mul_2exp(), mpz_set(), mpz_set_ui(), mpz_sizeinbase(), N, and R.

Referenced by CN_Residue().

Here is the call graph for this function:

void CN_Residue::mod ( mpz_t  res,
const mpz_t  a 
) [inline]

Definition at line 49 of file modular_arithmetic.cc.

References cerr, endl(), h, k, mpz_add_ui(), mpz_fdiv_q_2exp(), mpz_mod(), mpz_mul(), mpz_sizeinbase(), mpz_sub(), N, and R.

Here is the call graph for this function:

void CN_Residue::init ( const mpz_t  M  )  [inline]

Definition at line 42 of file modular_mult.cc.

References k, mpz_invert(), mpz_mod(), mpz_mul(), mpz_mul_2exp(), mpz_set(), mpz_set_ui(), mpz_sizeinbase(), mpz_sub_ui(), N, Ns, R, and Ri.

Here is the call graph for this function:

void CN_Residue::redc ( mpz_t  res,
const mpz_t  T 
) [inline]

reduce-operation

Definition at line 62 of file modular_mult.cc.

References k, m, mpz_add(), mpz_cmp(), mpz_mod(), mpz_mul(), mpz_sub(), mpz_tdiv_q_2exp(), mpz_tdiv_r_2exp(), N, Ns, and t.

Here is the call graph for this function:

void CN_Residue::convert ( mpz_t  x  )  const [inline]

convert to N-residue

Definition at line 83 of file modular_mult.cc.

References k, mpz_mod(), mpz_mul_2exp(), and N.

Referenced by invert().

Here is the call graph for this function:

void CN_Residue::convert_back ( mpz_t  x  )  const [inline]

convert N-residue back to normal-form

Definition at line 89 of file modular_mult.cc.

References mpz_mod(), mpz_mul(), N, and Ri.

Referenced by invert().

Here is the call graph for this function:

int CN_Residue::invert ( mpz_t  res,
const mpz_t  T 
) const [inline]

res = T^(-1) mod N (in N-residue)

Definition at line 93 of file modular_mult.cc.

References convert(), convert_back(), mpz_invert(), mpz_set(), and N.

Here is the call graph for this function:


Member Data Documentation

mpz_t CN_Residue::N [private]

Definition at line 20 of file modular_arithmetic.cc.

Referenced by CN_Residue(), convert(), convert_back(), init(), invert(), mod(), redc(), and ~CN_Residue().

mpz_t CN_Residue::R [private]

Definition at line 21 of file modular_arithmetic.cc.

Referenced by CN_Residue(), init(), mod(), and ~CN_Residue().

mpz_t CN_Residue::h [private]

Definition at line 22 of file modular_arithmetic.cc.

Referenced by CN_Residue(), init(), mod(), and ~CN_Residue().

unsigned int CN_Residue::k [private]

Definition at line 23 of file modular_arithmetic.cc.

Referenced by CN_Residue(), convert(), init(), mod(), and redc().

mpz_t CN_Residue::Ri [private]

Definition at line 30 of file modular_mult.cc.

Referenced by CN_Residue(), convert_back(), init(), and ~CN_Residue().

mpz_t CN_Residue::Ns [private]

Definition at line 30 of file modular_mult.cc.

Referenced by CN_Residue(), init(), redc(), and ~CN_Residue().

mpz_t CN_Residue::m [private]

Definition at line 31 of file modular_mult.cc.

Referenced by CN_Residue(), redc(), and ~CN_Residue().

mpz_t CN_Residue::t [private]

Definition at line 31 of file modular_mult.cc.

Referenced by CN_Residue(), redc(), and ~CN_Residue().


The documentation for this class was generated from the following files:
Generated on Wed Nov 7 23:30:58 2007 for Qsieve by  doxygen 1.5.4