HFE
Class Transform4

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

class Transform4
extends java.lang.Object

Transform4 provides a affine transformation (i.e. S,T in terms of HFE), i.e. computes y = M*x + m where M and m are the affine transformation and x/y are input/output. All elements in the underlaying matrix and vector are taken from Field4.

Version:
0.1

Field Summary
private  LUDecomposition4 lu
          holds the LU decomposition of matrix M for the reverse affine transformation.
private  int[] m
          holds the vector m for the affine transformation.
private  Matrix4 M
          holds the bijective matrix M for the affine transformation.
private static int rowCol
          the number of rows and columns, which is taken from the field extension.
 
Constructor Summary
Transform4()
          Generates a affine transformation which is the identity, i.e.
Transform4(java.util.Random rnd)
          Generates a affine transformation using a PRNG
 
Method Summary
 Poly4MultiLinear[] getTransform()
          returns the transformation in terms of polynomials
static void main(java.lang.String[] args)
          Calls the testIt() method
static void testIt()
          Tests the functionality of the class.
 void transform(int[] vec, int[] res)
          applies the transformation to a given vector, i.e.
 Poly4MultiSquare[] transform(Poly4MultiSquare[] in)
          Applies the transformation to a given vector of polynomials, i.e.
(package private)  void untransform(int[] vec, int[] res)
          reverts the transformation to a given vector, i.e.
 void writeString()
          Writes the current transformation to stdout
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

M

private Matrix4 M
holds the bijective matrix M for the affine transformation.

lu

private LUDecomposition4 lu
holds the LU decomposition of matrix M for the reverse affine transformation.

m

private int[] m
holds the vector m for the affine transformation.

rowCol

private static int rowCol
the number of rows and columns, which is taken from the field extension.
Constructor Detail

Transform4

public Transform4()
Generates a affine transformation which is the identity, i.e. M = I and m = 0.

Transform4

public Transform4(java.util.Random rnd)
Generates a affine transformation using a PRNG
Parameters:
rnd - Random number generator for generating the transformation
Method Detail

transform

public void transform(int[] vec,
                      int[] res)
applies the transformation to a given vector, i.e. res = M*v^T + m
Parameters:
vec - vector which should be transformed using this
res - vector under this transformation

transform

public Poly4MultiSquare[] transform(Poly4MultiSquare[] in)
Applies the transformation to a given vector of polynomials, i.e. res = M*in + m.
Parameters:
in - vector which should be transformed using this
Returns:
A vector of polynomials

untransform

void untransform(int[] vec,
                 int[] res)
reverts the transformation to a given vector, i.e. computes res in vec = M*res^T + m
Parameters:
vec - vector which should be untransformed using this - is changed in this method
res - vector under this transformation

getTransform

public Poly4MultiLinear[] getTransform()
returns the transformation in terms of polynomials

writeString

public void writeString()
Writes the current transformation to stdout

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