public class GMSSUtil
extends java.lang.Object
| Constructor and Description |
|---|
GMSSUtil() |
| Modifier and Type | Method and Description |
|---|---|
int |
bytesToIntLittleEndian(byte[] bytes)
Converts a byte array beginning at
offset into a 32 bit
integer (little-endian representation) |
int |
bytesToIntLittleEndian(byte[] bytes,
int offset)
Converts a byte array beginning at
offset 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 array
|
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. |
byte[] |
intToBytesLittleEndian(int value)
Converts a 32 bit integer into a byte array beginning at
offset (little-endian representation) |
void |
printArray(java.lang.String text,
byte[] array)
This method prints the values of a 1-dimensional byte array
|
void |
printArray(java.lang.String text,
byte[][] array)
This method prints the values of a 2-dimensional byte array
|
boolean |
testPowerOfTwo(int testValue)
This method tests if an integer is a power of 2.
|
public byte[] intToBytesLittleEndian(int value)
offset (little-endian representation)value - the integer to convertpublic int bytesToIntLittleEndian(byte[] bytes)
offset into a 32 bit
integer (little-endian representation)bytes - the byte arraypublic int bytesToIntLittleEndian(byte[] bytes,
int offset)
offset into a 32 bit
integer (little-endian representation)bytes - the byte arrayoffset - the integer offset into the byte arraypublic byte[] concatenateArray(byte[][] arraycp)
arraycp - a 2-dimensional byte array.public void printArray(java.lang.String text,
byte[][] array)
text - a Stringarray - a 2-dimensional byte arraypublic void printArray(java.lang.String text,
byte[] array)
text - a Stringarray - a 1-dimensional byte array.public boolean testPowerOfTwo(int testValue)
testValue - an integerTRUE if testValue is a power of 2,
FALSE otherwisepublic int getLog(int intValue)
intValue.intValue - an integerintValue