org.bouncycastle.pqc.legacy.math.linearalgebra
Class GF2mVector
java.lang.Object
|
+--org.bouncycastle.pqc.legacy.math.linearalgebra.Vector
|
+--org.bouncycastle.pqc.legacy.math.linearalgebra.GF2mVector
- public class GF2mVector
- extends Vector
This class implements vectors over the finite field
GF(2 m) for small m (i.e.,
1<m<32). It extends the abstract class Vector
.
Fields inherited from class org.bouncycastle.pqc.legacy.math.linearalgebra.Vector |
length |
Constructor Summary |
GF2mVector(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(2 m) of the given
length and element array. |
GF2mVector(GF2mVector other)
Copy constructor. |
Methods inherited from class org.bouncycastle.pqc.legacy.math.linearalgebra.Vector |
getLength |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
GF2mVector
public GF2mVector(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)
- Parameters:
field
- finite fieldv
- array with elements of vector
GF2mVector
public GF2mVector(GF2mField field,
int[] vector)
- Create a new vector over GF(2 m) of the given
length and element array.
- Parameters:
field
- the finite field GF(2 m)vector
- the element array
GF2mVector
public GF2mVector(GF2mVector other)
- Copy constructor.
- Parameters:
other
- another GF2mVector
getField
public GF2mField getField()
- Returns:
- the finite field this vector is defined over
getIntArrayForm
public int[] getIntArrayForm()
- Returns:
- int[] form of this vector
getEncoded
public byte[] getEncoded()
- Overrides:
getEncoded
in class Vector
- 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).
- Overrides:
isZero
in class Vector
- Returns:
- whether this is the zero vector (i.e., all elements are zero)
add
public Vector add(Vector addend)
- Add another vector to this vector. Method is not yet implemented.
- Overrides:
add
in class Vector
- Parameters:
addend
- the other vector- Returns:
- this + addend
- Throws:
java.lang.ArithmeticException
- if the other vector is not defined over the same field as
this vector.
TODO: implement this method
multiply
public Vector multiply(Permutation p)
- Multiply this vector with a permutation.
- Overrides:
multiply
in class Vector
- Parameters:
p
- the permutation- Returns:
- this*p = p*this
equals
public boolean equals(java.lang.Object other)
- Compare this vector with another object.
- Overrides:
equals
in class Vector
- Parameters:
other
- the other object- Returns:
- the result of the comparison
hashCode
public int hashCode()
- Overrides:
hashCode
in class Vector
- Returns:
- the hash code of this vector
toString
public java.lang.String toString()
- Overrides:
toString
in class Vector
- Returns:
- a human readable form of this vector