siqs_poly.h File Reference

Structure and functions related to the polynomials used in the SIQS algorithm. More...

#include <stdint.h>
#include <stdbool.h>
#include <gmp.h>
#include "exit_codes.h"
#include "array.h"
#include "approx.h"

Go to the source code of this file.

Data Structures

struct  struct_siqs_poly_t
 Defines polynomials used by SIQS. More...

Typedefs

typedef struct struct_siqs_poly_t siqs_poly_t
 Equivalent to struct_siqs_poly_t.

Functions

siqs_poly_talloc_siqs_poly (mpz_t target_a, mpz_t n, uint32_array_t *const factor_base, uint32_array_t *const sqrtm_pi)
 Allocates and returns a new siqs_poly_t.
void free_siqs_poly (siqs_poly_t *poly)
 Frees a previously allocated siqs_poly_t.
ecode_t update_polynomial (siqs_poly_t *const poly)
 Updates a polynomial.
int na_used (siqs_poly_t *const poly)
 Returns the number of "full" initialization performed.


Detailed Description

Structure and functions related to the polynomials used in the SIQS algorithm.

Author:
Jerome Milan
Date:
Fri Jun 10 2011
Version:
2011-06-10

Definition in file siqs_poly.h.


Function Documentation

siqs_poly_t* alloc_siqs_poly ( mpz_t  target_a,
mpz_t  n,
uint32_array_t *const   factor_base,
uint32_array_t *const   sqrtm_pi 
)

Allocates and returns a new siqs_poly_t.

Parameters:
target_a the target leading coefficient to approximate.
n the number to factor (or a small multiple).
factor_base the factor base.
sqrtm_pi the modular square roots of n.
Returns:
A pointer to the newly allocated siqs_poly_t.

void free_siqs_poly ( siqs_poly_t poly  ) 

Frees a previously allocated siqs_poly_t.

Frees all memory used by the pointed siqs_poly_t and then frees the poly pointer.

Warning:
Do not call free(poly) in client code after a call to free_siqs_poly(poly): it would result in an error.
Parameters:
poly the siqs_poly_t to free.

int na_used ( siqs_poly_t *const   poly  ) 

Returns the number of "full" initialization performed.

This is also the number of distinct a used.

Parameters:
poly the polynomial used.
Returns:
The number of "full" initialization performed.

ecode_t update_polynomial ( siqs_poly_t *const   poly  ) 

Updates a polynomial.

Updates the polynomial poly by either, deriving a new b value (the so-called "fast" initialization) or by computing a new leading coefficient (the "full" or "slow" initilization).

Parameters:
poly the polynomial to update.
Returns:
An error code (either SUCCESS or FATAL_INTERNAL_ERROR)


Generated on Fri Jun 17 11:10:12 2011 for TIFA by Doxygen 1.5.5