public class AEADUtils extends java.lang.Object implements AEADAlgorithmTags
EAX, GCM, OCB
Modifier and Type | Method and Description |
---|---|
static int |
getAuthTagLength(int aeadAlgorithmTag)
Return the length of the authentication tag used by the given AEAD algorithm in octets.
|
static int |
getIVLength(int aeadAlgorithmTag)
Return the length of the IV used by the given AEAD algorithm in octets.
|
static byte[][] |
splitMessageKeyAndIv(byte[] messageKeyAndIv,
int cipherAlgo,
int aeadAlgo)
Split a given byte array containing
|
public static int getIVLength(int aeadAlgorithmTag)
aeadAlgorithmTag
- AEAD algorithm identifierpublic static int getAuthTagLength(int aeadAlgorithmTag)
aeadAlgorithmTag
- AEAD algorithm identifierpublic static byte[][] splitMessageKeyAndIv(byte[] messageKeyAndIv, int cipherAlgo, int aeadAlgo)
mbytes of key and
n-8bytes of IV into two separate byte arrays.
mis the key length of the cipher algorithm, while
nis the IV length of the AEAD algorithm. Note, that the IV is filled with
n-8bytes only, the remainder is left as 0s. Return an array of both arrays with the key and index 0 and the IV at index 1.
messageKeyAndIv
- m+n-8bytes of concatenated message key and IV
cipherAlgo
- symmetric cipher algorithmaeadAlgo
- AEAD algorithm