gf.h File Reference

This graph shows which files directly or indirectly include this file:

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_tgf_log
gf_tgf_exp


Define Documentation

#define _gf_modq_1 (  )     (((d) & gf_ord()) + ((d) >> gf_extd()))

Definition at line 46 of file gf.h.

#define gf_add ( x,
 )     ((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 33 of file gf.h.

#define gf_div ( x,
 )     ((x) ? gf_exp[_gf_modq_1(gf_log[x] - gf_log[y])] : 0)

Definition at line 55 of file gf.h.

Referenced by poly_eeaux(), poly_shiftmod(), poly_syndrome_init(), and roots_berl_aux().

#define gf_exp (  )     gf_exp[i]

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().

#define gf_inv (  )     gf_exp[gf_ord() - gf_log[x]]

Definition at line 56 of file gf.h.

Referenced by decode(), key_genmat(), poly_quo(), and poly_rem().

#define gf_log (  )     gf_log[x]

Definition at line 40 of file gf.h.

Referenced by gf_init(), gf_init_log(), and gf_pow().

#define gf_mul ( x,
 )     ((x) ? gf_mul_fast(x, y) : 0)

#define gf_mul_fast ( x,
 )     ((y) ? gf_exp[_gf_modq_1(gf_log[x] + gf_log[y])] : 0)

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_sqrt (  )     ((x) ? gf_exp[_gf_modq_1(gf_log[x] << (gf_extd()-1))] : 0)

Definition at line 53 of file gf.h.

Referenced by decode().

#define gf_square (  )     ((x) ? gf_exp[_gf_modq_1(gf_log[x] << 1)] : 0)

Definition at line 52 of file gf.h.

Referenced by decode(), poly_sqmod(), and roots_berl_aux().

 
#define gf_unit (  )     1

 
#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().


Typedef Documentation

typedef unsigned short gf_t

Definition at line 24 of file gf.h.


Function Documentation

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().

Here is the call graph for this function:

gf_t gf_pow ( gf_t  x,
int  i 
)

Definition at line 105 of file gf.c.

References gf_exp, gf_extd, gf_log, and gf_ord.

gf_t gf_rand ( int(*)()  u8rnd  ) 

Definition at line 122 of file gf.c.

References gf_ord, and u8rnd().

Referenced by poly_randgen_irred().

Here is the call graph for this function:


Variable Documentation

Definition at line 26 of file gf.h.

Referenced by gf_init().

Definition at line 28 of file gf.h.

Definition at line 26 of file gf.h.

Referenced by gf_init().

Definition at line 27 of file gf.h.

Definition at line 26 of file gf.h.

Referenced by gf_init().


This work was partially suported by Europian Network of Excellence, ECRYPT; ECRYPT