Table of Contents

Namespace Kdf108

Classes

EcDomain

The domain parameters of an approved NIST curve. Obtain one with Named(EcCurve).

EcEphemeralKeyPair

An ephemeral ECC key pair.

EcEphemeralPublicKey

An ephemeral ECC public key, validated on import.

EcKeyAgreement

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

EcKeyPair<TPublicKey>

An ECC key pair. See EcStaticKeyPair and EcEphemeralKeyPair.

EcPublicKey

A validated ECC public key. See EcStaticPublicKey and EcEphemeralPublicKey.

EcSchemes

The SP 800-56A Rev. 3 ECC key-agreement schemes. FfcSchemes has the same methods for finite fields. Each returns the shared secret Z, which you must pass through an SP 800-56C KDF (Sp80056C) before use, then clear. For dependency injection and logging, use IEcKeyAgreement.

EcStaticKeyPair

A static ECC key pair.

EcStaticPublicKey

A static ECC public key, validated on import.

Extraction

The randomness-extraction step of SP 800-56C Rev. 2 two-step key derivation (§5.1).

FfcDomain

Validated finite-field domain parameters: a named safe-prime group or FIPS 186-type parameters.

FfcDomainAssurance

How assurance of FIPS 186-type domain-parameter validity was obtained (SP 800-56A Rev. 3 §5.5.2).

FfcEphemeralKeyPair

An ephemeral FFC key pair.

FfcEphemeralPublicKey

An ephemeral FFC public key, validated on import.

FfcKeyAgreement

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

FfcKeyPair<TPublicKey>

An FFC key pair. See FfcStaticKeyPair and FfcEphemeralKeyPair.

FfcPublicKey

A validated FFC public key. See FfcStaticPublicKey and FfcEphemeralPublicKey.

FfcSchemes

The SP 800-56A Rev. 3 FFC key-agreement schemes, with the same methods as EcSchemes. Each returns the shared secret Z, which you must pass through an SP 800-56C KDF before use, then clear. For dependency injection and logging, use IFfcKeyAgreement.

FfcStaticKeyPair

A static FFC key pair.

FfcStaticPublicKey

A static FFC public key, validated on import.

InvalidKeyException

A key, key pair, or domain failed SP 800-56A validation.

Kdf108Exception

The base class for every failure this library reports. Catch it to handle all of them.

Kdf108ServiceCollectionExtensions

Registers the Kdf108 services with a dependency-injection container.

KdfParameterException

A derivation parameter is outside what the standard allows (length, counter width, salt size, PRF pairing, and so on).

KeyAgreementException

Key agreement produced a value SP 800-56A forbids, such as the point at infinity or Z ∈ {0, 1, p - 1}.

KeyConfirmation

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

KeyConfirmationContext

The public inputs to key-confirmation MacData: who confirms, the identifiers, and the ephemeral data.

KeyConfirmationMac

The MAC used for key confirmation (SP 800-56A Rev. 3 §5.9): HMAC, AES-CMAC, or KMAC.

KeyConfirmationService

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

KeyExpansion

Describes one SP 800-108 expansion: the iteration mode, the fixed input data, and the counter layout. Use FixedInput(ReadOnlySpan<byte>, ReadOnlySpan<byte>, BitLength) for the conventional Label || 0x00 || Context || [L] fixed input. Instances are immutable.

OneStepFunction

The auxiliary function H for SP 800-56C Rev. 2 one-step key derivation (§4.1).

Prf

A pseudorandom function for SP 800-108 iterative key derivation: HMAC with an approved hash, or AES-CMAC.

Sp800108

Key derivation from a uniformly random key-derivation key, per NIST SP 800-108 Rev. 1.

Sp800108Kdf

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

Sp80056C

Key derivation from an SP 800-56A shared secret Z, per NIST SP 800-56C Rev. 2. Use the one-step method, or the two-step method (extract a key-derivation key, then expand it with SP 800-108).

Sp80056CKdf

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

Structs

BitLength

A positive length in bits. Every output, tag, and MAC length in this library is a BitLength.

SecurityStrength

A target security strength from SP 800-56A Rev. 3 and SP 800-57.

Interfaces

IEcKeyAgreement

SP 800-56A ECC key agreement as an injectable service. Mirrors EcSchemes; inject it, or construct EcKeyAgreement directly.

IFfcKeyAgreement

SP 800-56A FFC key agreement as an injectable service. Mirrors FfcSchemes; inject it, or construct FfcKeyAgreement directly.

IKeyConfirmation

SP 800-56A key confirmation as an injectable service. Mirrors KeyConfirmation; inject it, or construct KeyConfirmationService directly.

ISp800108Kdf

SP 800-108 key derivation as an injectable service. Mirrors Sp800108; inject it, or construct Sp800108Kdf directly.

ISp80056CKdf

SP 800-56C key derivation as an injectable service. Mirrors Sp80056C; inject it, or construct Sp80056CKdf directly.

Enums

CounterPosition

Where the counter [i] goes in counter mode.

EcCurve

The NIST curves approved for SP 800-56A ECC key agreement.

FfcSafePrimeGroup

Named safe-prime groups approved by SP 800-56A Rev. 3 Appendix D.

IterationCounterPosition

Where the counter [i] goes in feedback and double-pipeline mode, relative to the chaining value K(i-1) or A(i).

KdfMode

The three SP 800-108 iteration modes.

KeyConfirmationMode

Whether one party or both confirm the derived key.

KeyFailure

What failed when a key or domain was rejected.

KmacVariant

The two KMAC functions from SP 800-185.

NistHashAlgorithm

The approved hash functions used across SP 800-108, SP 800-56A, and SP 800-56C.

Party

A party in SP 800-56A: U is the initiator, V the responder.