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
macKeyReadOnlySpan<byte>MacKey, taken from the start of the derived keying material.
contextKeyConfirmationContextThe MacData inputs.
macKeyConfirmationMacThe MAC function.
tagLengthBitLengthMacTagLen: at least 64 bits and at most the MAC output length.
strengthSecurityStrengthThe 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
receivedTagReadOnlySpan<byte>macKeyReadOnlySpan<byte>contextKeyConfirmationContextmacKeyConfirmationMactagLengthBitLengthstrengthSecurityStrength