/** * constructs an instance of the finite field with 2<sup>deg</sup> * elements and characteristic 2. * * @param deg the degree of this field * @param file true if you want to read the field polynomial from the * file false if you want to use a random fielpolynomial * (this can take very long for huge degrees) */ public GF2nPolynomialField(int deg, boolean file) { if (deg < 3) { throw new IllegalArgumentException("k must be at least 3"); } mDegree = deg; if (file) { computeFieldPolynomial(); } else { computeFieldPolynomial2(); } computeSquaringMatrix(); fields = new Vector(); matrices = new Vector(); }
/** * Computes the field polynomial. This can take a long time for big degrees. */ protected void computeFieldPolynomial() { if (testTrinomials()) { return; } if (testPentanomials()) { return; } testRandom(); }
/** * constructs an instance of the finite field with 2<sup>deg</sup> * elements and characteristic 2. * * @param deg the extention degree of this field */ public GF2nPolynomialField(int deg) { if (deg < 3) { throw new IllegalArgumentException("k must be at least 3"); } mDegree = deg; computeFieldPolynomial(); computeSquaringMatrix(); fields = new Vector(); matrices = new Vector(); }
if (((GF2nPolynomialField)mField).isTrinomial()) try tc = ((GF2nPolynomialField)mField).getTc(); return; else if (((GF2nPolynomialField)mField).isPentanomial()) try pc = ((GF2nPolynomialField)mField).getPc();
/** * Create the zero element. * * @param f the finite field * @return the zero element in the given finite field */ public static GF2nPolynomialElement ZERO(GF2nPolynomialField f) { GF2Polynomial polynomial = new GF2Polynomial(f.getDegree()); return new GF2nPolynomialElement(f, polynomial); }
computeSquaringMatrix(); int k = 2; // check if the polynomial is a trinomial or pentanomial for (int j = 1; j < fieldPolynomial.getLength() - 1; j++)
B1.matrices.addElement(invertMatrix(COBMatrix));
if (((GF2nPolynomialField)mField).isTrinomial()) try tc = ((GF2nPolynomialField)mField).getTc(); return; else if (((GF2nPolynomialField)mField).isPentanomial()) try pc = ((GF2nPolynomialField)mField).getPc();
/** * constructs an instance of the finite field with 2<sup>deg</sup> * elements and characteristic 2. * * @param deg the extention degree of this field * @param random source of randomness for generating new polynomials. */ public GF2nPolynomialField(int deg, SecureRandom random) { super(random); if (deg < 3) { throw new IllegalArgumentException("k must be at least 3"); } mDegree = deg; computeFieldPolynomial(); computeSquaringMatrix(); fields = new Vector(); matrices = new Vector(); }
/** * Create the one element. * * @param f the finite field * @return the one element in the given finite field */ public static GF2nPolynomialElement ONE(GF2nPolynomialField f) { GF2Polynomial polynomial = new GF2Polynomial(f.getDegree(), new int[]{1}); return new GF2nPolynomialElement(f, polynomial); }
computeSquaringMatrix(); int k = 2; // check if the polynomial is a trinomial or pentanomial for (int j = 1; j < fieldPolynomial.getLength() - 1; j++)
B1.matrices.addElement(invertMatrix(COBMatrix));
/** * Computes the field polynomial. This can take a long time for big degrees. */ protected void computeFieldPolynomial() { if (testTrinomials()) { return; } if (testPentanomials()) { return; } testRandom(); }
/** * constructs an instance of the finite field with 2<sup>deg</sup> * elements and characteristic 2. * * @param deg the degree of this field * @param random source of randomness for generating new polynomials. * @param file true if you want to read the field polynomial from the * file false if you want to use a random fielpolynomial * (this can take very long for huge degrees) */ public GF2nPolynomialField(int deg, SecureRandom random, boolean file) { super(random); if (deg < 3) { throw new IllegalArgumentException("k must be at least 3"); } mDegree = deg; if (file) { computeFieldPolynomial(); } else { computeFieldPolynomial2(); } computeSquaringMatrix(); fields = new Vector(); matrices = new Vector(); }
/** * Create the zero element. * * @param f the finite field * @return the zero element in the given finite field */ public static GF2nPolynomialElement ZERO(GF2nPolynomialField f) { GF2Polynomial polynomial = new GF2Polynomial(f.getDegree()); return new GF2nPolynomialElement(f, polynomial); }
/** * Computes the field polynomial. This can take a long time for big degrees. */ protected void computeFieldPolynomial2() { if (testTrinomials()) { return; } if (testPentanomials()) { return; } testRandom(); }
/** * Create the one element. * * @param f the finite field * @return the one element in the given finite field */ public static GF2nPolynomialElement ONE(GF2nPolynomialField f) { GF2Polynomial polynomial = new GF2Polynomial(f.getDegree(), new int[]{1}); return new GF2nPolynomialElement(f, polynomial); }
/** * Computes the field polynomial. This can take a long time for big degrees. */ protected void computeFieldPolynomial2() { if (testTrinomials()) { return; } if (testPentanomials()) { return; } testRandom(); }