#include "gf.h"


Go to the source code of this file.
Data Structures | |
| struct | polynome |
Defines | |
| #define | TRUE 1 |
| #define | FALSE 0 |
| #define | poly_deg(p) ((p)->deg) |
| #define | poly_size(p) ((p)->size) |
| #define | poly_set_deg(p, d) ((p)->deg = (d)) |
| #define | poly_coeff(p, i) ((p)->coeff[i]) |
| #define | poly_set_coeff(p, i, a) ((p)->coeff[i] = (a)) |
| #define | poly_addto_coeff(p, i, a) ((p)->coeff[i] = gf_add((p)->coeff[i], (a))) |
| #define | poly_multo_coeff(p, i, a) ((p)->coeff[i] = gf_mul((p)->coeff[i], (a))) |
| #define | poly_tete(p) ((p)->coeff[(p)->deg]) |
Typedefs | |
| typedef struct polynome * | poly_t |
Functions | |
| int | poly_calcule_deg (poly_t p) |
| poly_t | poly_alloc (int d) |
| poly_t | poly_alloc_from_string (int d, const unsigned char *s) |
| poly_t | poly_copy (poly_t p) |
| void | poly_free (poly_t p) |
| void | poly_set_to_zero (poly_t p) |
| void | poly_set (poly_t p, poly_t q) |
| poly_t | poly_mul (poly_t p, poly_t q) |
| void | poly_rem (poly_t p, poly_t g) |
| void | poly_sqmod_init (poly_t g, poly_t *sq) |
| void | poly_sqmod (poly_t res, poly_t p, poly_t *sq, int d) |
| poly_t | poly_gcd (poly_t p1, poly_t p2) |
| poly_t | poly_quo (poly_t p, poly_t d) |
| gf_t | poly_eval (poly_t p, gf_t a) |
| int | poly_degppf (poly_t g) |
| void | poly_eeaux (poly_t *u, poly_t *v, poly_t p, poly_t g, int t) |
| poly_t * | poly_syndrome_init (poly_t generator, gf_t *support, int n) |
| poly_t * | poly_sqrtmod_init (poly_t g) |
| poly_t | poly_randgen_irred (int t, int(*u8rnd)()) |
| #define poly_addto_coeff | ( | p, | |||
| i, | |||||
| a | ) | ((p)->coeff[i] = gf_add((p)->coeff[i], (a))) |
Definition at line 41 of file poly.h.
Referenced by decode(), poly_degppf(), poly_eeaux(), poly_mul(), poly_quo(), poly_rem(), poly_sqmod(), roots_berl(), and roots_berl_aux().
| #define poly_coeff | ( | p, | |||
| i | ) | ((p)->coeff[i]) |
Definition at line 39 of file poly.h.
Referenced by decode(), keypair(), poly_eeaux(), poly_mul(), poly_quo(), poly_rem(), poly_sqmod(), poly_syndrome_init(), roots_berl(), and roots_berl_aux().
| #define poly_deg | ( | p | ) | ((p)->deg) |
Definition at line 36 of file poly.h.
Referenced by decode(), poly_degppf(), poly_eeaux(), poly_eval(), poly_gcd(), poly_gcd_aux(), poly_mul(), poly_rem(), poly_shiftmod(), poly_sqmod(), poly_sqmod_init(), poly_sqrtmod_init(), poly_syndrome_init(), and roots_berl_aux().
| #define poly_multo_coeff | ( | p, | |||
| i, | |||||
| a | ) | ((p)->coeff[i] = gf_mul((p)->coeff[i], (a))) |
| #define poly_set_coeff | ( | p, | |||
| i, | |||||
| a | ) | ((p)->coeff[i] = (a)) |
Definition at line 40 of file poly.h.
Referenced by decode(), poly_degppf(), poly_eeaux(), poly_quo(), poly_randgen_irred(), poly_rem(), poly_sqmod(), poly_sqmod_init(), poly_sqrtmod_init(), poly_syndrome_init(), roots_berl(), and syndrome().
| #define poly_set_deg | ( | p, | |||
| d | ) | ((p)->deg = (d)) |
Definition at line 38 of file poly.h.
Referenced by poly_degppf(), poly_eeaux(), poly_quo(), poly_randgen_irred(), poly_rem(), poly_sqmod(), poly_sqmod_init(), poly_sqrtmod_init(), roots_berl(), and sk_from_string().
| #define poly_tete | ( | p | ) | ((p)->coeff[(p)->deg]) |
| poly_t poly_alloc | ( | int | d | ) |
Definition at line 32 of file poly.c.
References polynome::coeff, polynome::deg, and polynome::size.
Referenced by decode(), poly_degppf(), poly_eeaux(), poly_mul(), poly_quo(), poly_randgen_irred(), poly_sqrtmod_init(), poly_syndrome_init(), roots_berl(), roots_berl_aux(), and syndrome().
| poly_t poly_alloc_from_string | ( | int | d, | |
| const unsigned char * | s | |||
| ) |
Definition at line 43 of file poly.c.
References polynome::coeff, polynome::deg, and polynome::size.
Referenced by sk_from_string().
| int poly_calcule_deg | ( | poly_t | p | ) |
Definition at line 74 of file poly.c.
References polynome::coeff, polynome::deg, gf_zero, and polynome::size.
Referenced by decode(), poly_degppf(), poly_mul(), poly_quo(), poly_set(), poly_sqrtmod_init(), roots_berl(), roots_berl_aux(), and syndrome().
Definition at line 53 of file poly.c.
References polynome::coeff, polynome::deg, and polynome::size.
Referenced by poly_gcd(), and poly_quo().
| int poly_degppf | ( | poly_t | g | ) |
Definition at line 251 of file poly.c.
References gf_extd, gf_unit, poly_addto_coeff, poly_alloc(), poly_calcule_deg(), poly_deg, poly_free(), poly_gcd(), poly_set_coeff, poly_set_deg, poly_sqmod(), and poly_sqmod_init().
Referenced by poly_randgen_irred().

