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

◆ TransformFinalBlock()

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

Implements System.Security.Cryptography.ICryptoTransform.

Definition at line 63 of file FromBase64Transform.cs.

64 {
65 ThrowHelper.ValidateTransformBlock(inputBuffer, inputOffset, inputCount);
66 if (_inputBuffer == null)
67 {
68 ThrowHelper.ThrowObjectDisposed();
69 }
70 if (inputCount == 0)
71 {
72 return Array.Empty<byte>();
73 }
74 byte[] array = null;
75 Span<byte> tmpBuffer = stackalloc byte[32];
76 if (inputCount > 32)
77 {
78 tmpBuffer = (array = System.Security.Cryptography.CryptoPool.Rent(inputCount));
79 }
80 tmpBuffer = GetTempBuffer(inputBuffer.AsSpan(inputOffset, inputCount), tmpBuffer);
81 int num = _inputIndex + tmpBuffer.Length;
82 if (num < InputBlockSize)
83 {
84 Reset();
85 ReturnToCryptoPool(array, tmpBuffer.Length);
86 return Array.Empty<byte>();
87 }
88 int outputSize = GetOutputSize(num, tmpBuffer);
89 byte[] array2 = new byte[outputSize];
90 ConvertFromBase64(tmpBuffer, array2, out var _, out var _);
91 ReturnToCryptoPool(array, tmpBuffer.Length);
92 Reset();
93 return array2;
94 }
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)
int GetOutputSize(int bytesToTransform, Span< byte > tmpBuffer)

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