Table of Contents

Interface IMac

Namespace
Org.BouncyCastle.Crypto
Assembly
BouncyCastle.Cryptography.dll

The base interface for implementations of message authentication codes (MACs).

public interface IMac

Properties

AlgorithmName

The algorithm name.

string AlgorithmName { get; }

Property Value

string

Methods

BlockUpdate(byte[], int, int)

Update the MAC with a block of bytes.

void BlockUpdate(byte[] input, int inOff, int inLen)

Parameters

input byte[]

the byte array containing the data.

inOff int

the offset into the byte array where the data starts.

inLen int

the length of the data.

BlockUpdate(ReadOnlySpan<byte>)

Update the MAC with a span of bytes.

void BlockUpdate(ReadOnlySpan<byte> input)

Parameters

input ReadOnlySpan<byte>

the span containing the data.

DoFinal(byte[], int)

Perform final calculations, producing the result MAC.

int DoFinal(byte[] output, int outOff)

Parameters

output byte[]

the byte array the MAC is to be copied into.

outOff int

the 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.

int DoFinal(Span<byte> output)

Parameters

output Span<byte>

the span the MAC is to be copied into.

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.

int GetMacSize()

Returns

int

the size, in bytes, of the MAC produced by this implementation.

Init(ICipherParameters)

Initialise the MAC.

void Init(ICipherParameters parameters)

Parameters

parameters ICipherParameters

The key or other data required by the MAC.

Reset()

Reset the MAC back to its initial state.

void Reset()

Update(byte)

Update the MAC with a single byte.

void Update(byte input)

Parameters

input byte

the input byte to be entered.