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

◆ GetBytes()

override byte[] System.Security.Cryptography.Rfc2898DeriveBytes.GetBytes ( int cb)
inline

Definition at line 171 of file Rfc2898DeriveBytes.cs.

172 {
173 if (cb <= 0)
174 {
175 throw new ArgumentOutOfRangeException("cb", System.SR.ArgumentOutOfRange_NeedPosNum);
176 }
177 byte[] array = new byte[cb];
178 int i = 0;
179 int num = _endIndex - _startIndex;
180 if (num > 0)
181 {
182 if (cb < num)
183 {
184 Buffer.BlockCopy(_buffer, _startIndex, array, 0, cb);
185 _startIndex += cb;
186 return array;
187 }
188 Buffer.BlockCopy(_buffer, _startIndex, array, 0, num);
189 _startIndex = (_endIndex = 0);
190 i += num;
191 }
192 for (; i < cb; i += _blockSize)
193 {
194 Func();
195 int num2 = cb - i;
196 if (num2 >= _blockSize)
197 {
198 Buffer.BlockCopy(_buffer, 0, array, i, _blockSize);
199 continue;
200 }
201 Buffer.BlockCopy(_buffer, 0, array, i, num2);
202 _startIndex = num2;
203 _endIndex = _buffer.Length;
204 return array;
205 }
206 return array;
207 }
static string ArgumentOutOfRange_NeedPosNum
Definition SR.cs:20
Definition SR.cs:7

References System.Security.Cryptography.Rfc2898DeriveBytes._blockSize, System.Security.Cryptography.Rfc2898DeriveBytes._buffer, System.Security.Cryptography.Rfc2898DeriveBytes._endIndex, System.Security.Cryptography.Rfc2898DeriveBytes._startIndex, System.SR.ArgumentOutOfRange_NeedPosNum, System.array, System.Buffer.BlockCopy(), and System.Security.Cryptography.Rfc2898DeriveBytes.Func().

Referenced by System.Security.Cryptography.PasswordBasedEncryption.Encrypt(), and System.Security.Cryptography.PasswordBasedEncryption.Pbes2Decrypt().