Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DeriveKey() [2/2]

static void System.Security.Cryptography.HKDF.DeriveKey ( HashAlgorithmName hashAlgorithmName,
ReadOnlySpan< byte > ikm,
Span< byte > output,
ReadOnlySpan< byte > salt,
ReadOnlySpan< byte > info )
inlinestatic

Definition at line 158 of file HKDF.cs.

159 {
160 int num = HashLength(hashAlgorithmName);
161 if (output.Length == 0)
162 {
164 }
165 int num2 = 255 * num;
166 if (output.Length > num2)
167 {
169 }
170 Span<byte> span = stackalloc byte[num];
171 Extract(hashAlgorithmName, num, ikm, salt, span);
172 Expand(hashAlgorithmName, num, span, output, info);
173 }
static string Argument_DestinationTooShort
Definition SR.cs:14
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Cryptography_Okm_TooLarge
Definition SR.cs:172
Definition SR.cs:7
static int HashLength(HashAlgorithmName hashAlgorithmName)
Definition HKDF.cs:183
static byte[] Extract(HashAlgorithmName hashAlgorithmName, byte[] ikm, byte[]? salt=null)
Definition HKDF.cs:8
static byte[] Expand(HashAlgorithmName hashAlgorithmName, byte[] prk, int outputLength, byte[]? info=null)
Definition HKDF.cs:40
int Length
Definition Span.cs:70

References System.SR.Argument_DestinationTooShort, System.SR.Cryptography_Okm_TooLarge, System.Security.Cryptography.HKDF.Expand(), System.Security.Cryptography.HKDF.Extract(), System.SR.Format(), System.Security.Cryptography.HKDF.HashLength(), System.info, and System.Span< T >.Length.