Class EcbBlockCipher
- Namespace
- Org.BouncyCastle.Crypto.Modes
- Assembly
- BouncyCastle.Cryptography.dll
public class EcbBlockCipher : IBlockCipherMode, IBlockCipher
- Inheritance
-
EcbBlockCipher
- Implements
- Inherited Members
Constructors
EcbBlockCipher(IBlockCipher)
public EcbBlockCipher(IBlockCipher cipher)
Parameters
cipherIBlockCipher
Properties
AlgorithmName
The name of the algorithm this cipher implements.
public string AlgorithmName { get; }
Property Value
IsPartialBlockOkay
Indicates whether this cipher mode can handle partial blocks.
public bool IsPartialBlockOkay { get; }
Property Value
UnderlyingCipher
Return the
underlying this cipher mode.
public IBlockCipher UnderlyingCipher { get; }
Property Value
Methods
GetBlockSize()
public int GetBlockSize()
Returns
- int
The block size for this cipher, in bytes.
Init(bool, ICipherParameters)
Initialise the cipher.
public void Init(bool forEncryption, ICipherParameters parameters)
Parameters
forEncryptionboolInitialise for encryption if true, for decryption if false.
parametersICipherParametersThe key or other data required by the cipher.
ProcessBlock(byte[], int, byte[], int)
Process a block.
public int ProcessBlock(byte[] inBuf, int inOff, byte[] outBuf, int outOff)
Parameters
inBufbyte[]The input buffer.
inOffintThe offset into that the input block begins.
outBufbyte[]The output buffer.
outOffintThe offset into to write the output block.
Returns
- int
The number of bytes processed and produced.
Exceptions
- DataLengthException
If input block is wrong size, or outBuf too small.
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.
Reset()
Reset the cipher mode to the same state as it was after the last init (if there was one).
public void Reset()