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

◆ Rfc2898DeriveBytes() [9/9]

System.Security.Cryptography.Rfc2898DeriveBytes.Rfc2898DeriveBytes ( byte[] password,
byte[] salt,
int iterations,
HashAlgorithmName hashAlgorithm,
bool clearPassword )
inlinepackage

Definition at line 123 of file Rfc2898DeriveBytes.cs.

124 {
125 if (salt == null)
126 {
127 throw new ArgumentNullException("salt");
128 }
129 if (iterations <= 0)
130 {
131 throw new ArgumentOutOfRangeException("iterations", System.SR.ArgumentOutOfRange_NeedPosNum);
132 }
133 if (password == null)
134 {
135 throw new NullReferenceException();
136 }
137 _salt = new byte[salt.Length + 4];
138 salt.AsSpan().CopyTo(_salt);
139 _iterations = (uint)iterations;
140 HashAlgorithm = hashAlgorithm;
141 _hmac = OpenHmac(password);
142 if (clearPassword)
143 {
144 CryptographicOperations.ZeroMemory(password);
145 }
146 _blockSize = _hmac.HashSize >> 3;
147 Initialize();
148 }
static string ArgumentOutOfRange_NeedPosNum
Definition SR.cs:20
Definition SR.cs:7

References System.Security.Cryptography.Rfc2898DeriveBytes._blockSize, System.Security.Cryptography.Rfc2898DeriveBytes._hmac, System.Security.Cryptography.Rfc2898DeriveBytes._iterations, System.Security.Cryptography.Rfc2898DeriveBytes._salt, System.SR.ArgumentOutOfRange_NeedPosNum, System.Security.Cryptography.Rfc2898DeriveBytes.Initialize(), System.Security.Cryptography.Rfc2898DeriveBytes.OpenHmac(), and System.Security.Cryptography.CryptographicOperations.ZeroMemory().