5[UnsupportedOSPlatform(
"browser")]
6public static class HKDF
15 byte[]
array =
new byte[num];
29 prk = prk.
Slice(0, num);
31 Extract(hashAlgorithmName, num, ikm, salt, prk);
46 if (outputLength <= 0)
52 if (outputLength <= 0 || outputLength > num2)
56 byte[]
array =
new byte[outputLength];
73 Expand(hashAlgorithmName, num, prk, output,
info);
78 if (prk.
Length < hashLength)
83 ref
byte reference = ref span[0];
89 if (output.Overlaps(
info))
111 reference = (byte)num;
124 Span<byte> output2 = stackalloc
byte[hashLength];
141 if (outputLength <= 0)
146 int num2 = 255 * num;
147 if (outputLength > num2)
152 Extract(hashAlgorithmName, num, ikm, salt, span);
153 byte[]
array =
new byte[outputLength];
165 int num2 = 255 * num;
171 Extract(hashAlgorithmName, num, ikm, salt, span);
172 Expand(hashAlgorithmName, num, span, output,
info);
static string ArgumentOutOfRange_NeedPosNum
static string Argument_DestinationTooShort
static string Format(string resourceFormat, object p1)
static string Cryptography_Prk_TooSmall
static string Arg_CryptographyException
static string Cryptography_Okm_TooLarge
static void Return(byte[] array, int clearSize=-1)
static byte[] Rent(int minimumLength)
static void GetHashAndReset(IncrementalHash hmac, Span< byte > output)
static int Extract(HashAlgorithmName hashAlgorithmName, ReadOnlySpan< byte > ikm, ReadOnlySpan< byte > salt, Span< byte > prk)
static byte[] DeriveKey(HashAlgorithmName hashAlgorithmName, byte[] ikm, int outputLength, byte[]? salt=null, byte[]? info=null)
static void DeriveKey(HashAlgorithmName hashAlgorithmName, ReadOnlySpan< byte > ikm, Span< byte > output, ReadOnlySpan< byte > salt, ReadOnlySpan< byte > info)
static void Expand(HashAlgorithmName hashAlgorithmName, ReadOnlySpan< byte > prk, Span< byte > output, ReadOnlySpan< byte > info)
static void Expand(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan< byte > prk, Span< byte > output, ReadOnlySpan< byte > info)
static void Extract(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan< byte > ikm, ReadOnlySpan< byte > salt, Span< byte > prk)
static int HashLength(HashAlgorithmName hashAlgorithmName)
static byte[] Extract(HashAlgorithmName hashAlgorithmName, byte[] ikm, byte[]? salt=null)
static byte[] Expand(HashAlgorithmName hashAlgorithmName, byte[] prk, int outputLength, byte[]? info=null)
static int MacData(HashAlgorithmName hashAlgorithm, ReadOnlySpan< byte > key, ReadOnlySpan< byte > source, Span< byte > destination)
static IncrementalHash CreateHMAC(HashAlgorithmName hashAlgorithm, byte[] key)
void AppendData(byte[] data)
bool TryGetHashAndReset(Span< byte > destination, out int bytesWritten)
static HashAlgorithmName SHA1
static HashAlgorithmName SHA512
static HashAlgorithmName SHA256
static HashAlgorithmName SHA384
static HashAlgorithmName MD5
Span< T > Slice(int start)