Class GF2mVector
java.lang.Object
org.bouncycastle.pqc.legacy.math.linearalgebra.Vector
org.bouncycastle.pqc.legacy.math.linearalgebra.GF2mVector
This class implements vectors over the finite field
GF(2m) for small m (i.e.,
1<m<32). It extends the abstract class
Vector
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionGF2mVector
(GF2mField field, byte[] v) creates the vector over GF(2^m) of given length and with elements from array v (beginning at the first bit)GF2mVector
(GF2mField field, int[] vector) Create a new vector over GF(2m) of the given length and element array.GF2mVector
(GF2mVector other) Copy constructor. -
Method Summary
-
Constructor Details
-
GF2mVector
creates the vector over GF(2^m) of given length and with elements from array v (beginning at the first bit)- Parameters:
field
- finite fieldv
- array with elements of vector
-
GF2mVector
Create a new vector over GF(2m) of the given length and element array.- Parameters:
field
- the finite field GF(2m)vector
- the element array
-
GF2mVector
Copy constructor.- Parameters:
other
- anotherGF2mVector
-
-
Method Details
-
getField
- Returns:
- the finite field this vector is defined over
-
getIntArrayForm
public int[] getIntArrayForm()- Returns:
- int[] form of this vector
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncoded
in classVector
- Returns:
- a byte array encoding of this vector
-
isZero
public boolean isZero()Description copied from class:Vector
Return whether this is the zero vector (i.e., all elements are zero). -
add
Add another vector to this vector. Method is not yet implemented.- Specified by:
add
in classVector
- Parameters:
addend
- the other vector- Returns:
- this + addend
- Throws:
ArithmeticException
- if the other vector is not defined over the same field as this vector.TODO: implement this method
-
multiply
Multiply this vector with a permutation. -
equals
Compare this vector with another object. -
hashCode
public int hashCode() -
toString
-