Go to the source code of this file.
Defines | |
#define | gf_extd() gf_extension_degree |
#define | gf_card() gf_cardinality |
#define | gf_ord() gf_multiplicative_order |
#define | gf_unit() 1 |
#define | gf_zero() 0 |
#define | gf_add(x, y) ((x) ^ (y)) |
#define | gf_exp(i) gf_exp[i] |
#define | gf_log(x) gf_log[x] |
#define | _gf_modq_1(d) (((d) & gf_ord()) + ((d) >> gf_extd())) |
#define | gf_mul_fast(x, y) ((y) ? gf_exp[_gf_modq_1(gf_log[x] + gf_log[y])] : 0) |
#define | gf_mul(x, y) ((x) ? gf_mul_fast(x, y) : 0) |
#define | gf_square(x) ((x) ? gf_exp[_gf_modq_1(gf_log[x] << 1)] : 0) |
#define | gf_sqrt(x) ((x) ? gf_exp[_gf_modq_1(gf_log[x] << (gf_extd()-1))] : 0) |
#define | gf_div(x, y) ((x) ? gf_exp[_gf_modq_1(gf_log[x] - gf_log[y])] : 0) |
#define | gf_inv(x) gf_exp[gf_ord() - gf_log[x]] |
Typedefs | |
typedef unsigned short | gf_t |
Functions | |
int | gf_init (int extdeg) |
gf_t | gf_rand (int(*u8rnd)()) |
gf_t | gf_pow (gf_t x, int i) |
Variables | |
int | gf_extension_degree |
int | gf_cardinality |
int | gf_multiplicative_order |
gf_t * | gf_log |
gf_t * | gf_exp |
#define _gf_modq_1 | ( | d | ) | (((d) & gf_ord()) + ((d) >> gf_extd())) |
#define gf_add | ( | x, | |||
y | ) | ((x) ^ (y)) |
Definition at line 38 of file gf.h.
Referenced by poly_eval_aux(), poly_shiftmod(), and poly_syndrome_init().
#define gf_card | ( | ) | gf_cardinality |
Definition at line 55 of file gf.h.
Referenced by poly_eeaux(), poly_shiftmod(), poly_syndrome_init(), and roots_berl_aux().
Definition at line 39 of file gf.h.
Referenced by gf_init(), gf_init_exp(), gf_init_log(), gf_pow(), and roots_berl_aux().
#define gf_extd | ( | ) | gf_extension_degree |
Definition at line 32 of file gf.h.
Referenced by gf_init_exp(), gf_init_log(), gf_pow(), poly_degppf(), and poly_sqrtmod_init().
Definition at line 56 of file gf.h.
Referenced by decode(), key_genmat(), poly_quo(), and poly_rem().
#define gf_mul | ( | x, | |||
y | ) | ((x) ? gf_mul_fast(x, y) : 0) |
Definition at line 51 of file gf.h.
Referenced by key_genmat(), poly_eval_aux(), poly_mul(), poly_shiftmod(), poly_syndrome_init(), and roots_berl_aux().
Definition at line 50 of file gf.h.
Referenced by decode(), poly_eeaux(), poly_quo(), poly_rem(), and poly_sqmod().
#define gf_ord | ( | ) | gf_multiplicative_order |
Definition at line 34 of file gf.h.
Referenced by gf_init_exp(), gf_init_log(), gf_pow(), and gf_rand().
#define gf_unit | ( | ) | 1 |
Definition at line 36 of file gf.h.
Referenced by decode(), poly_degppf(), poly_eeaux(), poly_randgen_irred(), poly_sqmod_init(), poly_sqrtmod_init(), poly_syndrome_init(), and roots_berl().
#define gf_zero | ( | ) | 0 |
Definition at line 37 of file gf.h.
Referenced by decode(), poly_calcule_deg(), poly_eeaux(), poly_eval_aux(), poly_quo(), poly_rem(), and poly_sqmod().
int gf_init | ( | int | extdeg | ) |
Definition at line 83 of file gf.c.
References gf_cardinality, gf_exp, gf_extension_degree, gf_init_exp(), gf_init_log(), gf_log, gf_multiplicative_order, init_done, and MAX_EXT_DEG.
Referenced by decode(), and keypair().
gf_t gf_rand | ( | int(*)() | u8rnd | ) |
Definition at line 122 of file gf.c.
References gf_ord, and u8rnd().
Referenced by poly_randgen_irred().
int gf_cardinality |