elliptic_curves Class Reference

contains elliptic curve operations More...

#include <elliptic_curve.H>

Inheritance diagram for elliptic_curves:

Inheritance graph
[legend]
Collaboration diagram for elliptic_curves:

Collaboration graph
[legend]

List of all members.

Public Types

typedef long long int NATNUM

Public Member Functions

 elliptic_curves ()
 ~elliptic_curves ()
void go (const int ecm_sigma, NATNUM phase1, const NATNUM phase2)
void go (const int ecm_sigma, const int phase1, const int phase2)
void go (const int ecm_sigma, const double phase1, const double phase2)

Private Member Functions

void check_curve (const mpz_t x, const mpz_t y) const
void factor_found (mpz_t k) const
bool sub (mpz_t xr, mpz_t yr, const mpz_t x1, const mpz_t y1, const mpz_t x2, const mpz_t y2)
bool add (mpz_t xr, mpz_t yr, const mpz_t x1, const mpz_t y1, const mpz_t x2, const mpz_t y2)
bool mul2 (mpz_t xr, mpz_t yr, const mpz_t x1, const mpz_t y1)
bool mul (mpz_t xr, mpz_t yr, const mpz_t x1, const mpz_t y1, NATNUM K)
bool add (mpz_t xr, mpz_t yr, const mpz_t x1, const mpz_t y1, const mpz_t x2, const mpz_t y2, mpz_t k)
bool init_arithmetic_progression (mpz_t *const x, mpz_t *const y, const mpz_t startx, const mpz_t starty, const NATNUM startpos, const unsigned int delta, const unsigned int grad)
bool arithmetic_progression (mpz_t *const x, mpz_t *const y, const int anz)
void XZ_mul2 (mpz_t xr, mpz_t zr, const mpz_t x1, const mpz_t z1)
void XZ_mul2 (const PmpzPoint R, const PconstmpzPoint A)
void XZ_mul2plus1 (mpz_t xr, mpz_t zr, const mpz_t Xp0, const mpz_t Zp0, const mpz_t Xp1, const mpz_t Zp1, const mpz_t x1, const mpz_t z1)
void XZ_mul2plus1 (const PmpzPoint R, const PconstmpzPoint A, const PconstmpzPoint B, const PconstmpzPoint C)
void XZ_multiply (mpz_t xr, mpz_t zr, const mpz_t x1, const mpz_t z1, NATNUM K)

Static Private Member Functions

static unsigned int cost_of_evaluating_lucas_chain (const NATNUM K, const double alpha)

Private Attributes

mpz_t a
mpz_t b
mpz_t h
mpz_t k
mpz_t m
mpz_t x3
mpz_t y3
mpz_t xh_mul
mpz_t yh_mul
PmpzPoint A
PmpzPoint B
PmpzPoint C
PmpzPoint T1
PmpzPoint T2
int sigma
int phase


Detailed Description

contains elliptic curve operations

Definition at line 116 of file elliptic_curve.H.


Member Typedef Documentation

typedef long long int elliptic_curves::NATNUM

Definition at line 119 of file elliptic_curve.H.


Constructor & Destructor Documentation

elliptic_curves::elliptic_curves (  )  [inline]

Definition at line 135 of file elliptic_curve.H.

References a, b, h, k, m, mpz_init(), n, x3, xh_mul, y3, and yh_mul.

Here is the call graph for this function:

elliptic_curves::~elliptic_curves (  )  [inline]

Definition at line 172 of file elliptic_curve.H.

References A, a, B, b, C, h, k, m, mpz_clear(), T1, T2, x3, xh_mul, y3, and yh_mul.

Here is the call graph for this function:


Member Function Documentation

void elliptic_curves::check_curve ( const mpz_t  x,
const mpz_t  y 
) const [private]

Definition at line 58 of file elliptic_curve.cc.

