java.lang.Object
iu.crypt.EncodingUtils
Provides basic internal binary encoding behavior for JSON web crypto
algorithms.
-
Method Summary
Modifier and TypeMethodDescription(package private) static void
bigEndian
(int value, ByteBuffer buffer) Copies an 32-bit integer into aByteBuffer
(package private) static void
bigEndian
(long value, ByteBuffer buffer) Copies an 64-bit long into aByteBuffer
(package private) static byte[]
concatKdf
(int round, byte[] z, byte[] algid, byte[] uinfo, byte[] vinfo, int datalen) Gets the hash input data for one round of the NIST.800-56A Section 5.8.1 Concatenated Key Derivation Format (KDF)(package private) static void
concatKdfFragment
(byte[] data, ByteBuffer buffer) Encodes data in NIST.800-56A Concatenated Key Derivation Format (KDF).(package private) static byte[]
reverse
(byte[] bytes) Reverses byte order
-
Method Details
-
bigEndian
Copies an 32-bit integer into aByteBuffer
- Parameters:
value
- integer to encodebuffer
-ByteBuffer
-
bigEndian
Copies an 64-bit long into aByteBuffer
- Parameters:
value
- integer to encodebuffer
-ByteBuffer
-
concatKdfFragment
Encodes data in NIST.800-56A Concatenated Key Derivation Format (KDF).- Parameters:
data
- data to encodebuffer
-ByteBuffer
-
concatKdf
static byte[] concatKdf(int round, byte[] z, byte[] algid, byte[] uinfo, byte[] vinfo, int datalen) Gets the hash input data for one round of the NIST.800-56A Section 5.8.1 Concatenated Key Derivation Format (KDF)- Parameters:
round
- round numberz
- key derivation outputalgid
- algorithm IDuinfo
- party UInfo valuevinfo
- party VInfo valuedatalen
- data length- Returns:
- Concat KDF hash input
-
reverse
static byte[] reverse(byte[] bytes) Reverses byte order- Parameters:
bytes
- big-endian data (or vice-versa)- Returns:
- little-endian data (or vice-versa)
-