Class KCtrBlockCipher
- Namespace
- Org.BouncyCastle.Crypto.Modes
- Assembly
- BouncyCastle.Cryptography.dll
public class KCtrBlockCipher : IStreamCipher, IBlockCipherMode, IBlockCipher
- Inheritance
-
KCtrBlockCipher
- Implements
- Inherited Members
Constructors
KCtrBlockCipher(IBlockCipher)
public KCtrBlockCipher(IBlockCipher cipher)
Parameters
cipherIBlockCipher
Properties
AlgorithmName
public string AlgorithmName { get; }
Property Value
IsPartialBlockOkay
Indicates whether this cipher mode can handle partial blocks.
public bool IsPartialBlockOkay { get; }
Property Value
UnderlyingCipher
public IBlockCipher UnderlyingCipher { get; }
Property Value
Methods
CalculateByte(byte)
protected byte CalculateByte(byte b)
Parameters
bbyte
Returns
GetBlockSize()
public int GetBlockSize()
Returns
Init(bool, ICipherParameters)
public void Init(bool forEncryption, ICipherParameters parameters)
Parameters
forEncryptionboolparametersICipherParameters
ProcessBlock(byte[], int, byte[], int)
public int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
Parameters
Returns
ProcessBlock(ReadOnlySpan<byte>, Span<byte>)
Process a block.
public int ProcessBlock(ReadOnlySpan<byte> input, Span<byte> output)
Parameters
inputReadOnlySpan<byte>The input block as a span.
outputSpan<byte>The output span.
Returns
- int
The number of bytes processed and produced.
Exceptions
- DataLengthException
If input block is wrong size, or output span too small.
ProcessBytes(byte[], int, int, byte[], int)
Process a block of bytes from input, putting the result into output.
public void ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff)
Parameters
inputbyte[]The input byte array.
inOffintThe offset into
inputwhere the data to be processed starts.lenintoutputbyte[]The output buffer the processed bytes go into.
outOffintThe offset into
outputthe processed data starts at.
Exceptions
- DataLengthException
If the input buffer is too small.
- OutputLengthException
If the output buffer is too small.
ProcessBytes(ReadOnlySpan<byte>, Span<byte>)
Process a block of bytes from input, putting the result into output.
public void ProcessBytes(ReadOnlySpan<byte> input, Span<byte> output)
Parameters
inputReadOnlySpan<byte>The input span.
outputSpan<byte>The output span.
Exceptions
- OutputLengthException
If the output span is too small.
Reset()
public void Reset()
ReturnByte(byte)
encrypt/decrypt a single byte returning the result.
public byte ReturnByte(byte input)
Parameters
inputbytethe byte to be processed.
Returns
- byte
the result of processing the input byte.