References a, b, cerr, endl(), exit(), mpz_add(), mpz_add_ui(), mpz_clear(), mpz_cmp(), mpz_init(), mpz_mod(), mpz_mul(), and n.

Referenced by add(), go(), mul(), and mul2().

Here is the call graph for this function:

void elliptic_curves::factor_found ( mpz_t  k  )  const [private]

Definition at line 16 of file elliptic_curve-variant.cc.

References cout, endl(), Factorization_to_file, flush(), h, MAL(), mpz_clear(), mpz_cmp(), mpz_init(), mpz_probab_prime_p(), mpz_remove(), mpz_set(), mpz_sizeinbase(), mpz_swap(), n, phase, my_mpz_wrapper::probab_prime_checks, and sigma.

Referenced by add(), go(), and mul2().

Here is the call graph for this function:

bool elliptic_curves::sub ( mpz_t  xr,
mpz_t  yr,
const mpz_t  x1,
const mpz_t  y1,
const mpz_t  x2,
const mpz_t  y2 
) [private]

Definition at line 529 of file elliptic_curve.cc.

References mpz_clear(), mpz_init(), mpz_mod(), mpz_neg(), and n.

Referenced by init_arithmetic_progression().

Here is the call graph for this function:

bool elliptic_curves::add ( mpz_t  xr,
mpz_t  yr,
const mpz_t  x1,
const mpz_t  y1,
const mpz_t  x2,
const mpz_t  y2 
) [private]

Definition at line 545 of file elliptic_curve.cc.

References a, b, check_curve(), cout, endl(), factor_found(), h, k, m, mpz_add(), mpz_add_ui(), mpz_cmp(), mpz_gcd(), mpz_invert(), mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_set(), mpz_sub(), n, x3, and y3.

Here is the call graph for this function:

bool elliptic_curves::mul2 ( mpz_t  xr,
mpz_t  yr,
const mpz_t  x1,
const mpz_t  y1 
) [private]

Definition at line 506 of file elliptic_curve.cc.

References a, b, check_curve(), cout, endl(), factor_found(), h, k, m, mpz_add(), mpz_add_ui(), mpz_gcd(), mpz_invert(), mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_set(), mpz_sub(), n, x3, and y3.

Referenced by go(), and mul().

Here is the call graph for this function:

bool elliptic_curves::mul ( mpz_t  xr,
mpz_t  yr,
const mpz_t  x1,
const mpz_t  y1,
NATNUM  K 
) [private]

Definition at line 713 of file elliptic_curve.cc.

References cerr, check_curve(), cout, endl(), exit(), mpz_set(), mul2(), xh_mul, and yh_mul.

Referenced by go(), and init_arithmetic_progression().

Here is the call graph for this function:

bool elliptic_curves::add ( mpz_t  xr,
mpz_t  yr,
const mpz_t  x1,
const mpz_t  y1,
const mpz_t  x2,
const mpz_t  y2,
mpz_t  k 
) [private]

Definition at line 596 of file elliptic_curve.cc.

References a, b, check_curve(), cout, endl(), factor_found(), h, m, mpz_add(), mpz_add_ui(), mpz_cmp(), mpz_gcd(), mpz_invert(), mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_set(), mpz_sub(), n, x3, and y3.

Here is the call graph for this function:

bool elliptic_curves::init_arithmetic_progression ( mpz_t *const   x,
mpz_t *const   y,
const mpz_t  startx,
const mpz_t  starty,
const NATNUM  startpos,
const unsigned int  delta,
const unsigned int  grad 
) [private]

Definition at line 645 of file elliptic_curve.cc.

References mpz_set(), mul(), and sub().

Referenced by go().

Here is the call graph for this function:

bool elliptic_curves::arithmetic_progression ( mpz_t *const   x,
mpz_t *const   y,
const int  anz 
) [private]

Definition at line 664 of file elliptic_curve.cc.

References b, h, mpz_clear(), mpz_cmp_ui(), mpz_init(), mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_multi_invert(), mpz_sub(), and n.

