Top Constructors Methods
org.bouncycastle.bcpg

public Class AEADUtils

extends Object
implements AEADAlgorithmTags
Class Inheritance
All Implemented Interfaces
org.bouncycastle.bcpg.AEADAlgorithmTags

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

length of the auth tag
getAuthTagLength
(int
AEAD algorithm identifier
aeadAlgorithmTag
)

Return the length of the authentication tag used by the given AEAD algorithm in octets.

public static int

Returns:

length of the IV
getIVLength
(int
AEAD algorithm identifier
aeadAlgorithmTag
)

Return the length of the IV used by the given AEAD algorithm in octets.

public static byte[][]

Returns:

array of arrays containing message key and IV
splitMessageKeyAndIv
(byte[]
m+n-8
bytes of concatenated message key and IV
messageKeyAndIv
,
int
symmetric cipher algorithm
cipherAlgo
,
int
AEAD algorithm
aeadAlgo
)

Split a given byte array containing

m
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AEADUtilsback to summary
private AEADUtils()

Method Detail

getAuthTagLengthback to summary
public static int getAuthTagLength(int aeadAlgorithmTag)

Return the length of the authentication tag used by the given AEAD algorithm in octets.

Parameters
aeadAlgorithmTag:int

AEAD algorithm identifier

Returns:int

length of the auth tag

getIVLengthback to summary
public static int getIVLength(int aeadAlgorithmTag)

Return the length of the IV used by the given AEAD algorithm in octets.

Parameters
aeadAlgorithmTag:int

AEAD algorithm identifier

Returns:int

length of the IV

splitMessageKeyAndIvback to summary
public static byte[][] splitMessageKeyAndIv(byte[] messageKeyAndIv, int cipherAlgo, int aeadAlgo)

Split a given byte array containing

m
bytes of key and
n-8
bytes of IV into two separate byte arrays.
m
is the key length of the cipher algorithm, while
n
is the IV length of the AEAD algorithm. Note, that the IV is filled with
n-8
bytes 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.
Parameters
messageKeyAndIv:byte[]
m+n-8
bytes of concatenated message key and IV
cipherAlgo:int

symmetric cipher algorithm

aeadAlgo:int

AEAD algorithm

Returns:byte[][]

array of arrays containing message key and IV