Class HMac
- Namespace
- Org.BouncyCastle.Crypto.Macs
- Assembly
- BouncyCastle.Cryptography.dll
public class HMac : IMac
- Inheritance
-
HMac
- Implements
- Inherited Members
Constructors
HMac(IDigest)
public HMac(IDigest digest)
Parameters
digestIDigest
HMac(IDigest, int)
public HMac(IDigest digest, int blockLength)
Parameters
Properties
AlgorithmName
The algorithm name.
public virtual string AlgorithmName { get; }
Property Value
Methods
BlockUpdate(byte[], int, int)
Update the MAC with a block of bytes.
public virtual void BlockUpdate(byte[] input, int inOff, int len)
Parameters
inputbyte[]the byte array containing the data.
inOffintthe offset into the byte array where the data starts.
lenint
BlockUpdate(ReadOnlySpan<byte>)
Update the MAC with a span of bytes.
public virtual void BlockUpdate(ReadOnlySpan<byte> input)
Parameters
inputReadOnlySpan<byte>the span containing the data.
DoFinal(byte[], int)
Perform final calculations, producing the result MAC.
public virtual int DoFinal(byte[] output, int outOff)
Parameters
outputbyte[]the byte array the MAC is to be copied into.
outOffintthe offset into the byte array the MAC is to start at.
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 virtual 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 virtual int GetMacSize()
Returns
- int
the size, in bytes, of the MAC produced by this implementation.
GetUnderlyingDigest()
public virtual IDigest GetUnderlyingDigest()
Returns
Init(ICipherParameters)
Initialise the MAC.
public virtual void Init(ICipherParameters parameters)
Parameters
parametersICipherParametersThe key or other data required by the MAC.
Reset()
public virtual void Reset()
Update(byte)
Update the MAC with a single byte.
public virtual void Update(byte input)
Parameters
inputbytethe input byte to be entered.