Referenced by go().

Here is the call graph for this function:

void elliptic_curves::XZ_mul2 ( mpz_t  xr,
mpz_t  zr,
const mpz_t  x1,
const mpz_t  z1 
) [private]

Definition at line 79 of file elliptic_curve.cc.

References b, h, k, m, mpz_add(), mpz_mulmod, mpz_sub(), and n.

Referenced by go(), XZ_mul2(), and XZ_multiply().

Here is the call graph for this function:

void elliptic_curves::XZ_mul2 ( const PmpzPoint  R,
const PconstmpzPoint  A 
) [inline, private]

Definition at line 205 of file elliptic_curve.H.

References TmpzPoint::x, XZ_mul2(), and TmpzPoint::z.

Here is the call graph for this function:

void elliptic_curves::XZ_mul2plus1 ( mpz_t  xr,
mpz_t  zr,
const mpz_t  Xp0,
const mpz_t  Zp0,
const mpz_t  Xp1,
const mpz_t  Zp1,
const mpz_t  x1,
const mpz_t  z1 
) [private]

Definition at line 105 of file elliptic_curve.cc.

References h, k, m, modulo, mpz_add(), mpz_mul(), mpz_mulmod, mpz_sub(), and n.

Referenced by go(), XZ_mul2plus1(), and XZ_multiply().

Here is the call graph for this function:

void elliptic_curves::XZ_mul2plus1 ( const PmpzPoint  R,
const PconstmpzPoint  A,
const PconstmpzPoint  B,
const PconstmpzPoint  C 
) [inline, private]

Definition at line 211 of file elliptic_curve.H.

References TmpzPoint::x, XZ_mul2plus1(), and TmpzPoint::z.

Here is the call graph for this function:

unsigned int elliptic_curves::cost_of_evaluating_lucas_chain ( const NATNUM  K,
const double  alpha 
) [static, private]

Definition at line 202 of file elliptic_curve.cc.

References cerr, COST_XZ_mul2, COST_XZ_mul2plus1, endl(), exit(), and std::swap().

Referenced by XZ_multiply().

Here is the call graph for this function:

void elliptic_curves::XZ_multiply ( mpz_t  xr,
mpz_t  zr,
const mpz_t  x1,
const mpz_t  z1,
NATNUM  K 
) [private]

Definition at line 299 of file elliptic_curve.cc.

References A, B, C, cerr, cost_of_evaluating_lucas_chain(), cout, endl(), exit(), mpz_set(), numtheory::probab_prime(), swap(), std::swap(), T1, T2, TmpzPoint::x, XZ_mul2(), XZ_mul2plus1(), and TmpzPoint::z.

Referenced by go().

Here is the call graph for this function:

void elliptic_curves::go ( const int  ecm_sigma,
NATNUM  phase1,
const NATNUM  phase2 
)

Definition at line 743 of file elliptic_curve.cc.

References a, arithmetic_progression(), b, ceil(), cerr, check_curve(), CPersistentDataCollection::ClearStream(), polynomial::construct_polynomial_from_roots(), cout, endl(), exit(), factor_found(), flush(), numtheory::gcd(), get_fft_parameter(), Cusr_signal_proxy::got_SIGUSR1(), Cusr_signal_proxy::got_SIGUSR2(), h, init_arithmetic_progression(), numtheory::is_prime(), k, CPersistentDataCollection::Load(), MARK, modulo, mpz_add(), mpz_add_ui(), mpz_clear(), mpz_cmp_ui(), mpz_gcd(), mpz_init(), mpz_init_set(), mpz_invert(), mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_powm_ui(), mpz_probab_prime_p(), mpz_set(), mpz_set_ui(), mpz_sub(), mpz_sub_ui(), mul(), mul2(), polynomial::multipoint_eval(), n, phase, Polynom, my_mpz_wrapper::probab_prime_checks, CPersistentDataCollection::RegisterVar(), CPersistentDataCollection::Save(), CConditionalNamedSemaphorePostAtDestruction::set_condition(), sigma, sqrt(), CNamedSemaphore::trywait(), XZ_mul2(), XZ_mul2plus1(), and XZ_multiply().

