Table of Contents

Interface TlsAeadCipherImpl

Namespace
Org.BouncyCastle.Tls.Crypto.Impl
Assembly
BouncyCastle.Cryptography.dll

Base interface for services supporting AEAD encryption/decryption.

public interface TlsAeadCipherImpl

Methods

DoFinal(byte[], byte[], int, int, byte[], int)

Perform the cipher encryption/decryption returning the output in output.

int DoFinal(byte[] additionalData, byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset)

Parameters

additionalData byte[]

any additional data to be included in the MAC calculation.

input byte[]

array holding input data to the cipher.

inputOffset int

offset into input array data starts at.

inputLength int

length of the input data in the array.

output byte[]

array to hold the cipher output.

outputOffset int

offset into output array to start saving output.

Returns

int

the amount of data written to output.

Remarks

Note: we have to use DoFinal() here as it is the only way to guarantee output from the underlying cipher.

Exceptions

IOException

in case of failure.

DoFinal(byte[], int, int, byte[], int)

Perform the cipher encryption/decryption returning the output in output.

int DoFinal(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset)

Parameters

input byte[]

array holding input data to the cipher.

inputOffset int

offset into input array data starts at.

inputLength int

length of the input data in the array.

output byte[]

array to hold the cipher output.

outputOffset int

offset into output array to start saving output.

Returns

int

the amount of data written to output.

Remarks

Note: we have to use DoFinal() here as it is the only way to guarantee output from the underlying cipher.

Exceptions

IOException

in case of failure.

GetOutputSize(int)

Return the maximum size of the output for input of inputLength bytes.

int GetOutputSize(int inputLength)

Parameters

inputLength int

the length (in bytes) of the proposed input.

Returns

int

the maximum size of the output.

Init(byte[], int, byte[])

Initialise the parameters for the AEAD operator.

void Init(byte[] nonce, int macSize, byte[] additionalData)

Parameters

nonce byte[]

the nonce.

macSize int

MAC size in bytes.

additionalData byte[]

any additional data to be included in the MAC calculation.

Exceptions

IOException

if the parameters are inappropriate.

Reset()

void Reset()

SetKey(byte[], int, int)

Set the key to be used by the AEAD cipher implementation supporting this service.

void SetKey(byte[] key, int keyOff, int keyLen)

Parameters

key byte[]

array holding the AEAD cipher key.

keyOff int

offset into the array the key starts at.

keyLen int

length of the key in the array.

Exceptions

IOException

SetKey(ReadOnlySpan<byte>)

void SetKey(ReadOnlySpan<byte> key)

Parameters

key ReadOnlySpan<byte>