Class GMSSUtil
- java.lang.Object
-
- org.bouncycastle.pqc.crypto.gmss.util.GMSSUtil
-
public class GMSSUtil extends java.lang.Object
This class provides several methods that are required by the GMSS classes.
-
-
Constructor Summary
Constructors Constructor Description GMSSUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
bytesToIntLittleEndian(byte[] bytes)
Converts a byte array beginning atoffset
into a 32 bit integer (little-endian representation)int
bytesToIntLittleEndian(byte[] bytes, int offset)
Converts a byte array beginning atoffset
into a 32 bit integer (little-endian representation)byte[]
concatenateArray(byte[][] arraycp)
This method concatenates a 2-dimensional byte array into a 1-dimensional byte arrayint
getLog(int intValue)
This method returns the least integer that is greater or equal to the logarithm to the base 2 of an integerintValue
.byte[]
intToBytesLittleEndian(int value)
Converts a 32 bit integer into a byte array beginning atoffset
(little-endian representation)void
printArray(java.lang.String text, byte[] array)
This method prints the values of a 1-dimensional byte arrayvoid
printArray(java.lang.String text, byte[][] array)
This method prints the values of a 2-dimensional byte arrayboolean
testPowerOfTwo(int testValue)
This method tests if an integer is a power of 2.
-
-
-
Method Detail
-
intToBytesLittleEndian
public byte[] intToBytesLittleEndian(int value)
Converts a 32 bit integer into a byte array beginning atoffset
(little-endian representation)- Parameters:
value
- the integer to convert
-
bytesToIntLittleEndian
public int bytesToIntLittleEndian(byte[] bytes)
Converts a byte array beginning atoffset
into a 32 bit integer (little-endian representation)- Parameters:
bytes
- the byte array- Returns:
- The resulting integer
-
bytesToIntLittleEndian
public int bytesToIntLittleEndian(byte[] bytes, int offset)
Converts a byte array beginning atoffset
into a 32 bit integer (little-endian representation)- Parameters:
bytes
- the byte arrayoffset
- the integer offset into the byte array- Returns:
- The resulting integer
-
concatenateArray
public byte[] concatenateArray(byte[][] arraycp)
This method concatenates a 2-dimensional byte array into a 1-dimensional byte array- Parameters:
arraycp
- a 2-dimensional byte array.- Returns:
- 1-dimensional byte array with concatenated input array
-
printArray
public void printArray(java.lang.String text, byte[][] array)
This method prints the values of a 2-dimensional byte array- Parameters:
text
- a Stringarray
- a 2-dimensional byte array
-
printArray
public void printArray(java.lang.String text, byte[] array)
This method prints the values of a 1-dimensional byte array- Parameters:
text
- a Stringarray
- a 1-dimensional byte array.
-
testPowerOfTwo
public boolean testPowerOfTwo(int testValue)
This method tests if an integer is a power of 2.- Parameters:
testValue
- an integer- Returns:
TRUE
iftestValue
is a power of 2,FALSE
otherwise
-
getLog
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 integerintValue
.- Parameters:
intValue
- an integer- Returns:
- The least integer greater or equal to the logarithm to the base 2
of
intValue
-
-