Table of Contents

Class Sp80056CKdf

Namespace
Kdf108
Assembly
Kdf108.dll

The logging implementation of ISp80056CKdf. Stateless and thread-safe.

public sealed class Sp80056CKdf : ISp80056CKdf
Inheritance
Sp80056CKdf
Implements
Inherited Members

Constructors

Sp80056CKdf(ILogger<Sp80056CKdf>?)

The logging implementation of ISp80056CKdf. Stateless and thread-safe.

public Sp80056CKdf(ILogger<Sp80056CKdf>? logger = null)

Parameters

logger ILogger<Sp80056CKdf>

Methods

Extract(ReadOnlySpan<byte>, Extraction, SecurityStrength)

The extraction step (§5.1): K_DK = MAC(salt, Z). Expand the result with Sp800108 using ExpansionPrf.

public byte[] Extract(ReadOnlySpan<byte> sharedSecret, Extraction extraction, SecurityStrength strength)

Parameters

sharedSecret ReadOnlySpan<byte>

Z.

extraction Extraction

HMAC or AES-CMAC extraction and its salt.

strength SecurityStrength

The target security strength, at least 112 bits.

Returns

byte[]

OneStep(ReadOnlySpan<byte>, OneStepFunction, ReadOnlySpan<byte>, BitLength, SecurityStrength)

One-step key derivation (§4): K(i) = H(counter || Z || FixedInfo).

public byte[] OneStep(ReadOnlySpan<byte> sharedSecret, OneStepFunction function, ReadOnlySpan<byte> fixedInfo, BitLength length, SecurityStrength strength)

Parameters

sharedSecret ReadOnlySpan<byte>

Z.

function OneStepFunction

The auxiliary function H.

fixedInfo ReadOnlySpan<byte>

FixedInfo, for example AlgorithmID || PartyUInfo || PartyVInfo.

length BitLength

The output length L.

strength SecurityStrength

The target security strength, at least 112 bits.

Returns

byte[]

TwoStep(ReadOnlySpan<byte>, Extraction, KeyExpansion, BitLength, SecurityStrength)

Two-step key derivation (§5): extracts a key-derivation key from Z, then expands it with SP 800-108 using the PRF the extraction requires. To derive several keys from one Z, call Extract(ReadOnlySpan<byte>, Extraction, SecurityStrength) once and Derive(ReadOnlySpan<byte>, Prf, KeyExpansion, BitLength) once per key with distinct fixed input.

public byte[] TwoStep(ReadOnlySpan<byte> sharedSecret, Extraction extraction, KeyExpansion expansion, BitLength length, SecurityStrength strength)

Parameters

sharedSecret ReadOnlySpan<byte>
extraction Extraction
expansion KeyExpansion
length BitLength
strength SecurityStrength

Returns

byte[]