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
inputbyte[]array holding input data to the cipher.
inputOffsetintoffset into input array data starts at.
inputLengthintlength of the input data in the array.
outputbyte[]array to hold the cipher output.
outputOffsetintoffset 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
ivbyte[]array holding the initialization vector (IV).
ivOffintoffset into the array the IV starts at.
ivLenintlength of the IV in the array.
Exceptions
- IOException
if the parameters are inappropriate.
Init(ReadOnlySpan<byte>)
void Init(ReadOnlySpan<byte> iv)
Parameters
ivReadOnlySpan<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
keybyte[]array holding the block cipher key.
keyOffintoffset into the array the key starts at.
keyLenintlength of the key in the array.
Exceptions
SetKey(ReadOnlySpan<byte>)
void SetKey(ReadOnlySpan<byte> key)
Parameters
keyReadOnlySpan<byte>