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

pack-priv Class RainbowUtil

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.Digest, org.bouncycastle.util.Arrays

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
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static short[][]
cloneArray(short[][] toCopy)

public static short[][][]
cloneArray(short[][][] toCopy)

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 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 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.

public static short[][][]
generate_random(SecureRandom sr, int dim_batch, int dim_row, int dim_col, boolean triangular)

public static short[][]
generate_random_2d(SecureRandom sr, int dim_row, int dim_col)

public static byte[]
getEncoded(short[][] a)

public static byte[]
getEncoded(short[][][] a, boolean triangular)

public static byte[]
hash(Digest hashAlgo, byte[] partA, byte[] partB, byte[] result)

public static byte[]
hash(Digest hashAlgo, byte[] msg, int hash_length)

public static int
loadEncoded(short[][] a, byte[] enc, int off)

public static int
loadEncoded(short[][][] a, byte[] enc, int off, boolean triangular)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RainbowUtilback to summary
pack-priv RainbowUtil()

Method Detail

cloneArrayback to summary
public static short[][] cloneArray(short[][] toCopy)
cloneArrayback to summary
public static short[][][] cloneArray(short[][][] toCopy)
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 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

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

generate_randomback to summary
public static short[][][] generate_random(SecureRandom sr, int dim_batch, int dim_row, int dim_col, boolean triangular)
generate_random_2dback to summary
public static short[][] generate_random_2d(SecureRandom sr, int dim_row, int dim_col)
getEncodedback to summary
public static byte[] getEncoded(short[][] a)
getEncodedback to summary
public static byte[] getEncoded(short[][][] a, boolean triangular)
hashback to summary
public static byte[] hash(Digest hashAlgo, byte[] partA, byte[] partB, byte[] result)
hashback to summary
public static byte[] hash(Digest hashAlgo, byte[] msg, int hash_length)
loadEncodedback to summary
public static int loadEncoded(short[][] a, byte[] enc, int off)
loadEncodedback to summary
public static int loadEncoded(short[][][] a, byte[] enc, int off, boolean triangular)