|
Bouncy Castle Cryptography 1.50 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bouncycastle.pqc.crypto.rainbow.util.ComputeInField
public class ComputeInField
This class offers different operations on matrices in field GF2^8.
Implemented are functions: - finding inverse of a matrix - solving linear equation systems using the Gauss-Elimination method - basic operations like matrix multiplication, addition and so on.
| Constructor Summary | |
|---|---|
ComputeInField()
Constructor with no parameters |
|
| Method Summary | |
|---|---|
short[][] |
addSquareMatrix(short[][] matrix1,
short[][] matrix2)
Adds the n x n matrices matrix1 and matrix2 |
short[] |
addVect(short[] vector1,
short[] vector2)
Addition of two vectors |
short[][] |
inverse(short[][] coef)
This function computes the inverse of a given matrix using the Gauss- Elimination method. |
short[] |
multiplyMatrix(short[][] M1,
short[] m)
This function multiplies a given matrix with a one-dimensional array. |
short[][] |
multiplyMatrix(short[][] M1,
short[][] M2)
This function multiplies two given matrices. |
short[][] |
multMatrix(short scalar,
short[][] matrix)
Multiplies matrix with scalar |
short[] |
multVect(short scalar,
short[] vector)
Multiplies vector with scalar |
short[][] |
multVects(short[] vector1,
short[] vector2)
Multiplication of column vector with row vector |
short[] |
solveEquation(short[][] B,
short[] b)
This function finds a solution of the equation Bx = b. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComputeInField()
| Method Detail |
|---|
public short[] solveEquation(short[][] B,
short[] b)
B - this matrix is the left part of the
equation (B in the equation above)b - the right part of the equation
(b in the equation above)
java.lang.RuntimeException - if LES is not solvablepublic short[][] inverse(short[][] coef)
coef - the matrix which inverse matrix is needed
java.lang.RuntimeException - if the given matrix is not invertible
public short[][] multiplyMatrix(short[][] M1,
short[][] M2)
throws java.lang.RuntimeException
M1 - -the 1st matrixM2 - -the 2nd matrix
java.lang.RuntimeException - in case the given matrices cannot be multiplied
due to different dimensions.
public short[] multiplyMatrix(short[][] M1,
short[] m)
throws java.lang.RuntimeException
M1 - the matrix to be multipliedm - the one-dimensional array to be multiplied
java.lang.RuntimeException - in case of dimension inconsistency
public short[] addVect(short[] vector1,
short[] vector2)
vector1 - first summand, always of dim nvector2 - second summand, always of dim n
java.lang.RuntimeException - in case the addition is impossible
due to inconsistency in the dimensions
public short[][] multVects(short[] vector1,
short[] vector2)
vector1 - column vector, always n x 1vector2 - row vector, always 1 x n
java.lang.RuntimeException - in case the multiplication is impossible due to
inconsistency in the dimensions
public short[] multVect(short scalar,
short[] vector)
scalar - galois element to multiply vector withvector - vector to be multiplied
public short[][] multMatrix(short scalar,
short[][] matrix)
scalar - galois element to multiply matrix withmatrix - 2-dim n x n matrix to be multiplied
public short[][] addSquareMatrix(short[][] matrix1,
short[][] matrix2)
matrix1 - first summandmatrix2 - second summand
java.lang.RuntimeException - in case the addition is not possible because of
different dimensions of the matrices
|
Bouncy Castle Cryptography 1.50 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||