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

◆ ComputeBytes()

byte[] System.Security.Cryptography.PasswordDeriveBytes.ComputeBytes ( int cb)
inlineprivate

Definition at line 251 of file PasswordDeriveBytes.cs.

252 {
253 int num = 0;
255 int num2 = _hash.HashSize / 8;
256 byte[] array = new byte[(cb + num2 - 1) / num2 * num2];
257 using (CryptoStream cryptoStream = new CryptoStream(Stream.Null, _hash, CryptoStreamMode.Write))
258 {
259 HashPrefix(cryptoStream);
260 cryptoStream.Write(_baseValue, 0, _baseValue.Length);
261 cryptoStream.Close();
262 }
263 Buffer.BlockCopy(_hash.Hash, 0, array, num, num2);
264 for (num += num2; cb > num; num += num2)
265 {
267 using (CryptoStream cryptoStream2 = new CryptoStream(Stream.Null, _hash, CryptoStreamMode.Write))
268 {
269 HashPrefix(cryptoStream2);
270 cryptoStream2.Write(_baseValue, 0, _baseValue.Length);
271 cryptoStream2.Close();
272 }
273 Buffer.BlockCopy(_hash.Hash, 0, array, num, num2);
274 }
275 return array;
276 }
static readonly Stream Null
Definition Stream.cs:488

References System.Security.Cryptography.PasswordDeriveBytes._baseValue, System.Security.Cryptography.PasswordDeriveBytes._hash, System.array, System.Buffer.BlockCopy(), System.IO.Stream.Close(), System.Security.Cryptography.HashAlgorithm.Hash, System.Security.Cryptography.PasswordDeriveBytes.HashPrefix(), System.Security.Cryptography.HashAlgorithm.Initialize(), System.IO.Stream.Null, and System.Security.Cryptography.CryptoStream.Write().

Referenced by System.Security.Cryptography.PasswordDeriveBytes.GetBytes().