My Project
|
generate addition tables used by Factory to calculate in GF(q). More...
#include "config.h"
#include <iostream>
#include <fstream>
#include <strstream>
#include <string>
#include <stdlib.h>
#include "cf_assert.h"
#include "gf_tabutil.h"
#include "cf_algorithm.h"
#include "cf_iter.h"
Go to the source code of this file.
Functions | |
int | gf_tab_numdigits62 (int q) |
bool | isIrreducible (const CanonicalForm &f) |
bool isIrreducible ( const CanonicalForm & f ) More... | |
int | exponent (const CanonicalForm &f, int q) |
int exponent ( const CanonicalForm & f, int q ) More... | |
bool | findGenRec (int d, int n, int q, const CanonicalForm &m, const Variable &x, CanonicalForm &result) |
bool findGenRec ( int d, int n, int q, const CanonicalForm & m, const Variable & x, CanonicalForm & result ) More... | |
CanonicalForm | findGen (int d, int q) |
CanonicalForm findGen ( int d, int q ) More... | |
void | printTable (int d, int q, CanonicalForm mipo) |
void printTable ( int d, int q, CanonicalForm mipo ) More... | |
static CanonicalForm | findGenNew (int n, int q) |
The new function for getting the minimal polynomials. More... | |
int | main () |
Variables | |
const int | maxtable = 65536 |
constants. More... | |
const int | primes_len = 54 |
primes, primes_len: used to step through possible extensions More... | |
STATIC_VAR unsigned short | primes [] |
primes, primes_len: used to step through possible extensions More... | |
generate addition tables used by Factory to calculate in GF(q).
Definition in file gengftables-conway.cc.
int exponent | ( | const CanonicalForm & | f, |
int | q | ||
) |
int exponent ( const CanonicalForm & f, int q )
exponent() - return e > 0 such that x^e == 1 mod f.
q: upper limit for e (?)
Definition at line 93 of file gengftables-conway.cc.
CanonicalForm findGen | ( | int | d, |
int | q | ||
) |
CanonicalForm findGen ( int d, int q )
findGen() - find and return a generator of GF(q).
d: degree of extension q: the q in GF(q)
Definition at line 171 of file gengftables-conway.cc.
|
static |
The new function for getting the minimal polynomials.
It uses the Conway polynomials. It reads the polynomials from a file. The file contains all polynomials with p^k <= 2^16 but currently only polynomials with p^k <= 2^14 are used.
n | n is the exponent |
q | parameter q is not used. It is added to respect the old version |
Definition at line 290 of file gengftables-conway.cc.
bool findGenRec | ( | int | d, |
int | n, | ||
int | q, | ||
const CanonicalForm & | m, | ||
const Variable & | x, | ||
CanonicalForm & | result | ||
) |
bool findGenRec ( int d, int n, int q, const CanonicalForm & m, const Variable & x, CanonicalForm & result )
findGenRec() - find a generator of GF(q).
Returns true iff result is a valid generator.
d: degree of extension q: the q in GF(q) (q == p^d) x: generator should be a poly in x n, m: used to step recursively through all polys in FF(p) Initially, n == d and m == 0. If 0 <= n <= d we are in the process of building m, if n < 0 we built m and may test whether it generates GF(q). result: generator found
i: used to step through GF(p) p: current characteristic
Definition at line 125 of file gengftables-conway.cc.
int gf_tab_numdigits62 | ( | int | q | ) |
Definition at line 12 of file gf_tabutil.cc.
bool isIrreducible | ( | const CanonicalForm & | f | ) |
bool isIrreducible ( const CanonicalForm & f )
isIrreducible() - return true iff f is irreducible.
Definition at line 77 of file gengftables-conway.cc.
int main | ( | ) |
Definition at line 358 of file gengftables-conway.cc.
void printTable | ( | int | d, |
int | q, | ||
CanonicalForm | mipo | ||
) |
void printTable ( int d, int q, CanonicalForm mipo )
printTable - print +1 table of field GF(q).
d: degree of extension q: the q in GF(q) mipo: the minimal polynomial of the extension
p: current characteristic
Definition at line 197 of file gengftables-conway.cc.
const int maxtable = 65536 |
constants.
maxtable: maximal size of a gf_table
Definition at line 48 of file gengftables-conway.cc.
STATIC_VAR unsigned short primes[] |
primes, primes_len: used to step through possible extensions
Definition at line 60 of file gengftables-conway.cc.
const int primes_len = 54 |
primes, primes_len: used to step through possible extensions
Definition at line 54 of file gengftables-conway.cc.