|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--HFE.Poly64Max
This class encapsulates the operations for polynomials
over the finite field F_64 which is an extension over
F_4. The generation polynomial is f(x) = x^3 + x^2 + 2x + 3
The polynomials are bounded by maxLen
.
Field Summary | |
(package private) static int |
extension
Basicly the degree of the generation polynomial de facto the dimension of the vector space which can be assigned to F_64 in terms of F_4. |
(package private) static Poly4Max |
genPoly
Generating Polynomial over Field4 . |
(package private) static int |
maxLen
Maximal length of the polynomials |
(package private) static Poly64Max |
mod_additive
|
(package private) static Poly64Max |
modulus
Modulus for the mod version of the operations |
(package private) int[] |
value
Current value of the polynomial. |
Constructor Summary | |
(package private) |
Poly64Max()
sets all the coefficients to zero |
(package private) |
Poly64Max(int initValue)
Creates a new polynomial. |
(package private) |
Poly64Max(int[] inArray)
array2poly(int[]) |
(package private) |
Poly64Max(Poly64Max father)
Creates a copy from the given polynomial |
(package private) |
Poly64Max(Poly64Max father,
int shift)
Takes one polynomial and shifts it by the given shift. |
(package private) |
Poly64Max(java.util.Random rnd)
Generates a polynomial with random coefficients. |
Method Summary | |
(package private) void |
add(Poly64Max whom)
calculate this += whom as polynomial addition |
(package private) void |
add(Poly64Max a,
Poly64Max b)
calculates this = wen1 + wen2 as polynomial addition |
(package private) void |
addMod(Poly64Max b)
|
(package private) void |
addMod(Poly64Max a,
Poly64Max b)
Computes this = (a+b)%modul. |
(package private) static int |
addNum(int ter1,
int ter2)
Adds two numbers using xor |
(package private) static int |
addNumByPoly(int ter1,
int ter2)
adds two numbers using Poly4Max as representation of the numbers. |
(package private) int |
applyPoly(int num)
Uses the given polynomial as a function. |
(package private) void |
array2poly(int[] inArray)
Sets the coefficients using the given coefficient / power array. |
(package private) void |
copyShift(Poly64Max father,
int shift)
Takes one polynomial and shifts it by the given shift. |
(package private) int |
degree()
Returns the degree of the object. |
(package private) static int |
divNum(int whom,
int by)
divides whom by the number by. |
(package private) void |
int2poly(int intValue)
Sets the coefficients according to intValue. |
(package private) boolean |
isBigger(Poly64Max whom)
Compares the current polynomial with the given one. |
(package private) boolean |
isEqual(Poly64Max whom)
Compares the current polynomial with the given one. |
(package private) static void |
isIrr(int poly)
Tests if a given polynomial (specified as a number, see int2poly(int) ) is irreducible. |
(package private) boolean |
isLess(Poly64Max whom)
Compares the current polynomial with the given one. |
(package private) boolean |
isZero()
Checks if a polynomial is the zero polynomial. |
static void |
main(java.lang.String[] args)
Mainly invoces the testIt() method. |
(package private) void |
mod()
Calculates this %= moduls. |
(package private) void |
mod(Poly64Max b)
Calculates this %= b |
(package private) void |
mod(Poly64Max a,
Poly64Max b)
Calculates this = a % b |
(package private) void |
mul(Poly64Max a,
Poly64Max b)
calculates this = a * b as polynomial addition. |
(package private) void |
mulFactor(int factor)
multiplies all coefficients by the given factor in F_64. |
(package private) void |
mulMod(Poly64Max a,
Poly64Max b)
Computes this = (this+b)%modul. |
(package private) static int |
mulNum(int fac1,
int fac2)
multiplies two numbers by looking up the result in the multiplication table which is provided by the class Field64_Tab |
(package private) static int |
mulNumByPoly(int fac1,
int fac2)
Multiplies two numbers using Poly4Max as representation of the numbers. |
(package private) static void |
plotFunction()
|
(package private) int |
polyInt()
Returns the polynomial as an integer. |
(package private) void |
pow(Poly64Max base,
int by)
calculates this = base^by. |
(package private) void |
powMod(Poly64Max base,
int by)
Computes this = (base^by)%modul. |
(package private) static int |
powNum(int num,
int by)
Computes (num^by) in F_64. |
(package private) static void |
rootBeta()
|
(package private) static void |
rootFunction()
|
(package private) static void |
setModulus(Poly64Max newModulus)
Sets the private field modulus. |
(package private) void |
setZero()
Sets all the coefficients to zero by allocating new memory |
(package private) static void |
testIt()
Tests the functionality for the whole class. |
(package private) static void |
writeDivTab()
Produce the division table by using mulNumByPoly and Field64_Tab.inverseTab . |
(package private) static void |
writeInverseTab()
Produce the table with the multiplicative inverses of every element by using mulNumByPoly. |
(package private) static void |
writeMulTab()
Produce the multiplication table by using mulNumByPoly. |
(package private) void |
writeString()
Writes the polynomial as a string to stdout |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final int maxLen
static final Poly4Max genPoly
Field4
.static final int extension
static Poly64Max modulus
int[] value
static Poly64Max mod_additive
Constructor Detail |
Poly64Max()
Poly64Max(int initValue)
int2poly(int)
Poly64Max(Poly64Max father)
Poly64Max(Poly64Max father, int shift)
Poly64Max(int[] inArray)
array2poly(int[])
Poly64Max(java.util.Random rnd)
Method Detail |
static void setModulus(Poly64Max newModulus)
int degree()
boolean isLess(Poly64Max whom)
boolean isBigger(Poly64Max whom)
boolean isEqual(Poly64Max whom)
boolean isZero()
void setZero()
void copyShift(Poly64Max father, int shift)
void int2poly(int intValue)
void array2poly(int[] inArray)
static int addNumByPoly(int ter1, int ter2)
static int addNum(int ter1, int ter2)
static int mulNumByPoly(int fac1, int fac2)
static void writeMulTab()
static int mulNum(int fac1, int fac2)
Field64_Tab
static void writeInverseTab()
static void writeDivTab()
Field64_Tab.inverseTab
.
The table is writen to
stdout as valid java statement and can be directed to a file.
zero is set to zero.static int divNum(int whom, int by)
Field64_Tab
.void mulFactor(int factor)
void add(Poly64Max a, Poly64Max b)
void add(Poly64Max whom)
void mul(Poly64Max a, Poly64Max b)
void pow(Poly64Max base, int by)
void mod()
void mod(Poly64Max a, Poly64Max b)
void mod(Poly64Max b)
void addMod(Poly64Max a, Poly64Max b)
void addMod(Poly64Max b)
void mulMod(Poly64Max a, Poly64Max b)
void powMod(Poly64Max base, int by)
static int powNum(int num, int by)
int applyPoly(int num)
void writeString()
int polyInt()
static void testIt()
static void plotFunction()
static void rootFunction()
static void rootBeta()
static void isIrr(int poly)
int2poly(int)
) is irreducible.
If so, prints it to stdout.public static void main(java.lang.String[] args)
testIt()
method.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |