Table of Contents

Interface TlsBlockCipherImpl

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

Interface for block cipher services.

public interface TlsBlockCipherImpl

Methods

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.

GetBlockSize()

Return the blocksize (in bytes) of the underlying block cipher.

int GetBlockSize()

Returns

int

the cipher's blocksize.

Init(byte[], int, int)

Initialise the parameters for operator.

void Init(byte[] iv, int ivOff, int ivLen)

Parameters

iv byte[]

array holding the initialization vector (IV).

ivOff int

offset into the array the IV starts at.

ivLen int

length of the IV in the array.

Exceptions

IOException

if the parameters are inappropriate.

Init(ReadOnlySpan<byte>)

void Init(ReadOnlySpan<byte> iv)

Parameters

iv ReadOnlySpan<byte>

SetKey(byte[], int, int)

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

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

Parameters

key byte[]

array holding the block 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>