Definition at line 299 of file poly.c.
References aux, gf_div, gf_mul_fast, gf_unit, gf_zero, poly_addto_coeff, poly_alloc(), poly_coeff, poly_deg, poly_free(), poly_set(), poly_set_coeff, poly_set_deg, and poly_set_to_zero().
Referenced by decode().

Definition at line 125 of file poly.c.
References polynome::coeff, poly_deg, and poly_eval_aux().
Referenced by key_genmat().

| void poly_free | ( | poly_t | p | ) |
Definition at line 64 of file poly.c.
References polynome::coeff.
Referenced by decode(), keypair(), poly_degppf(), poly_eeaux(), poly_gcd(), poly_quo(), poly_sqrtmod_init(), roots_berl(), and roots_berl_aux().
Definition at line 211 of file poly.c.
References poly_copy(), poly_deg, poly_free(), and poly_gcd_aux().
Referenced by poly_degppf(), and roots_berl_aux().

Definition at line 108 of file poly.c.
References gf_mul, poly_addto_coeff, poly_alloc(), poly_calcule_deg(), poly_coeff, and poly_deg.

Definition at line 225 of file poly.c.
References gf_inv, gf_mul_fast, gf_zero, poly_addto_coeff, poly_alloc(), poly_calcule_deg(), poly_coeff, poly_copy(), poly_free(), poly_set_coeff, and poly_set_deg.
Referenced by roots_berl_aux().

| poly_t poly_randgen_irred | ( | int | t, | |
| int(*)() | u8rnd | |||
| ) |
Definition at line 365 of file poly.c.
References g, gf_rand(), gf_unit, poly_alloc(), poly_degppf(), poly_set_coeff, poly_set_deg, and u8rnd().
Referenced by keypair().

Definition at line 130 of file poly.c.
References gf_inv, gf_mul_fast, gf_zero, poly_addto_coeff, poly_coeff, poly_deg, poly_set_coeff, poly_set_deg, and poly_tete.
Referenced by poly_gcd_aux(), and poly_sqmod_init().
Definition at line 83 of file poly.c.
References polynome::coeff, polynome::deg, poly_calcule_deg(), and polynome::size.
Referenced by poly_eeaux(), and poly_sqrtmod_init().

| void poly_set_to_zero | ( | poly_t | p | ) |
Definition at line 69 of file poly.c.
References polynome::coeff, polynome::deg, and polynome::size.
Referenced by poly_eeaux(), poly_sqmod(), poly_sqmod_init(), and poly_sqrtmod_init().
Definition at line 176 of file poly.c.
References gf_mul_fast, gf_square, gf_zero, poly_addto_coeff, poly_coeff, poly_deg, poly_set_coeff, poly_set_deg, and poly_set_to_zero().
Referenced by poly_degppf(), poly_sqrtmod_init(), and roots_berl().

Definition at line 151 of file poly.c.
References gf_unit, poly_deg, poly_rem(), poly_set_coeff, poly_set_deg, and poly_set_to_zero().
Referenced by poly_degppf(), poly_sqrtmod_init(), and roots_berl().

Definition at line 396 of file poly.c.
References aux, polynome::coeff, polynome::deg, gf_extd, gf_unit, poly_alloc(), poly_calcule_deg(), poly_deg, poly_free(), poly_set(), poly_set_coeff, poly_set_deg, poly_set_to_zero(), poly_shiftmod(), poly_sqmod(), and poly_sqmod_init().
Referenced by keypair().

Definition at line 448 of file poly.c.
References gf_add, gf_div, gf_mul, gf_unit, poly_alloc(), poly_coeff, poly_deg, and poly_set_coeff.
Referenced by keypair().
