|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.flexiprovider.common.math.polynomials.GFP64Polynomial
An Element of this class represents a Polynomial within a GFP Ring Structure.
The Structure is defined by the modulo Function and the large "prime" p. This Class has methods for multiplying, adding and reducing Polynomials.
This Class has been developed mainly for the LMOTS Signature scheme, so the available methods may not be a complete Implementation of the methods that may be required or expected on Ring Arithmetic and some of the implemented Methods are intended only for use of the LMOTS Signature scheme. Such as the ability to create random Polynomials within this Ring Structure with a custom modulo limit or Multiplication of a Polynomial with a Vector of Polynomials.
| Constructor Summary | |
GFP64Polynomial(byte[] encoded)
Constructor for decoding a previously encoded GFPPolynomial using
the getEncoded() method |
|
GFP64Polynomial(long[] f,
long p,
long[] poly)
Standard Constructor for generating a new GFPPolynomial |
|
GFP64Polynomial(long[] f,
long p,
SecureRandom gen)
Special Constructor without a Polynomial parameter but with a Secure Random generator. |
|
| Method Summary | |
GFP64Polynomial |
add(GFP64Polynomial gfp)
adds the given Polynomial to this Polynomial and returns the result |
void |
addToThis(GFP64Polynomial gfp)
Adds the supplied Polynomial to this Polynomial and sets this Polynomial as the result |
boolean |
arrEqual(long[] arr1,
long[] arr2)
|
boolean |
equals(java.lang.Object obj)
|
GFP64Polynomial |
generatePoly()
Generates a random Polynomial, complying to the specification of this Ring |
GFP64Polynomial |
generatePoly(long limit)
Generates a random Polynomial with the specified limit, denoting the maximum Value of entries in this Polynomial. |
GFP64Polynomial |
generatePoly(long limit,
boolean negative)
|
long[] |
getCompressed()
Subtracts p from every entry in this polynomial with a value greater p/2. |
byte[] |
getEncoded()
|
long[] |
getF()
|
long |
getP()
|
long[] |
getPoly()
|
SecureRandom |
getRandomizer()
|
GFP64Polynomial |
multiply(GFP64Polynomial gfp)
multiplies the given Polynomial to this Polynomial and returns the Result |
java.util.Vector |
multiply(java.util.Vector k)
multiplies this Polynomial with a Vector of Polynomials and returns the Result |
void |
multiplyToThis(GFP64Polynomial gfp)
Multiplies the given Polynomial to this Polynomial and sets this Polynomial to the Result |
boolean |
paramEqual(GFP64Polynomial gfp)
|
void |
print()
|
GFP64Polynomial |
subtract(GFP64Polynomial gfp)
|
void |
subtractFromThis(GFP64Polynomial gfp)
|
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public GFP64Polynomial(byte[] encoded)
throws codec.asn1.ASN1Exception,
java.io.IOException
GFPPolynomial using
the getEncoded() methodencoded - the byte array containing the encoded GFPPolynomialjava.io.IOException - codec.asn1.ASN1Exception -
public GFP64Polynomial(long[] f,
long p,
long[] poly)
f - the modulo Polynomial of the Ringp - the modulo "prime" of the Ringpoly - the Polynomial an long array, most significant entry is right
public GFP64Polynomial(long[] f,
long p,
SecureRandom gen)
f - the modulo Polynomial of the Ringp - the modulo "prime" of the Ringgen - a predefined secure Random Number Generator| Method Detail |
public GFP64Polynomial add(GFP64Polynomial gfp)
gfp - the Polynomial to be addedpublic void addToThis(GFP64Polynomial gfp)
gfp - the Polynomial to be added
public boolean arrEqual(long[] arr1,
long[] arr2)
public long[] getCompressed()
This Function is used for calculating the correct Norm of a Polynomial, since the Norm uses the absolute Value for determining the Maximum
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic GFP64Polynomial generatePoly()
public GFP64Polynomial generatePoly(long limit)
limit - the limit to be used for modulo in the generated Polynomial.
Only used if the supplied number is lower than p, otherwise p
is used.
public GFP64Polynomial generatePoly(long limit,
boolean negative)
public byte[] getEncoded()
throws codec.asn1.ASN1Exception,
java.io.IOException
public long[] getF()
public long getP()
public long[] getPoly()
public SecureRandom getRandomizer()
public GFP64Polynomial multiply(GFP64Polynomial gfp)
gfp - the Polynomial to be multipliedpublic java.util.Vector multiply(java.util.Vector k)
Multiplication with a Vector is designed as follows:
Vector � = (a1, a2, ... , am), Polynomial p � * p = (a1*p, a2*p, ... , am * p)
k - the Vector of Polynomials to be multipliedpublic void multiplyToThis(GFP64Polynomial gfp)
gfp - the Polynomial to be multipliedpublic boolean paramEqual(GFP64Polynomial gfp)
public void print()
public GFP64Polynomial subtract(GFP64Polynomial gfp)
public void subtractFromThis(GFP64Polynomial gfp)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||