GF2nField, GF2nElement
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private int | mBit
holds the value of mDeg % MAXLONG. |
| private static final long[] | |
| private static final int[] | |
| private int | mLength
holds the length of the polynomial with 64 bit sized fields. |
| private static final long[] | |
| private long[] | mPol
holds this element in ONB representation. |
| Access | Constructor and Description |
|---|---|
| public | GF2nONBElement(GF2nONBField
the field gf2n, SecureRandom the source of randomness rand)Construct a random element over the field gf2n, using the specified source of randomness. |
| public | GF2nONBElement(GF2nONBField
the field gf2n, byte[] the encoded element e)Construct a new GF2nONBElement from its encoding. |
| public | GF2nONBElement(GF2nONBField
the field gf2n, BigInteger the value represented by a BigInteger val)Construct the element of the field gf2n with the specified value val. |
| private | GF2nONBElement(GF2nONBField
the field gf2n, long[] the value in ONB representation val)Construct the element of the field gf2n with the specified value val. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public GFElement | Returns: this + other (newly created)the addend addend)Implements org. Compute the sum of this element and addend. |
| public void | addToThis(GFElement
the addend addend)Implements org. Compute this + addend (overwrite this). |
| private void | |
| private void | |
| private void | |
| pack-priv void | assignOne()
Implements abstract org. assigns to this element the one element |
| pack-priv void | assignZero()
Implements abstract org. assigns to this element the zero element |
| public Object | Returns: a copy of this elementImplements abstract org. Implements org. Create a new GF2nONBElement by cloning this GF2nPolynomialElement. |
| public boolean | Returns: true if the two objects are equal, false otherwisethe other object other)Overrides java. Implements org. Compare this element with another object. |
| private long[] | |
| private long[] | Returns: this element in its representation and reverse bit-orderReturns the ONB representation of this element. |
| public int | Returns: the hash code of this elementOverrides java. Implements org. Returns a hash code value for this object. |
| public GF2nElement | Returns: this + 1Implements abstract org. returns this element + 1. |
| public void | increaseThis()
Implements abstract org. increases this element. |
| public GFElement | Returns: this-1 (newly created)Implements org. Compute the multiplicative inverse of this element. |
| public void | |
| public boolean | Returns: true if this is the one elementImplements org. Checks whether this element is one. |
| public boolean | Returns: true if this is the zero elementImplements org. Checks whether this element is zero. |
| public GFElement | Returns: this * factor (newly created)the factor factor)Implements org. Compute the product of this element and factor. |
| public void | multiplyThisBy(GFElement
the factor factor)Implements org. Compute this * factor (overwrite this). |
| public static GF2nONBElement | Returns: the one element in the given finite fieldthe finite field gf2n)Create the one element. |
| pack-priv void | |
| public GF2nElement | Returns: z with z2 + z = thisImplements abstract org. Solves a quadratic equation. |
| public GF2nElement | Returns: this2Implements abstract org. returns this element to the power of 2. |
| public GF2nElement | Returns: this1/2Implements abstract org. returns the root ofthis element. |
| public void | squareRootThis()
Implements abstract org. square roots this element. |
| public void | squareThis()
Implements abstract org. squares this element. |
| pack-priv boolean | Returns: true if the indexed bit of mPol is set, false otherwise.the index of the bit to test index)Implements abstract org. Checks whether the indexed bit of the bit representation is set. |
| public boolean | Returns: true, if the highest bit of mPol is set, false, otherwiseImplements abstract org. Returns whether the highest bit of the bit representation is set |
| public byte[] | Returns: this element as byte arrayImplements org. Returns this element as byte array. |
| public BigInteger | Returns: this element as BigIntegerImplements org. Returns this element as FlexiBigInt. |
| public String | Returns: String representation of this element with the specified radixOverrides java. Implements org. Returns a String representation of this element. |
| public String | Returns: String representation of this element with the specified radixspecifies the radix of the String representation radix)Implements org. Returns a String representation of this element. |
| public int | Returns: the trace of this elementImplements abstract org. Returns the trace of this element. |
| public static GF2nONBElement | Returns: the zero element in the given finite fieldthe finite field gf2n)Create the zero element. |
| MAXLONG | back to summary |
|---|---|
| private static final int MAXLONG | |
| mBit | back to summary |
|---|---|
| private int mBit holds the value of mDeg % MAXLONG. | |
| mBitmask | back to summary |
|---|---|
| private static final long[] mBitmask | |
| mIBY64 | back to summary |
|---|---|
| private static final int[] mIBY64 | |
| mLength | back to summary |
|---|---|
| private int mLength holds the length of the polynomial with 64 bit sized fields. | |
| mMaxmask | back to summary |
|---|---|
| private static final long[] mMaxmask | |
| mPol | back to summary |
|---|---|
| private long[] mPol holds this element in ONB representation. | |
| GF2nONBElement | back to summary |
|---|---|
| public GF2nONBElement(GF2nONBField gf2n, SecureRandom rand) Construct a random element over the field gf2n, using the specified source of randomness.
| |
| GF2nONBElement | back to summary |
|---|---|
| public GF2nONBElement(GF2nONBField gf2n, byte[] e) Construct a new GF2nONBElement from its encoding.
| |
| GF2nONBElement | back to summary |
|---|---|
| public GF2nONBElement(GF2nONBField gf2n, BigInteger val) Construct the element of the field gf2n with the specified value val.
| |
| GF2nONBElement | back to summary |
|---|---|
| private GF2nONBElement(GF2nONBField gf2n, long[] val) Construct the element of the field gf2n with the specified value val.
| |
| GF2nONBElement | back to summary |
|---|---|
| public GF2nONBElement(GF2nONBElement gf2n) Copy constructor.
| |
| add | back to summary |
|---|---|
| public GFElement add(GFElement addend) throws RuntimeException Implements org. Compute the sum of this element and addend. | |
| addToThis | back to summary |
|---|---|
| public void addToThis(GFElement addend) throws RuntimeException Implements org. Compute this + addend (overwrite this).
| |
| assign | back to summary |
|---|---|
| private void assign(BigInteger val) assigns to this element the value val.
| |
| assign | back to summary |
|---|---|
| private void assign(long[] val) assigns to this element the value val.
| |
| assign | back to summary |
|---|---|
| private void assign(byte[] val) assigns to this element the value val. First: inverting the order of val into reversed[]. That means: reversed[0] = val[length - 1], ..., reversed[reversed.length - 1] = val[0]. Second: mPol[0] = sum{i = 0, ... 7} (val[i]<<(i*8)) .... mPol[1] = sum{i = 8, ... 15} (val[i]<<(i*8))
| |
| assignOne | back to summary |
|---|---|
| pack-priv void assignOne() Implements abstract org. assigns to this element the one element | |
| assignZero | back to summary |
|---|---|
| pack-priv void assignZero() Implements abstract org. assigns to this element the zero element | |
| clone | back to summary |
|---|---|
| public Object clone() Implements abstract org. Implements org. Create a new GF2nONBElement by cloning this GF2nPolynomialElement.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements org. Compare this element with another object.
| |
| getElement | back to summary |
|---|---|
private long[] getElement()
| |
| getElementReverseOrder | back to summary |
|---|---|
| private long[] getElementReverseOrder() Returns the ONB representation of this element. The Bit-Order is exchanged (according to 1363)!
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements org. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| increase | back to summary |
|---|---|
| public GF2nElement increase() Implements abstract org. returns this element + 1.
| |
| increaseThis | back to summary |
|---|---|
| public void increaseThis() Implements abstract org. increases this element. | |
| invert | back to summary |
|---|---|
| public GFElement invert() throws ArithmeticException Implements org. Compute the multiplicative inverse of this element.
| |
| invertThis | back to summary |
|---|---|
| public void invertThis() throws ArithmeticException Multiplicatively invert of this element (overwrite this).
| |
| isOne | back to summary |
|---|---|
| public boolean isOne() Implements org. Checks whether this element is one.
| |
| isZero | back to summary |
|---|---|
| public boolean isZero() Implements org. Checks whether this element is zero.
| |
| multiply | back to summary |
|---|---|
| public GFElement multiply(GFElement factor) throws RuntimeException Implements org. Compute the product of this element and factor. | |
| multiplyThisBy | back to summary |
|---|---|
| public void multiplyThisBy(GFElement factor) throws RuntimeException Implements org. Compute this * factor (overwrite this).
| |
| ONE | back to summary |
|---|---|
| public static GF2nONBElement ONE(GF2nONBField gf2n) Create the one element.
| |
| reverseOrder | back to summary |
|---|---|
| pack-priv void reverseOrder() Reverses the bit-order in this element(according to 1363). This is a hack! | |
| solveQuadraticEquation | back to summary |
|---|---|
| public GF2nElement solveQuadraticEquation() throws RuntimeException Implements abstract org. Solves a quadratic equation.
| |
| square | back to summary |
|---|---|
| public GF2nElement square() Implements abstract org. returns this element to the power of 2.
| |
| squareRoot | back to summary |
|---|---|
| public GF2nElement squareRoot() Implements abstract org. returns the root ofthis element.
| |
| squareRootThis | back to summary |
|---|---|
| public void squareRootThis() Implements abstract org. square roots this element. | |
| squareThis | back to summary |
|---|---|
| public void squareThis() Implements abstract org. squares this element. | |
| testBit | back to summary |
|---|---|
| pack-priv boolean testBit(int index) Implements abstract org. Checks whether the indexed bit of the bit representation is set. Warning GF2nONBElement currently stores its bits in reverse order (compared to 1363) !!!
| |
| testRightmostBit | back to summary |
|---|---|
| public boolean testRightmostBit() Implements abstract org. Returns whether the highest bit of the bit representation is set
| |
| toByteArray | back to summary |
|---|---|
| public byte[] toByteArray() Implements org. Returns this element as byte array. The conversion is P1363-conform.
| |
| toFlexiBigInt | back to summary |
|---|---|
| public BigInteger toFlexiBigInt() Implements org. Returns this element as FlexiBigInt. The conversion is P1363-conform.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements org. Returns a String representation of this element.
| |
| toString | back to summary |
|---|---|
| public String toString(int radix) Implements org. Returns a String representation of this element. radix
specifies the radix of the String representation. Note ONLY radix = 2 or radix = 16 IS IMPLEMENTED
| |
| trace | back to summary |
|---|---|
| public int trace() Implements abstract org. Returns the trace of this element.
| |
| ZERO | back to summary |
|---|---|
| public static GF2nONBElement ZERO(GF2nONBField gf2n) Create the zero element.
| |