de.flexiprovider.common.math.pmiplus
Class MQSystemGF2

java.lang.Object
  |
  +--de.flexiprovider.common.math.pmiplus.MQSystemGF2

public class MQSystemGF2
extends java.lang.Object

This class describes some operations with set of polynomials over finite field GF(2) and is used in PMIPlus (also has some specific methods and implementation)

For the matrix representation the array of type int[][] is used, thus one element of the array keeps 32 elements of the matrix (from one row and 32 columns)

Author:
Elena Klintsevich

Constructor Summary
MQSystemGF2()
          create 1 polynomial in GF(2)[]
MQSystemGF2(int n, int m)
          create m polynomials in GF(2)[x_1,...,x_n]
MQSystemGF2(int n, int m, int[][] p)
          create the set of polynomials with coefficients from array p
 
Method Summary
 MQSystemGF2 addPolynomials(MQSystemGF2 mqs)
          compute {f1+g1,..., fm+gm}, where {fi} is this system and {gi} is given
 MQSystemGF2 compositionWithLinMapL(int[] vector, GF2Matrix mtr)
          compute F(MX+V), where M is an nxk-matrix over GF(2) V is an n-vector of constants, and F is this systems, i.e., replace old variables by affine-linear combinations of new ones.
 MQSystemGF2 compositionWithLinMapR(int[] vector, GF2Matrix mtr)
          compute MF+V, where M is an kxm-matrix over GF(2) V is an k-vector of constants, and F is this systems.
 void createRndMQS(int n, int m)
          The method creates random set of m quadratic polynomial in n variable
 void createRndMQS(int n, int m, SecureRandom sr)
          The method creates random set of m quadratic polynomial in n variable
 void createSystemFromXd(GF2nPolynomialField field, int d)
          Compute the quadratic polynomial system over GF(2) describing the map of GF(2^n) to GF(2^n) f: X ---> X^(1+2^d), where d is given.
 int[] findValueOnPointX(byte[] point)
          compute [f1(a1,...,an),...,fm(a1,...,an)], where {f_i} is this system, and A = (a1,...,an) is a point in GF(2)^n
 int getM()
           
 int getN()
           
 int[][] getPoly()
           
 void show()
          print the set of polynomials
 MQSystemGF2 twoSystemsToOne(MQSystemGF2 mqs)
          return new system {f1,...,fm,g1,...,gk}, where {fi} is this system and {gi} is given
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MQSystemGF2

public MQSystemGF2()
create 1 polynomial in GF(2)[]

MQSystemGF2

public MQSystemGF2(int n,
                   int m)
create m polynomials in GF(2)[x_1,...,x_n]

MQSystemGF2

public MQSystemGF2(int n,
                   int m,
                   int[][] p)
create the set of polynomials with coefficients from array p
Method Detail

getN

public final int getN()
Returns:
the number of variable

getM

public final int getM()
Returns:
the number of polynomials

getPoly

public final int[][] getPoly()
Returns:
the MQ polynomial system

createRndMQS

public final void createRndMQS(int n,
                               int m)
The method creates random set of m quadratic polynomial in n variable
Parameters:
n - - the number of variable
m - - the number of polynomials

createRndMQS

public final void createRndMQS(int n,
                               int m,
                               SecureRandom sr)
The method creates random set of m quadratic polynomial in n variable
Parameters:
n - - the number of variable
m - - the number of polynomials
sr - - PRNG

findValueOnPointX

public final int[] findValueOnPointX(byte[] point)
compute [f1(a1,...,an),...,fm(a1,...,an)], where {f_i} is this system, and A = (a1,...,an) is a point in GF(2)^n
Parameters:
point - bytes representation of A
Returns:
int representation of the value of this system on point A

compositionWithLinMapL

public final MQSystemGF2 compositionWithLinMapL(int[] vector,
                                                GF2Matrix mtr)
compute F(MX+V), where M is an nxk-matrix over GF(2) V is an n-vector of constants, and F is this systems, i.e., replace old variables by affine-linear combinations of new ones. result is a new system of n polynomial
Parameters:
vector -  
mtr - matrix over GF2
Returns:
new polynomial system

compositionWithLinMapR

public final MQSystemGF2 compositionWithLinMapR(int[] vector,
                                                GF2Matrix mtr)
compute MF+V, where M is an kxm-matrix over GF(2) V is an k-vector of constants, and F is this systems. result is a new system of k polynomial
Parameters:
vector -  
mtr - matrix over GF2
Returns:
new polynomial system

createSystemFromXd

public final void createSystemFromXd(GF2nPolynomialField field,
                                     int d)
Compute the quadratic polynomial system over GF(2) describing the map of GF(2^n) to GF(2^n) f: X ---> X^(1+2^d), where d is given. Finally this polynomial system is replaced by result.
Parameters:
field - finite field GF(2^n)
d - non-negative integer

addPolynomials

public final MQSystemGF2 addPolynomials(MQSystemGF2 mqs)
compute {f1+g1,..., fm+gm}, where {fi} is this system and {gi} is given
Parameters:
mqs - is system of polynomials {gi}
Returns:
new system {f_i+g_i}

twoSystemsToOne

public final MQSystemGF2 twoSystemsToOne(MQSystemGF2 mqs)
return new system {f1,...,fm,g1,...,gk}, where {fi} is this system and {gi} is given
Parameters:
mqs - system of polynomials {gi}
Returns:
new system {f_i, g_j}

show

public final void show()
print the set of polynomials