HFE
Class Multi4Mul

java.lang.Object
  |
  +--HFE.Multi4Mul

class Multi4Mul
extends java.lang.Object

This class deals with multi-variable polynomials and a general modulus provied to the constructor. Basicly, this class calculates multiples of two polynomials and one polynomial and one element of (F_4)^3. All calculations are done in F_4 (Field4) Every entry is a polynomial of the form f_i(x1,x2,...) = g^i*(b_0 + b_1*x_1 + b_2*x_2 + ... + b_n*x_n) The reduction is done in the variable g.

Version:
0.1

Field Summary
private  Poly4Max[] reduce
          Stores all the reduction steps.
 
Constructor Summary
(package private) Multi4Mul(Poly4Max modulus)
          Initializes the internal field reduce
 
Method Summary
static void main(java.lang.String[] args)
          Calls the testIt() method
 Poly4MultiLinear[] mul(int[] con, Poly4MultiLinear[] poly)
          Computes res = con * poly in terms of vector multiplication of polynomials.
 Poly4MultiSquare[] mul(int[] con, Poly4MultiLinear[] a, Poly4MultiLinear[] b)
          Computes res = con * a * b in terms of vector multiplication of polynomials.
 Poly4MultiSquare[] mul(Poly4MultiLinear[] a, Poly4MultiLinear[] b)
          Computes res = a * b in terms of vector multiplication of polynomials.
 Poly4MultiSquare[] mul2(int[] con, Poly4MultiLinear[] a, Poly4MultiLinear[] b)
          Computes res = con * a * b in terms of vector multiplication of polynomials.
 Poly4MultiSquare[] mul2(Poly4MultiLinear[] a, Poly4MultiLinear[] b)
          Computes res = a * b in terms of vector multiplication of polynomials.
static void testIt()
          Tests the functionality of the class.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

reduce

private Poly4Max[] reduce
Stores all the reduction steps. reduce[0] tells how to reduce the first polynomial, reduce[1] who to reduce the second polynomial, ...
Constructor Detail

Multi4Mul

Multi4Mul(Poly4Max modulus)
Initializes the internal field reduce
Parameters:
modulus - polynomial over F_4 for reduction the number of variables must be 3 for our purpose
Method Detail

mul

public Poly4MultiSquare[] mul(Poly4MultiLinear[] a,
                              Poly4MultiLinear[] b)
Computes res = a * b in terms of vector multiplication of polynomials. Uses reduce to take the modulus into account.

mul

public Poly4MultiSquare[] mul(int[] con,
                              Poly4MultiLinear[] a,
                              Poly4MultiLinear[] b)
Computes res = con * a * b in terms of vector multiplication of polynomials. Uses reduce to take the modulus into account.
Parameters:
con - constants as a vector, i.e. a vector of polynomials of degree 0 or -1
a - linear polynomial in dimension variables
b - linear polynimial in dimension variables

mul

public Poly4MultiLinear[] mul(int[] con,
                              Poly4MultiLinear[] poly)
Computes res = con * poly in terms of vector multiplication of polynomials. Uses reduce to take the modulus into account.
Parameters:
con - constants as a vector, i.e. a vector of polynomials of degree 0 or -1
poly - linear polynomial in dimension variables

mul2

public Poly4MultiSquare[] mul2(Poly4MultiLinear[] a,
                               Poly4MultiLinear[] b)
Computes res = a * b in terms of vector multiplication of polynomials. Uses reduce to take the modulus into account. This is an independent implementation to mul(Poly4MultiLinear[], Poly4MultiLinear[]) and regarded to be slower.

mul2

public Poly4MultiSquare[] mul2(int[] con,
                               Poly4MultiLinear[] a,
                               Poly4MultiLinear[] b)
Computes res = con * a * b in terms of vector multiplication of polynomials. Uses reduce to take the modulus into account. This is an independent implementation to mul(int[], Poly4MultiLinear[], Poly4MultiLinear[]) and regarded to be slower.

testIt

public static void testIt()
Tests the functionality of the class. Is called by the main method.

main

public static void main(java.lang.String[] args)
Calls the testIt() method