public final class ChaChaCore extends Object
Modifier and Type | Method | Description |
---|---|---|
static void |
hash(int[] output,
int[] input) |
Hashes an input block with ChaCha20.
|
static void |
initIV(int[] output,
long iv) |
Initializes the 64-bit initialization vector in a ChaCha20 block.
|
static void |
initIV(int[] output,
long iv,
long counter) |
Initializes the 64-bit initialization vector and counter in a ChaCha20 block.
|
static void |
initKey256(int[] output,
byte[] key,
int offset) |
Initializes a ChaCha20 block with a 256-bit key.
|
public static void hash(int[] output, int[] input)
output
- The output block, which must contain at least 16
elements and must not overlap with the input.input
- The input block, which must contain at least 16
elements.public static void initKey256(int[] output, byte[] key, int offset)
output
- The output block, which must consist of at
least 16 words.key
- The buffer containing the key.offset
- Offset of the key in the buffer.public static void initIV(int[] output, long iv)
output
- The output block, which must consist of at
least 16 words and must have been initialized by initKey256()
or initKey128().iv
- The 64-bit initialization vector value.
The counter portion of the output block is set to zero.public static void initIV(int[] output, long iv, long counter)
output
- The output block, which must consist of at
least 16 words and must have been initialized by initKey256()
or initKey128().iv
- The 64-bit initialization vector value.counter
- The 64-bit counter value.