Class CMac
- Namespace
- Org.BouncyCastle.Crypto.Macs
- Assembly
- BouncyCastle.Cryptography.dll
public class CMac : IMac
- Inheritance
-
CMac
- Implements
- Inherited Members
Constructors
CMac(IBlockCipher)
public CMac(IBlockCipher cipher)
Parameters
cipherIBlockCipher
CMac(IBlockCipher, int)
public CMac(IBlockCipher cipher, int macSizeInBits)
Parameters
cipherIBlockCiphermacSizeInBitsint
Properties
AlgorithmName
The algorithm name.
public string AlgorithmName { get; }
Property Value
Methods
BlockUpdate(byte[], int, int)
Update the MAC with a block of bytes.
public void BlockUpdate(byte[] inBytes, int inOff, int len)
Parameters
BlockUpdate(ReadOnlySpan<byte>)
Update the MAC with a span of bytes.
public void BlockUpdate(ReadOnlySpan<byte> input)
Parameters
inputReadOnlySpan<byte>the span containing the data.
DoFinal(byte[], int)
Perform final calculations, producing the result MAC.
public int DoFinal(byte[] outBytes, int outOff)
Parameters
Returns
- int
the number of bytes written
Remarks
This call leaves the MAC reset.
DoFinal(Span<byte>)
Perform final calculations, producing the result MAC.
public int DoFinal(Span<byte> output)
Parameters
Returns
- int
the number of bytes written
Remarks
This call leaves the MAC reset.
GetMacSize()
Return the size, in bytes, of the MAC produced by this implementation.
public int GetMacSize()
Returns
- int
the size, in bytes, of the MAC produced by this implementation.
Init(ICipherParameters)
Initialise the MAC.
public void Init(ICipherParameters parameters)
Parameters
parametersICipherParametersThe key or other data required by the MAC.
Reset()
public void Reset()
Update(byte)
Update the MAC with a single byte.
public void Update(byte input)
Parameters
inputbytethe input byte to be entered.