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

◆ TransformBlock()

int System.Security.Cryptography.FromBase64Transform.TransformBlock ( byte[] inputBuffer,
int inputOffset,
int inputCount,
byte[] outputBuffer,
int outputOffset )
inline

Implements System.Security.Cryptography.ICryptoTransform.

Definition at line 32 of file FromBase64Transform.cs.

33 {
34 ThrowHelper.ValidateTransformBlock(inputBuffer, inputOffset, inputCount);
35 if (_inputBuffer == null)
36 {
37 ThrowHelper.ThrowObjectDisposed();
38 }
39 if (outputBuffer == null)
40 {
41 ThrowHelper.ThrowArgumentNull(ThrowHelper.ExceptionArgument.outputBuffer);
42 }
43 byte[] array = null;
44 Span<byte> tmpBuffer = stackalloc byte[32];
45 if (inputCount > 32)
46 {
47 tmpBuffer = (array = System.Security.Cryptography.CryptoPool.Rent(inputCount));
48 }
49 tmpBuffer = GetTempBuffer(inputBuffer.AsSpan(inputOffset, inputCount), tmpBuffer);
50 int num = _inputIndex + tmpBuffer.Length;
51 if (num < InputBlockSize)
52 {
53 tmpBuffer.CopyTo(_inputBuffer.AsSpan(_inputIndex));
54 _inputIndex = num;
55 ReturnToCryptoPool(array, tmpBuffer.Length);
56 return 0;
57 }
58 ConvertFromBase64(tmpBuffer, outputBuffer.AsSpan(outputOffset), out var _, out var written);
59 ReturnToCryptoPool(array, tmpBuffer.Length);
60 return written;
61 }
static byte[] Rent(int minimumLength)
Definition CryptoPool.cs:7
void ConvertFromBase64(Span< byte > tmpBuffer, Span< byte > outputBuffer, out int consumed, out int written)
void ReturnToCryptoPool(byte[] array, int clearSize)
Span< byte > GetTempBuffer(Span< byte > inputBuffer, Span< byte > tmpBuffer)

References System.Security.Cryptography.FromBase64Transform._inputBuffer, System.Security.Cryptography.FromBase64Transform._inputIndex, System.array, System.Security.Cryptography.FromBase64Transform.ConvertFromBase64(), System.Span< T >.CopyTo(), System.Security.Cryptography.FromBase64Transform.GetTempBuffer(), System.Security.Cryptography.FromBase64Transform.InputBlockSize, System.Span< T >.Length, System.Security.Cryptography.CryptoPool.Rent(), System.Security.Cryptography.FromBase64Transform.ReturnToCryptoPool(), System.Security.Cryptography.ThrowHelper.ThrowArgumentNull(), System.Security.Cryptography.ThrowHelper.ThrowObjectDisposed(), and System.Security.Cryptography.ThrowHelper.ValidateTransformBlock().