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

◆ Pbkdf2Core() [2/2]

static void System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2Core ( ReadOnlySpan< char > password,
ReadOnlySpan< byte > salt,
Span< byte > destination,
int iterations,
HashAlgorithmName hashAlgorithm )
inlinestaticprivate

Definition at line 364 of file Rfc2898DeriveBytes.cs.

365 {
366 if (!destination.IsEmpty)
367 {
368 byte[] array = null;
369 int maxByteCount = s_throwingUtf8Encoding.GetMaxByteCount(password.Length);
370 Span<byte> span = ((maxByteCount <= 256) ? stackalloc byte[256] : ((Span<byte>)(array = System.Security.Cryptography.CryptoPool.Rent(maxByteCount))));
371 Span<byte> bytes = span;
372 Span<byte> span2 = bytes[..s_throwingUtf8Encoding.GetBytes(password, bytes)];
373 try
374 {
375 Pbkdf2Implementation.Fill(span2, salt, iterations, hashAlgorithm, destination);
376 }
377 finally
378 {
379 CryptographicOperations.ZeroMemory(span2);
380 }
381 if (array != null)
382 {
384 }
385 }
386 }
static void Fill(ReadOnlySpan< byte > password, ReadOnlySpan< byte > salt, int iterations, HashAlgorithmName hashAlgorithmName, Span< byte > destination)
static void Return(byte[] array, int clearSize=-1)
Definition CryptoPool.cs:12

References System.array, System.bytes, System.destination, Internal.Cryptography.Pbkdf2Implementation.Fill(), System.ReadOnlySpan< T >.Length, System.Security.Cryptography.CryptoPool.Rent(), System.Security.Cryptography.CryptoPool.Return(), System.Security.Cryptography.Rfc2898DeriveBytes.s_throwingUtf8Encoding, and System.Security.Cryptography.CryptographicOperations.ZeroMemory().

Referenced by System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2(), System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2(), System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2(), and System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2().