keyGen static method
Using the ChaCha20 block, a 64 character hexadecimal string is created. This will then serve as the key for the tag creation.
Implementation
static String keyGen(String key, String nonce) {
String block =
chacha20block(stringHexToListHex(key), 0, stringHexToListHex(nonce))
.toRadixString(16);
return block.substring(0, 64);
}