Table of Contents

Class KeyConfirmation

Namespace
Kdf108
Assembly
Kdf108.dll

SP 800-56A Rev. 3 ยง5.9 key confirmation: MacTag = T_MacTagLen[MAC(MacKey, MacData)]. For dependency injection and logging, use IKeyConfirmation.

public static class KeyConfirmation
Inheritance
KeyConfirmation
Inherited Members

Methods

GenerateTag(ReadOnlySpan<byte>, KeyConfirmationContext, KeyConfirmationMac, BitLength, SecurityStrength)

Computes the tag for context.

public static byte[] GenerateTag(ReadOnlySpan<byte> macKey, KeyConfirmationContext context, KeyConfirmationMac mac, BitLength tagLength, SecurityStrength strength)

Parameters

macKey ReadOnlySpan<byte>

MacKey, taken from the start of the derived keying material.

context KeyConfirmationContext

The MacData inputs.

mac KeyConfirmationMac

The MAC function.

tagLength BitLength

MacTagLen: at least 64 bits and at most the MAC output length.

strength SecurityStrength

The target security strength; MacKey must be at least this long (Table 5).

Returns

byte[]

VerifyTag(ReadOnlySpan<byte>, ReadOnlySpan<byte>, KeyConfirmationContext, KeyConfirmationMac, BitLength, SecurityStrength)

Recomputes the tag and compares it with receivedTag in constant time.

public static bool VerifyTag(ReadOnlySpan<byte> receivedTag, ReadOnlySpan<byte> macKey, KeyConfirmationContext context, KeyConfirmationMac mac, BitLength tagLength, SecurityStrength strength)

Parameters

receivedTag ReadOnlySpan<byte>
macKey ReadOnlySpan<byte>
context KeyConfirmationContext
mac KeyConfirmationMac
tagLength BitLength
strength SecurityStrength

Returns

bool