Top Description Constructors Methods
org.bouncycastle.pqc.legacy.crypto.rainbow.util

public Class RainbowUtil

extends Object
Class Inheritance

This class is needed for the conversions while encoding and decoding, as well as for comparison between arrays of some dimensions

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static short[]

Returns:

out one-dimensional short-array that corresponds the input
convertArray
(byte[]
the array to be converted
in
)

This function converts an one-dimensional array of bytes into a one-dimensional array of type short

public static short[][]

Returns:

out short-matrix that corresponds the input
convertArray
(byte[][]
the matrix to be converted
in
)

This function converts a matrix of bytes into a matrix of type short

public static short[][][]

Returns:

out short-array that corresponds the input
convertArray
(byte[][][]
the array to be converted
in
)

This function converts a 3-dimensional array of bytes into a 3-dimensional array of type short

public static byte[]

Returns:

out the byte-array that corresponds the input
convertArray
(short[]
the array to be converted
in
)

This function converts an array of type short into an array of type byte

public static byte[][]

Returns:

out the byte-matrix that corresponds the input
convertArray
(short[][]
the matrix to be converted
in
)

This function converts a matrix of type short into a matrix of type byte

public static byte[][][]

Returns:

out the byte-array that corresponds the input
convertArray
(short[][][]
the array to be converted
in
)

This function converts a 3-dimensional array of type short into a 3-dimensional array of type byte

public static int[]

Returns:

out the one-dimensional int-array that corresponds the input
convertArraytoInt
(byte[]
the array to be converted
in
)

This function converts an one-dimensional array of bytes into a one-dimensional array of int

public static byte[]

Returns:

out the byte-array that corresponds the input
convertIntArray
(int[]
the array to be converted
in
)

This function converts an array of type int into an array of type byte

public static boolean

Returns:

the result of the comparison
equals
(short[]
the first short array
left
,
short[]
the second short array
right
)

Compare two short arrays.

public static boolean

Returns:

the result of the comparison
equals
(short[][]
the first short array
left
,
short[][]
the second short array
right
)

Compare two two-dimensional short arrays.

public static boolean

Returns:

the result of the comparison
equals
(short[][][]
the first short array
left
,
short[][][]
the second short array
right
)

Compare two three-dimensional short arrays.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RainbowUtilback to summary
public RainbowUtil()

Method Detail

convertArrayback to summary
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:byte[]

the array to be converted

Returns:short[]

out one-dimensional short-array that corresponds the input

convertArrayback to summary
public static short[][] convertArray(byte[][] in)

This function converts a matrix of bytes into a matrix of type short

Parameters
in:byte[][]

the matrix to be converted

Returns:short[][]

out short-matrix that corresponds the input

convertArrayback to summary
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:byte[][][]

the array to be converted

Returns:short[][][]

out short-array that corresponds the input

convertArrayback to summary
public static byte[] convertArray(short[] in)

This function converts an array of type short into an array of type byte

Parameters
in:short[]

the array to be converted

Returns:byte[]

out the byte-array that corresponds the input

convertArrayback to summary
public static byte[][] convertArray(short[][] in)

This function converts a matrix of type short into a matrix of type byte

Parameters
in:short[][]

the matrix to be converted

Returns:byte[][]

out the byte-matrix that corresponds the input

convertArrayback to summary
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:short[][][]

the array to be converted

Returns:byte[][][]

out the byte-array that corresponds the input

convertArraytoIntback to summary
public static int[] convertArraytoInt(byte[] in)

This function converts an one-dimensional array of bytes into a one-dimensional array of int

Parameters
in:byte[]

the array to be converted

Returns:int[]

out the one-dimensional int-array that corresponds the input

convertIntArrayback to summary
public static byte[] convertIntArray(int[] in)

This function converts an array of type int into an array of type byte

Parameters
in:int[]

the array to be converted

Returns:byte[]

out the byte-array that corresponds the input

equalsback to summary
public static boolean equals(short[] left, short[] right)

Compare two short arrays. No null checks are performed.

Parameters
left:short[]

the first short array

right:short[]

the second short array

Returns:boolean

the result of the comparison

equalsback to summary
public static boolean equals(short[][] left, short[][] right)

Compare two two-dimensional short arrays. No null checks are performed.

Parameters
left:short[][]

the first short array

right:short[][]

the second short array

Returns:boolean

the result of the comparison

equalsback to summary
public static boolean equals(short[][][] left, short[][][] right)

Compare two three-dimensional short arrays. No null checks are performed.

Parameters
left:short[][][]

the first short array

right:short[][][]

the second short array

Returns:boolean

the result of the comparison