Class RainbowUtil
- java.lang.Object
-
- org.bouncycastle.pqc.crypto.rainbow.util.RainbowUtil
-
public class RainbowUtil extends java.lang.ObjectThis class is needed for the conversions while encoding and decoding, as well as for comparison between arrays of some dimensions
-
-
Constructor Summary
Constructors Constructor Description RainbowUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static short[]convertArray(byte[] in)This function converts an one-dimensional array of bytes into a one-dimensional array of type shortstatic short[][]convertArray(byte[][] in)This function converts a matrix of bytes into a matrix of type shortstatic short[][][]convertArray(byte[][][] in)This function converts a 3-dimensional array of bytes into a 3-dimensional array of type shortstatic byte[]convertArray(short[] in)This function converts an array of type short into an array of type bytestatic byte[][]convertArray(short[][] in)This function converts a matrix of type short into a matrix of type bytestatic byte[][][]convertArray(short[][][] in)This function converts a 3-dimensional array of type short into a 3-dimensional array of type bytestatic int[]convertArraytoInt(byte[] in)This function converts an one-dimensional array of bytes into a one-dimensional array of intstatic byte[]convertIntArray(int[] in)This function converts an array of type int into an array of type bytestatic booleanequals(short[][][] left, short[][][] right)Compare two three-dimensional short arrays.static booleanequals(short[][] left, short[][] right)Compare two two-dimensional short arrays.static booleanequals(short[] left, short[] right)Compare two short arrays.
-
-
-
Method Detail
-
convertArraytoInt
public static int[] convertArraytoInt(byte[] in)
This function converts an one-dimensional array of bytes into a one-dimensional array of int- Parameters:
in- the array to be converted- Returns:
- out the one-dimensional int-array that corresponds the input
-
convertArray
public static short[] convertArray(byte[] in)
This function converts an one-dimensional array of bytes into a one-dimensional array of type short- Parameters:
in- the array to be converted- Returns:
- out one-dimensional short-array that corresponds the input
-
convertArray
public static short[][] convertArray(byte[][] in)
This function converts a matrix of bytes into a matrix of type short- Parameters:
in- the matrix to be converted- Returns:
- out short-matrix that corresponds the input
-
convertArray
public static short[][][] convertArray(byte[][][] in)
This function converts a 3-dimensional array of bytes into a 3-dimensional array of type short- Parameters:
in- the array to be converted- Returns:
- out short-array that corresponds the input
-
convertIntArray
public static byte[] convertIntArray(int[] in)
This function converts an array of type int into an array of type byte- Parameters:
in- the array to be converted- Returns:
- out the byte-array that corresponds the input
-
convertArray
public static byte[] convertArray(short[] in)
This function converts an array of type short into an array of type byte- Parameters:
in- the array to be converted- Returns:
- out the byte-array that corresponds the input
-
convertArray
public static byte[][] convertArray(short[][] in)
This function converts a matrix of type short into a matrix of type byte- Parameters:
in- the matrix to be converted- Returns:
- out the byte-matrix that corresponds the input
-
convertArray
public static byte[][][] convertArray(short[][][] in)
This function converts a 3-dimensional array of type short into a 3-dimensional array of type byte- Parameters:
in- the array to be converted- Returns:
- out the byte-array that corresponds the input
-
equals
public static boolean equals(short[] left, short[] right)Compare two short arrays. No null checks are performed.- Parameters:
left- the first short arrayright- the second short array- Returns:
- the result of the comparison
-
equals
public static boolean equals(short[][] left, short[][] right)Compare two two-dimensional short arrays. No null checks are performed.- Parameters:
left- the first short arrayright- the second short array- Returns:
- the result of the comparison
-
equals
public static boolean equals(short[][][] left, short[][][] right)Compare two three-dimensional short arrays. No null checks are performed.- Parameters:
left- the first short arrayright- the second short array- Returns:
- the result of the comparison
-
-