HFE
Class Transform2

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

class Transform2
extends java.lang.Object

Transform2 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 Field2.

Version:
0.15

Field Summary
private  LUDecomposition2 lu
          holds the LU decomposition of matrix M for the reverse affine transformation.
 int[] m
          holds the vector m for the affine transformation.
 Matrix2 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
Transform2()
          Generates a affine transformation which is the identity, i.e.
Transform2(java.util.Random rnd)
          Generates a affine transformation using a PRNG
 
Method Summary
 Poly2MultiLinear[] 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.
 Poly2MultiSquare[] transform(Poly2MultiSquare[] in)
          Applies the transformation to a given vector of polynomials, i.e.
 void transform(Poly2MultiSquare[] res, SquarePolyVec in)
          Applies the transformation to a given vector of polynomials, i.e.
 Poly2MultiSquare[] transform(SquarePolyVec 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

public Matrix2 M
holds the bijective matrix M for the affine transformation.

lu

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

m

public 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

Transform2

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

Transform2

public Transform2(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 Poly2MultiSquare[] transform(Poly2MultiSquare[] in)
Applies the transformation to a given vector of polynomials, i.e. res = M*in + m. Allocates new memory for the result.
Parameters:
in - vector which should be transformed using this
Returns:
A vector of polynomials

transform

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

transform

public void transform(Poly2MultiSquare[] res,
                      SquarePolyVec in)
Applies the transformation to a given vector of polynomials, i.e. res = M*in + m. Does not allocates new memory for the result.
Parameters:
res - result
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 Poly2MultiLinear[] 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