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

public Class GMSSUtil

extends Object
Class Inheritance

This class provides several methods that are required by the GMSS classes.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The resulting integer
bytesToIntLittleEndian
(byte[]
the byte array
bytes
)

Converts a byte array beginning at offset into a 32 bit integer (little-endian representation)

public int

Returns:

The resulting integer
bytesToIntLittleEndian
(byte[]
the byte array
bytes
,
int
the integer offset into the byte array
offset
)

Converts a byte array beginning at offset into a 32 bit integer (little-endian representation)

public byte[]

Returns:

1-dimensional byte array with concatenated input array
concatenateArray
(byte[][]
a 2-dimensional byte array.
arraycp
)

This method concatenates a 2-dimensional byte array into a 1-dimensional byte array

public int

Returns:

The least integer greater or equal to the logarithm to the base 2 of intValue
getLog
(int
an integer
intValue
)

This method returns the least integer that is greater or equal to the logarithm to the base 2 of an integer intValue.

public byte[]
intToBytesLittleEndian(int
the integer to convert
value
)

Converts a 32 bit integer into a byte array beginning at offset (little-endian representation)

public void
printArray(String
a String
text
,
byte[][]
a 2-dimensional byte array
array
)

This method prints the values of a 2-dimensional byte array

public void
printArray(String
a String
text
,
byte[]
a 1-dimensional byte array.
array
)

This method prints the values of a 1-dimensional byte array

public boolean

Returns:

TRUE if testValue is a power of 2, FALSE otherwise
testPowerOfTwo
(int
an integer
testValue
)

This method tests if an integer is a power of 2.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

GMSSUtilback to summary
public GMSSUtil()

Method Detail

bytesToIntLittleEndianback to summary
public int bytesToIntLittleEndian(byte[] bytes)

Converts a byte array beginning at offset into a 32 bit integer (little-endian representation)

Parameters
bytes:byte[]

the byte array

Returns:int

The resulting integer

bytesToIntLittleEndianback to summary
public int bytesToIntLittleEndian(byte[] bytes, int offset)

Converts a byte array beginning at offset into a 32 bit integer (little-endian representation)

Parameters
bytes:byte[]

the byte array

offset:int

the integer offset into the byte array

Returns:int

The resulting integer

concatenateArrayback to summary
public byte[] concatenateArray(byte[][] arraycp)

This method concatenates a 2-dimensional byte array into a 1-dimensional byte array

Parameters
arraycp:byte[][]

a 2-dimensional byte array.

Returns:byte[]

1-dimensional byte array with concatenated input array

getLogback to summary
public int getLog(int intValue)

This method returns the least integer that is greater or equal to the logarithm to the base 2 of an integer intValue.

Parameters
intValue:int

an integer

Returns:int

The least integer greater or equal to the logarithm to the base 2 of intValue

intToBytesLittleEndianback to summary
public byte[] intToBytesLittleEndian(int value)

Converts a 32 bit integer into a byte array beginning at offset (little-endian representation)

Parameters
value:int

the integer to convert

printArrayback to summary
public void printArray(String text, byte[][] array)

This method prints the values of a 2-dimensional byte array

Parameters
text:String

a String

array:byte[][]

a 2-dimensional byte array

printArrayback to summary
public void printArray(String text, byte[] array)

This method prints the values of a 1-dimensional byte array

Parameters
text:String

a String

array:byte[]

a 1-dimensional byte array.

testPowerOfTwoback to summary
public boolean testPowerOfTwo(int testValue)

This method tests if an integer is a power of 2.

Parameters
testValue:int

an integer

Returns:boolean

TRUE if testValue is a power of 2, FALSE otherwise