137 lines
6.4 KiB
C#
137 lines
6.4 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Security.Cryptography
|
|
{
|
|
/// <summary>Performs a cryptographic transformation of data using the Rijndael algorithm. This class cannot be inherited.</summary>
|
|
// Token: 0x02000529 RID: 1321
|
|
[ComVisible(true)]
|
|
public sealed class RijndaelManagedTransform : IDisposable, ICryptoTransform
|
|
{
|
|
// Token: 0x0600307F RID: 12415 RVA: 0x000A5D80 File Offset: 0x000A3F80
|
|
internal RijndaelManagedTransform(Rijndael algo, bool encryption, byte[] key, byte[] iv)
|
|
{
|
|
this._st = new RijndaelTransform(algo, encryption, key, iv);
|
|
this._bs = algo.BlockSize;
|
|
}
|
|
|
|
/// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
|
|
// Token: 0x06003080 RID: 12416 RVA: 0x000A5DB0 File Offset: 0x000A3FB0
|
|
void IDisposable.Dispose()
|
|
{
|
|
this._st.Clear();
|
|
}
|
|
|
|
/// <summary>Gets the block size.</summary>
|
|
/// <returns>The size of the data blocks in bytes.</returns>
|
|
// Token: 0x17000986 RID: 2438
|
|
// (get) Token: 0x06003081 RID: 12417 RVA: 0x000A5DC0 File Offset: 0x000A3FC0
|
|
public int BlockSizeValue
|
|
{
|
|
get
|
|
{
|
|
return this._bs;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether multiple blocks can be transformed.</summary>
|
|
/// <returns>true if multiple blocks can be transformed; otherwise, false.</returns>
|
|
// Token: 0x17000987 RID: 2439
|
|
// (get) Token: 0x06003082 RID: 12418 RVA: 0x000A5DC8 File Offset: 0x000A3FC8
|
|
public bool CanTransformMultipleBlocks
|
|
{
|
|
get
|
|
{
|
|
return this._st.CanTransformMultipleBlocks;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether the current transform can be reused.</summary>
|
|
/// <returns>Always true.</returns>
|
|
// Token: 0x17000988 RID: 2440
|
|
// (get) Token: 0x06003083 RID: 12419 RVA: 0x000A5DD8 File Offset: 0x000A3FD8
|
|
public bool CanReuseTransform
|
|
{
|
|
get
|
|
{
|
|
return this._st.CanReuseTransform;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the input block size.</summary>
|
|
/// <returns>The size of the input data blocks in bytes.</returns>
|
|
// Token: 0x17000989 RID: 2441
|
|
// (get) Token: 0x06003084 RID: 12420 RVA: 0x000A5DE8 File Offset: 0x000A3FE8
|
|
public int InputBlockSize
|
|
{
|
|
get
|
|
{
|
|
return this._st.InputBlockSize;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the output block size.</summary>
|
|
/// <returns>The size of the output data blocks in bytes.</returns>
|
|
// Token: 0x1700098A RID: 2442
|
|
// (get) Token: 0x06003085 RID: 12421 RVA: 0x000A5DF8 File Offset: 0x000A3FF8
|
|
public int OutputBlockSize
|
|
{
|
|
get
|
|
{
|
|
return this._st.OutputBlockSize;
|
|
}
|
|
}
|
|
|
|
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.RijndaelManagedTransform" /> class.</summary>
|
|
// Token: 0x06003086 RID: 12422 RVA: 0x000A5E08 File Offset: 0x000A4008
|
|
public void Clear()
|
|
{
|
|
this._st.Clear();
|
|
}
|
|
|
|
/// <summary>Resets the internal state of <see cref="T:System.Security.Cryptography.RijndaelManagedTransform" /> so it can be used again to do a different encryption or decryption.</summary>
|
|
// Token: 0x06003087 RID: 12423 RVA: 0x000A5E18 File Offset: 0x000A4018
|
|
[MonoTODO("Reset does nothing since CanReuseTransform return false.")]
|
|
public void Reset()
|
|
{
|
|
}
|
|
|
|
/// <summary>Computes the transformation for the specified region of the input byte array and copies the resulting transformation to the specified region of the output byte array.</summary>
|
|
/// <returns>The number of bytes written.</returns>
|
|
/// <param name="inputBuffer">The input to perform the operation on. </param>
|
|
/// <param name="inputOffset">The offset into the input byte array to begin using data from. </param>
|
|
/// <param name="inputCount">The number of bytes in the input byte array to use as data. </param>
|
|
/// <param name="outputBuffer">The output to write the data to. </param>
|
|
/// <param name="outputOffset">The offset into the output byte array to begin writing data from. </param>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="inputBuffer" /> parameter is null.-or- The <paramref name="outputBuffer" /> parameter is null. </exception>
|
|
/// <exception cref="T:System.ArgumentException">The length of the input buffer is less than the sum of the input offset and the input count. -or-The value of the <paramref name="inputCount" /> parameter is less than or equal to 0.-or-The value of the <paramref name="inputCount" /> parameter is greater than the length of the <paramref name="inputBuffer" /> parameter.-or-The length of the <paramref name="inputCount" /> parameter is not evenly devisable by input block size. </exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The value of the <paramref name="inputOffset" /> parameter is negative.</exception>
|
|
// Token: 0x06003088 RID: 12424 RVA: 0x000A5E1C File Offset: 0x000A401C
|
|
public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
|
|
{
|
|
return this._st.TransformBlock(inputBuffer, inputOffset, inputCount, outputBuffer, outputOffset);
|
|
}
|
|
|
|
/// <summary>Computes the transformation for the specified region of the specified byte array.</summary>
|
|
/// <returns>The computed transformation.</returns>
|
|
/// <param name="inputBuffer">The input to perform the operation on.</param>
|
|
/// <param name="inputOffset">The offset into the byte array to begin using data from.</param>
|
|
/// <param name="inputCount">The number of bytes in the byte array to use as data.</param>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="inputBuffer" /> parameter is null. </exception>
|
|
/// <exception cref="T:System.ArgumentException">The value of the <paramref name="inputCount" /> parameter is less than 0.-or-The value of the <paramref name="inputCount" /> parameter is grater than the length of <paramref name="inputBuffer" /> parameter.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The value of the <paramref name="inputOffset" /> parameter is negative.</exception>
|
|
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The length of the <paramref name="inputCount" /> parameter is not evenly devisable by input block size.</exception>
|
|
// Token: 0x06003089 RID: 12425 RVA: 0x000A5E30 File Offset: 0x000A4030
|
|
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
|
|
{
|
|
return this._st.TransformFinalBlock(inputBuffer, inputOffset, inputCount);
|
|
}
|
|
|
|
// Token: 0x040013C5 RID: 5061
|
|
private RijndaelTransform _st;
|
|
|
|
// Token: 0x040013C6 RID: 5062
|
|
private int _bs;
|
|
}
|
|
}
|