Table of Contents

Interface ICmacPrimitives

Namespace
Yubico.Core.Cryptography
Assembly
Yubico.Core.dll

An interface exposing AES-GCM primitive operations.

public interface ICmacPrimitives

Methods

CmacFinal(Span<byte>)

Complete the CMAC process, generating the result.

void CmacFinal(Span<byte> macBuffer)

Parameters

macBuffer Span<byte>

The Span into which the method will place the result.

Remarks

Call this with there is no more data to process. This method will fill the provided macBuffer with the resulting CMAC value. The Span must be the exact length of the result. To know the required output size, in bytes, use the CmacBlockCipherAlgorithm extension MacLength.

CmacInit(ReadOnlySpan<byte>)

Initialize the object to perform CMAC with the given key.

void CmacInit(ReadOnlySpan<byte> keyData)

Parameters

keyData ReadOnlySpan<byte>

The key to be used in the CMAC operations.

Remarks

The key length must match the algorithm specified at instantiation. To know the required key length, in bytes, use the CmacBlockCipherAlgorithm extension KeyLength.

CmacUpdate(ReadOnlySpan<byte>)

Continue the CMAC operation with the given input data.

void CmacUpdate(ReadOnlySpan<byte> dataToMac)

Parameters

dataToMac ReadOnlySpan<byte>

The next amount of data to process.

Remarks

Call this with the next amount of data that is to be processed. When there is no more data to process, call Final.