#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_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. | |
| 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. | |
Definition in file siqs_poly.h.
| 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.
| 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. |
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.
free(poly) in client code after a call to free_siqs_poly(poly): it would result in an error.| 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.
| poly | the polynomial used. |
| 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).
| poly | the polynomial to update. |
SUCCESS or FATAL_INTERNAL_ERROR)