Class OneStepFunction
- Namespace
- Kdf108
- Assembly
- Kdf108.dll
The auxiliary function H for SP 800-56C Rev. 2 one-step key derivation (ยง4.1).
public sealed class OneStepFunction
- Inheritance
-
OneStepFunction
- Inherited Members
Properties
Hash
The hash for options 1 and 2, or null for KMAC.
public NistHashAlgorithm? Hash { get; }
Property Value
IsHmac
true for option 2, HMAC.
public bool IsHmac { get; }
Property Value
Kmac
The KMAC variant for option 3, or null.
public KmacVariant? Kmac { get; }
Property Value
Methods
HashFunction(NistHashAlgorithm)
Option 1: H(x) = hash(x).
public static OneStepFunction HashFunction(NistHashAlgorithm hash)
Parameters
hashNistHashAlgorithm
Returns
Hmac(NistHashAlgorithm, ReadOnlySpan<byte>)
Option 2: H(x) = HMAC-hash(salt, x). An empty salt means the default: a block of zero bytes.
public static OneStepFunction Hmac(NistHashAlgorithm hash, ReadOnlySpan<byte> salt = default)
Parameters
hashNistHashAlgorithmsaltReadOnlySpan<byte>
Returns
KmacFunction(KmacVariant, ReadOnlySpan<byte>)
Option 3: H(x) = KMAC(salt, x, L, "KDF"). An empty salt means the default: 164 zero bytes for KMAC128 or 132 for KMAC256. L must be a whole number of bytes.
public static OneStepFunction KmacFunction(KmacVariant variant, ReadOnlySpan<byte> salt = default)
Parameters
variantKmacVariantsaltReadOnlySpan<byte>
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.