Referenced by easy_factor(), go(), main(), and process_ecm().

Here is the call graph for this function:

void elliptic_curves::go ( const int  ecm_sigma,
const int  phase1,
const int  phase2 
) [inline]

Definition at line 219 of file elliptic_curve.H.

References go().

Here is the call graph for this function:

void elliptic_curves::go ( const int  ecm_sigma,
const double  phase1,
const double  phase2 
) [inline]

Definition at line 223 of file elliptic_curve.H.

References go().

Here is the call graph for this function:


Member Data Documentation

mpz_t elliptic_curves::a [private]

Definition at line 121 of file elliptic_curve.H.

Referenced by add(), check_curve(), elliptic_curves(), go(), mul2(), and ~elliptic_curves().

mpz_t elliptic_curves::b [private]

Definition at line 121 of file elliptic_curve.H.

Referenced by add(), arithmetic_progression(), check_curve(), elliptic_curves(), go(), mul2(), XZ_mul2(), and ~elliptic_curves().

mpz_t elliptic_curves::h [private]

Definition at line 122 of file elliptic_curve.H.

Referenced by add(), arithmetic_progression(), elliptic_curves(), factor_found(), go(), mul2(), XZ_mul2(), XZ_mul2plus1(), and ~elliptic_curves().

mpz_t elliptic_curves::k [private]

Definition at line 122 of file elliptic_curve.H.

Referenced by add(), elliptic_curves(), go(), mul2(), XZ_mul2(), XZ_mul2plus1(), and ~elliptic_curves().

mpz_t elliptic_curves::m [private]

Definition at line 122 of file elliptic_curve.H.

Referenced by add(), elliptic_curves(), mul2(), XZ_mul2(), XZ_mul2plus1(), and ~elliptic_curves().

mpz_t elliptic_curves::x3 [private]

Definition at line 123 of file elliptic_curve.H.

Referenced by add(), elliptic_curves(), mul2(), and ~elliptic_curves().

mpz_t elliptic_curves::y3 [private]

Definition at line 123 of file elliptic_curve.H.

Referenced by add(), elliptic_curves(), mul2(), and ~elliptic_curves().

mpz_t elliptic_curves::xh_mul [private]

Definition at line 124 of file elliptic_curve.H.

Referenced by elliptic_curves(), mul(), and ~elliptic_curves().

mpz_t elliptic_curves::yh_mul [private]

Definition at line 124 of file elliptic_curve.H.

Referenced by elliptic_curves(), mul(), and ~elliptic_curves().

PmpzPoint elliptic_curves::A [private]

Definition at line 125 of file elliptic_curve.H.

Referenced by XZ_multiply(), and ~elliptic_curves().

PmpzPoint elliptic_curves::B [private]

Definition at line 125 of file elliptic_curve.H.

Referenced by XZ_multiply(), and ~elliptic_curves().

PmpzPoint elliptic_curves::C [private]

Definition at line 125 of file elliptic_curve.H.

Referenced by XZ_multiply(), and ~elliptic_curves().

PmpzPoint elliptic_curves::T1 [private]

Definition at line 125 of file elliptic_curve.H.

Referenced by XZ_multiply(), and ~elliptic_curves().

PmpzPoint elliptic_curves::T2 [private]

Definition at line 125 of file elliptic_curve.H.

Referenced by XZ_multiply(), and ~elliptic_curves().

int elliptic_curves::sigma [private]

Definition at line 126 of file elliptic_curve.H.

Referenced by factor_found(), and go().

int elliptic_curves::phase [private]

Definition at line 127 of file elliptic_curve.H.

Referenced by factor_found(), and go().


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