This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,136 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract base class from which all implementations of asymmetric algorithms must inherit.</summary>
// Token: 0x020004E5 RID: 1253
[ComVisible(true)]
public abstract class AsymmetricAlgorithm : IDisposable
{
/// <summary>For a description of this member, see <see cref="M:System.IDisposable.Dispose" />.</summary>
// Token: 0x06002E7C RID: 11900 RVA: 0x000950A8 File Offset: 0x000932A8
void IDisposable.Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>When overridden in a derived class, gets the name of the key exchange algorithm.</summary>
/// <returns>The name of the key exchange algorithm.</returns>
// Token: 0x1700092A RID: 2346
// (get) Token: 0x06002E7D RID: 11901
public abstract string KeyExchangeAlgorithm { get; }
/// <summary>Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.</summary>
/// <returns>The size, in bits, of the key modulus used by the asymmetric algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key modulus size is invalid. </exception>
// Token: 0x1700092B RID: 2347
// (get) Token: 0x06002E7E RID: 11902 RVA: 0x000950B8 File Offset: 0x000932B8
// (set) Token: 0x06002E7F RID: 11903 RVA: 0x000950C0 File Offset: 0x000932C0
public virtual int KeySize
{
get
{
return this.KeySizeValue;
}
set
{
if (!KeySizes.IsLegalKeySize(this.LegalKeySizesValue, value))
{
throw new CryptographicException(Locale.GetText("Key size not supported by algorithm."));
}
this.KeySizeValue = value;
}
}
/// <summary>Gets the key sizes that are supported by the asymmetric algorithm.</summary>
/// <returns>An array that contains the key sizes supported by the asymmetric algorithm.</returns>
// Token: 0x1700092C RID: 2348
// (get) Token: 0x06002E80 RID: 11904 RVA: 0x000950F8 File Offset: 0x000932F8
public virtual KeySizes[] LegalKeySizes
{
get
{
return this.LegalKeySizesValue;
}
}
/// <summary>Gets the name of the signature algorithm.</summary>
/// <returns>The name of the signature algorithm.</returns>
// Token: 0x1700092D RID: 2349
// (get) Token: 0x06002E81 RID: 11905
public abstract string SignatureAlgorithm { get; }
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> class.</summary>
// Token: 0x06002E82 RID: 11906 RVA: 0x00095100 File Offset: 0x00093300
public void Clear()
{
this.Dispose(false);
}
/// <summary>When overridden in a derived class, releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002E83 RID: 11907
protected abstract void Dispose(bool disposing);
/// <summary>When overridden in a derived class, reconstructs an <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> object from an XML string.</summary>
/// <param name="xmlString">The XML string to use to reconstruct the <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> object. </param>
// Token: 0x06002E84 RID: 11908
public abstract void FromXmlString(string xmlString);
/// <summary>When overridden in a derived class, creates and returns an XML string representation of the current <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> object.</summary>
/// <returns>An XML string encoding of the current <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> object.</returns>
/// <param name="includePrivateParameters">true to include private parameters; otherwise, false. </param>
// Token: 0x06002E85 RID: 11909
public abstract string ToXmlString(bool includePrivateParameters);
/// <summary>Creates an instance of the default implementation of an asymmetric algorithm.</summary>
/// <returns>A new <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> instance, unless the default settings have been changed with the &lt;cryptoClass&gt; element.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002E86 RID: 11910 RVA: 0x0009510C File Offset: 0x0009330C
public static AsymmetricAlgorithm Create()
{
return AsymmetricAlgorithm.Create("System.Security.Cryptography.AsymmetricAlgorithm");
}
/// <summary>Creates an instance of the specified implementation of an asymmetric algorithm.</summary>
/// <returns>A new instance of the specified asymmetric algorithm implementation.</returns>
/// <param name="algName">The asymmetric algorithm implementation to use. The following table shows the valid values for the <paramref name="algName" /> parameter and the algorithms they map to.Parameter valueImplements System.Security.Cryptography.AsymmetricAlgorithm<see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" />RSA<see cref="T:System.Security.Cryptography.RSA" />System.Security.Cryptography.RSA<see cref="T:System.Security.Cryptography.RSA" />DSA<see cref="T:System.Security.Cryptography.DSA" />System.Security.Cryptography.DSA<see cref="T:System.Security.Cryptography.DSA" />ECDsa<see cref="T:System.Security.Cryptography.ECDsa" />ECDsaCng<see cref="T:System.Security.Cryptography.ECDsaCng" />System.Security.Cryptography.ECDsaCng<see cref="T:System.Security.Cryptography.ECDsaCng" />ECDH<see cref="T:System.Security.Cryptography.ECDiffieHellman" />ECDiffieHellman<see cref="T:System.Security.Cryptography.ECDiffieHellman" />ECDiffieHellmanCng<see cref="T:System.Security.Cryptography.ECDiffieHellmanCng" />System.Security.Cryptography.ECDiffieHellmanCng<see cref="T:System.Security.Cryptography.ECDiffieHellmanCng" /></param>
// Token: 0x06002E87 RID: 11911 RVA: 0x00095118 File Offset: 0x00093318
public static AsymmetricAlgorithm Create(string algName)
{
return (AsymmetricAlgorithm)CryptoConfig.CreateFromName(algName);
}
// Token: 0x06002E88 RID: 11912 RVA: 0x00095128 File Offset: 0x00093328
internal static byte[] GetNamedParam(string xml, string param)
{
string text = "<" + param + ">";
int num = xml.IndexOf(text);
if (num == -1)
{
return null;
}
string text2 = "</" + param + ">";
int num2 = xml.IndexOf(text2);
if (num2 == -1 || num2 <= num)
{
return null;
}
num += text.Length;
string text3 = xml.Substring(num, num2 - num);
return Convert.FromBase64String(text3);
}
/// <summary>Represents the size, in bits, of the key modulus used by the asymmetric algorithm.</summary>
// Token: 0x04001267 RID: 4711
protected int KeySizeValue;
/// <summary>Specifies the key sizes that are supported by the asymmetric algorithm.</summary>
// Token: 0x04001268 RID: 4712
protected KeySizes[] LegalKeySizesValue;
}
}
@@ -0,0 +1,29 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class from which all asymmetric key exchange deformatters derive.</summary>
// Token: 0x020004E6 RID: 1254
[ComVisible(true)]
public abstract class AsymmetricKeyExchangeDeformatter
{
/// <summary>When overridden in a derived class, gets or sets the parameters for the asymmetric key exchange.</summary>
/// <returns>A string in XML format containing the parameters of the asymmetric key exchange operation.</returns>
// Token: 0x1700092E RID: 2350
// (get) Token: 0x06002E8A RID: 11914
// (set) Token: 0x06002E8B RID: 11915
public abstract string Parameters { get; set; }
/// <summary>When overridden in a derived class, extracts secret information from the encrypted key exchange data.</summary>
/// <returns>The secret information derived from the key exchange data.</returns>
/// <param name="rgb">The key exchange data within which the secret information is hidden. </param>
// Token: 0x06002E8C RID: 11916
public abstract byte[] DecryptKeyExchange(byte[] rgb);
/// <summary>When overridden in a derived class, sets the private key to use for decrypting the secret information.</summary>
/// <param name="key">The instance of the implementation of <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> that holds the private key. </param>
// Token: 0x06002E8D RID: 11917
public abstract void SetKey(AsymmetricAlgorithm key);
}
}
@@ -0,0 +1,35 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class from which all asymmetric key exchange formatters derive.</summary>
// Token: 0x020004E7 RID: 1255
[ComVisible(true)]
public abstract class AsymmetricKeyExchangeFormatter
{
/// <summary>When overridden in a derived class, gets the parameters for the asymmetric key exchange.</summary>
/// <returns>A string in XML format containing the parameters of the asymmetric key exchange operation.</returns>
// Token: 0x1700092F RID: 2351
// (get) Token: 0x06002E8F RID: 11919
public abstract string Parameters { get; }
/// <summary>When overridden in a derived class, creates the encrypted key exchange data from the specified input data.</summary>
/// <returns>The encrypted key exchange data to be sent to the intended recipient.</returns>
/// <param name="data">The secret information to be passed in the key exchange. </param>
// Token: 0x06002E90 RID: 11920
public abstract byte[] CreateKeyExchange(byte[] data);
/// <summary>When overridden in a derived class, creates the encrypted key exchange data from the specified input data.</summary>
/// <returns>The encrypted key exchange data to be sent to the intended recipient.</returns>
/// <param name="data">The secret information to be passed in the key exchange. </param>
/// <param name="symAlgType">This parameter is not used in the current version. </param>
// Token: 0x06002E91 RID: 11921
public abstract byte[] CreateKeyExchange(byte[] data, Type symAlgType);
/// <summary>When overridden in a derived class, sets the public key to use for encrypting the secret information.</summary>
/// <param name="key">The instance of the implementation of <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> that holds the public key. </param>
// Token: 0x06002E92 RID: 11922
public abstract void SetKey(AsymmetricAlgorithm key);
}
}
@@ -0,0 +1,44 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract base class from which all implementations of asymmetric signature deformatters derive.</summary>
// Token: 0x020004E8 RID: 1256
[ComVisible(true)]
public abstract class AsymmetricSignatureDeformatter
{
/// <summary>When overridden in a derived class, sets the hash algorithm to use for verifying the signature.</summary>
/// <param name="strName">The name of the hash algorithm to use for verifying the signature. </param>
// Token: 0x06002E94 RID: 11924
public abstract void SetHashAlgorithm(string strName);
/// <summary>When overridden in a derived class, sets the public key to use for verifying the signature.</summary>
/// <param name="key">The instance of an implementation of <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> that holds the public key. </param>
// Token: 0x06002E95 RID: 11925
public abstract void SetKey(AsymmetricAlgorithm key);
/// <summary>When overridden in a derived class, verifies the signature for the specified data.</summary>
/// <returns>true if <paramref name="rgbSignature" /> matches the signature computed using the specified hash algorithm and key on <paramref name="rgbHash" />; otherwise, false.</returns>
/// <param name="rgbHash">The data signed with <paramref name="rgbSignature" />. </param>
/// <param name="rgbSignature">The signature to be verified for <paramref name="rgbHash" />. </param>
// Token: 0x06002E96 RID: 11926
public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature);
/// <summary>Verifies the signature from the specified hash value.</summary>
/// <returns>true if the signature is valid for the hash; otherwise, false.</returns>
/// <param name="hash">The hash algorithm to use to verify the signature. </param>
/// <param name="rgbSignature">The signature to be verified. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="hash" /> parameter is null. </exception>
// Token: 0x06002E97 RID: 11927 RVA: 0x000951B4 File Offset: 0x000933B4
public virtual bool VerifySignature(HashAlgorithm hash, byte[] rgbSignature)
{
if (hash == null)
{
throw new ArgumentNullException("hash");
}
this.SetHashAlgorithm(hash.ToString());
return this.VerifySignature(hash.Hash, rgbSignature);
}
}
}
@@ -0,0 +1,42 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class from which all implementations of asymmetric signature formatters derive.</summary>
// Token: 0x020004E9 RID: 1257
[ComVisible(true)]
public abstract class AsymmetricSignatureFormatter
{
/// <summary>When overridden in a derived class, sets the hash algorithm to use for creating the signature.</summary>
/// <param name="strName">The name of the hash algorithm to use for creating the signature. </param>
// Token: 0x06002E99 RID: 11929
public abstract void SetHashAlgorithm(string strName);
/// <summary>When overridden in a derived class, sets the asymmetric algorithm to use to create the signature.</summary>
/// <param name="key">The instance of the implementation of <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> to use to create the signature. </param>
// Token: 0x06002E9A RID: 11930
public abstract void SetKey(AsymmetricAlgorithm key);
/// <summary>When overridden in a derived class, creates the signature for the specified data.</summary>
/// <returns>The digital signature for the <paramref name="rgbHash" /> parameter.</returns>
/// <param name="rgbHash">The data to be signed. </param>
// Token: 0x06002E9B RID: 11931
public abstract byte[] CreateSignature(byte[] rgbHash);
/// <summary>Creates the signature from the specified hash value.</summary>
/// <returns>The signature for the specified hash value.</returns>
/// <param name="hash">The hash algorithm to use to create the signature. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="hash" /> parameter is null. </exception>
// Token: 0x06002E9C RID: 11932 RVA: 0x000951F4 File Offset: 0x000933F4
public virtual byte[] CreateSignature(HashAlgorithm hash)
{
if (hash == null)
{
throw new ArgumentNullException("hash");
}
this.SetHashAlgorithm(hash.ToString());
return this.CreateSignature(hash.Hash);
}
}
}
@@ -0,0 +1,38 @@
using System;
namespace System.Security.Cryptography
{
// Token: 0x020004EA RID: 1258
internal static class Base64Constants
{
// Token: 0x04001269 RID: 4713
public static readonly byte[] EncodeTable = new byte[]
{
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
121, 122, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 43, 47
};
// Token: 0x0400126A RID: 4714
public static readonly byte[] DecodeTable = new byte[]
{
byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue,
byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue,
byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue,
byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue,
byte.MaxValue, byte.MaxValue, byte.MaxValue, 62, byte.MaxValue, byte.MaxValue, byte.MaxValue, 63, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, byte.MaxValue, byte.MaxValue,
byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51
};
}
}
@@ -0,0 +1,28 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Specifies the block cipher mode to use for encryption.</summary>
// Token: 0x020004EB RID: 1259
[ComVisible(true)]
[Serializable]
public enum CipherMode
{
/// <summary>The Cipher Block Chaining (CBC) mode introduces feedback. Before each plain text block is encrypted, it is combined with the cipher text of the previous block by a bitwise exclusive OR operation. This ensures that even if the plain text contains many identical blocks, they will each encrypt to a different cipher text block. The initialization vector is combined with the first plain text block by a bitwise exclusive OR operation before the block is encrypted. If a single bit of the cipher text block is mangled, the corresponding plain text block will also be mangled. In addition, a bit in the subsequent block, in the same position as the original mangled bit, will be mangled.</summary>
// Token: 0x0400126C RID: 4716
CBC = 1,
/// <summary>The Electronic Codebook (ECB) mode encrypts each block individually. Any blocks of plain text that are identical and in the same message, or that are in a different message encrypted with the same key, will be transformed into identical cipher text blocks. Important:  This mode is not recommended because it opens the door for multiple security exploits. If the plain text to be encrypted contains substantial repetition, it is feasible for the cipher text to be broken one block at a time. It is also possible to use block analysis to determine the encryption key. Also, an active adversary can substitute and exchange individual blocks without detection, which allows blocks to be saved and inserted into the stream at other points without detection.</summary>
// Token: 0x0400126D RID: 4717
ECB,
/// <summary>The Output Feedback (OFB) mode processes small increments of plain text into cipher text instead of processing an entire block at a time. This mode is similar to CFB; the only difference between the two modes is the way that the shift register is filled. If a bit in the cipher text is mangled, the corresponding bit of plain text will be mangled. However, if there are extra or missing bits from the cipher text, the plain text will be mangled from that point on.</summary>
// Token: 0x0400126E RID: 4718
OFB,
/// <summary>The Cipher Feedback (CFB) mode processes small increments of plain text into cipher text, instead of processing an entire block at a time. This mode uses a shift register that is one block in length and is divided into sections. For example, if the block size is 8 bytes, with one byte processed at a time, the shift register is divided into eight sections. If a bit in the cipher text is mangled, one plain text bit is mangled and the shift register is corrupted. This results in the next several plain text increments being mangled until the bad bit is shifted out of the shift register. The default feedback size can vary by algorithm, but is typically either 8 bits or the number of bits of the block size. You can alter the number of feedback bits by using the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.FeedbackSize" /> property. Algorithms that support CFB use this property to set the feedback.</summary>
// Token: 0x0400126F RID: 4719
CFB,
/// <summary>The Cipher Text Stealing (CTS) mode handles any length of plain text and produces cipher text whose length matches the plain text length. This mode behaves like the CBC mode for all but the last two blocks of the plain text.</summary>
// Token: 0x04001270 RID: 4720
CTS
}
}
@@ -0,0 +1,149 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Performs a cryptographic transformation of data. This class cannot be inherited.</summary>
// Token: 0x020004EC RID: 1260
[ComVisible(true)]
public sealed class CryptoAPITransform : IDisposable, ICryptoTransform
{
// Token: 0x06002E9E RID: 11934 RVA: 0x00095268 File Offset: 0x00093468
internal CryptoAPITransform()
{
this.m_disposed = false;
}
/// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
// Token: 0x06002E9F RID: 11935 RVA: 0x00095278 File Offset: 0x00093478
void IDisposable.Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>Gets a value indicating whether the current transform can be reused.</summary>
/// <returns>Always true.</returns>
// Token: 0x17000930 RID: 2352
// (get) Token: 0x06002EA0 RID: 11936 RVA: 0x00095288 File Offset: 0x00093488
public bool CanReuseTransform
{
get
{
return true;
}
}
/// <summary>Gets a value indicating whether multiple blocks can be transformed.</summary>
/// <returns>true if multiple blocks can be transformed; otherwise, false.</returns>
// Token: 0x17000931 RID: 2353
// (get) Token: 0x06002EA1 RID: 11937 RVA: 0x0009528C File Offset: 0x0009348C
public bool CanTransformMultipleBlocks
{
get
{
return true;
}
}
/// <summary>Gets the input block size.</summary>
/// <returns>The input block size in bytes.</returns>
// Token: 0x17000932 RID: 2354
// (get) Token: 0x06002EA2 RID: 11938 RVA: 0x00095290 File Offset: 0x00093490
public int InputBlockSize
{
get
{
return 0;
}
}
/// <summary>Gets the key handle.</summary>
/// <returns>The key handle.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x17000933 RID: 2355
// (get) Token: 0x06002EA3 RID: 11939 RVA: 0x00095294 File Offset: 0x00093494
public IntPtr KeyHandle
{
get
{
return IntPtr.Zero;
}
}
/// <summary>Gets the output block size.</summary>
/// <returns>The output block size in bytes.</returns>
// Token: 0x17000934 RID: 2356
// (get) Token: 0x06002EA4 RID: 11940 RVA: 0x0009529C File Offset: 0x0009349C
public int OutputBlockSize
{
get
{
return 0;
}
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.CryptoAPITransform" /> method.</summary>
// Token: 0x06002EA5 RID: 11941 RVA: 0x000952A0 File Offset: 0x000934A0
public void Clear()
{
this.Dispose(false);
}
// Token: 0x06002EA6 RID: 11942 RVA: 0x000952AC File Offset: 0x000934AC
private void Dispose(bool disposing)
{
if (!this.m_disposed)
{
if (disposing)
{
}
this.m_disposed = true;
}
}
/// <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 on which to perform the operation on. </param>
/// <param name="inputOffset">The offset into the input byte array from which 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 which to write the data to. </param>
/// <param name="outputOffset">The offset into the output byte array from which 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. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="inputOffset" /> is out of range. This parameter requires a non-negative number.</exception>
// Token: 0x06002EA7 RID: 11943 RVA: 0x000952C8 File Offset: 0x000934C8
public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
return 0;
}
/// <summary>Computes the transformation for the specified region of the specified byte array.</summary>
/// <returns>The computed transformation.</returns>
/// <param name="inputBuffer">The input on which to perform the operation on. </param>
/// <param name="inputOffset">The offset into the byte array from which 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 <paramref name="inputOffset" /> parameter is less than zero.-or- The <paramref name="inputCount" /> parameter is less than zero.-or- The length of the input buffer is less than the sum of the input offset and the input count. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <see cref="F:System.Security.Cryptography.PaddingMode.PKCS7" /> padding is invalid. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="inputOffset" /> parameter is out of range. This parameter requires a non-negative number.</exception>
// Token: 0x06002EA8 RID: 11944 RVA: 0x000952CC File Offset: 0x000934CC
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
return null;
}
/// <summary>Resets the internal state of <see cref="T:System.Security.Cryptography.CryptoAPITransform" /> so that it can be used again to do a different encryption or decryption.</summary>
// Token: 0x06002EA9 RID: 11945 RVA: 0x000952D0 File Offset: 0x000934D0
[ComVisible(false)]
public void Reset()
{
}
// Token: 0x04001271 RID: 4721
private bool m_disposed;
}
}
@@ -0,0 +1,890 @@
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using Mono.Xml;
namespace System.Security.Cryptography
{
/// <summary>Accesses the cryptography configuration information.</summary>
// Token: 0x020004ED RID: 1261
[ComVisible(true)]
public class CryptoConfig
{
// Token: 0x06002EAC RID: 11948 RVA: 0x000952E8 File Offset: 0x000934E8
private static void Initialize()
{
Hashtable hashtable = new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer());
hashtable.Add("SHA", "System.Security.Cryptography.SHA1CryptoServiceProvider");
hashtable.Add("SHA1", "System.Security.Cryptography.SHA1CryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.SHA1", "System.Security.Cryptography.SHA1CryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.HashAlgorithm", "System.Security.Cryptography.SHA1CryptoServiceProvider");
hashtable.Add("MD5", "System.Security.Cryptography.MD5CryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.MD5", "System.Security.Cryptography.MD5CryptoServiceProvider");
hashtable.Add("SHA256", "System.Security.Cryptography.SHA256Managed");
hashtable.Add("SHA-256", "System.Security.Cryptography.SHA256Managed");
hashtable.Add("System.Security.Cryptography.SHA256", "System.Security.Cryptography.SHA256Managed");
hashtable.Add("SHA384", "System.Security.Cryptography.SHA384Managed");
hashtable.Add("SHA-384", "System.Security.Cryptography.SHA384Managed");
hashtable.Add("System.Security.Cryptography.SHA384", "System.Security.Cryptography.SHA384Managed");
hashtable.Add("SHA512", "System.Security.Cryptography.SHA512Managed");
hashtable.Add("SHA-512", "System.Security.Cryptography.SHA512Managed");
hashtable.Add("System.Security.Cryptography.SHA512", "System.Security.Cryptography.SHA512Managed");
hashtable.Add("RSA", "System.Security.Cryptography.RSACryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.RSA", "System.Security.Cryptography.RSACryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.AsymmetricAlgorithm", "System.Security.Cryptography.RSACryptoServiceProvider");
hashtable.Add("DSA", "System.Security.Cryptography.DSACryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.DSA", "System.Security.Cryptography.DSACryptoServiceProvider");
hashtable.Add("DES", "System.Security.Cryptography.DESCryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.DES", "System.Security.Cryptography.DESCryptoServiceProvider");
hashtable.Add("3DES", "System.Security.Cryptography.TripleDESCryptoServiceProvider");
hashtable.Add("TripleDES", "System.Security.Cryptography.TripleDESCryptoServiceProvider");
hashtable.Add("Triple DES", "System.Security.Cryptography.TripleDESCryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.TripleDES", "System.Security.Cryptography.TripleDESCryptoServiceProvider");
hashtable.Add("RC2", "System.Security.Cryptography.RC2CryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.RC2", "System.Security.Cryptography.RC2CryptoServiceProvider");
hashtable.Add("Rijndael", "System.Security.Cryptography.RijndaelManaged");
hashtable.Add("System.Security.Cryptography.Rijndael", "System.Security.Cryptography.RijndaelManaged");
hashtable.Add("System.Security.Cryptography.SymmetricAlgorithm", "System.Security.Cryptography.RijndaelManaged");
hashtable.Add("RandomNumberGenerator", "System.Security.Cryptography.RNGCryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.RandomNumberGenerator", "System.Security.Cryptography.RNGCryptoServiceProvider");
hashtable.Add("System.Security.Cryptography.KeyedHashAlgorithm", "System.Security.Cryptography.HMACSHA1");
hashtable.Add("HMACSHA1", "System.Security.Cryptography.HMACSHA1");
hashtable.Add("System.Security.Cryptography.HMACSHA1", "System.Security.Cryptography.HMACSHA1");
hashtable.Add("MACTripleDES", "System.Security.Cryptography.MACTripleDES");
hashtable.Add("System.Security.Cryptography.MACTripleDES", "System.Security.Cryptography.MACTripleDES");
hashtable.Add("RIPEMD160", "System.Security.Cryptography.RIPEMD160Managed");
hashtable.Add("RIPEMD-160", "System.Security.Cryptography.RIPEMD160Managed");
hashtable.Add("System.Security.Cryptography.RIPEMD160", "System.Security.Cryptography.RIPEMD160Managed");
hashtable.Add("System.Security.Cryptography.HMAC", "System.Security.Cryptography.HMACSHA1");
hashtable.Add("HMACMD5", "System.Security.Cryptography.HMACMD5");
hashtable.Add("System.Security.Cryptography.HMACMD5", "System.Security.Cryptography.HMACMD5");
hashtable.Add("HMACRIPEMD160", "System.Security.Cryptography.HMACRIPEMD160");
hashtable.Add("System.Security.Cryptography.HMACRIPEMD160", "System.Security.Cryptography.HMACRIPEMD160");
hashtable.Add("HMACSHA256", "System.Security.Cryptography.HMACSHA256");
hashtable.Add("System.Security.Cryptography.HMACSHA256", "System.Security.Cryptography.HMACSHA256");
hashtable.Add("HMACSHA384", "System.Security.Cryptography.HMACSHA384");
hashtable.Add("System.Security.Cryptography.HMACSHA384", "System.Security.Cryptography.HMACSHA384");
hashtable.Add("HMACSHA512", "System.Security.Cryptography.HMACSHA512");
hashtable.Add("System.Security.Cryptography.HMACSHA512", "System.Security.Cryptography.HMACSHA512");
hashtable.Add("http://www.w3.org/2000/09/xmldsig#dsa-sha1", "System.Security.Cryptography.DSASignatureDescription");
hashtable.Add("http://www.w3.org/2000/09/xmldsig#rsa-sha1", "System.Security.Cryptography.RSAPKCS1SHA1SignatureDescription");
hashtable.Add("http://www.w3.org/2000/09/xmldsig#sha1", "System.Security.Cryptography.SHA1CryptoServiceProvider");
hashtable.Add("http://www.w3.org/TR/2001/REC-xml-c14n-20010315", "System.Security.Cryptography.Xml.XmlDsigC14NTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments", "System.Security.Cryptography.Xml.XmlDsigC14NWithCommentsTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2000/09/xmldsig#base64", "System.Security.Cryptography.Xml.XmlDsigBase64Transform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/TR/1999/REC-xpath-19991116", "System.Security.Cryptography.Xml.XmlDsigXPathTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/TR/1999/REC-xslt-19991116", "System.Security.Cryptography.Xml.XmlDsigXsltTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2000/09/xmldsig#enveloped-signature", "System.Security.Cryptography.Xml.XmlDsigEnvelopedSignatureTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2001/10/xml-exc-c14n#", "System.Security.Cryptography.Xml.XmlDsigExcC14NTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2001/10/xml-exc-c14n#WithComments", "System.Security.Cryptography.Xml.XmlDsigExcC14NWithCommentsTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2002/07/decrypt#XML", "System.Security.Cryptography.Xml.XmlDecryptionTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2001/04/xmlenc#sha256", "System.Security.Cryptography.SHA256Managed");
hashtable.Add("http://www.w3.org/2001/04/xmlenc#sha512", "System.Security.Cryptography.SHA512Managed");
hashtable.Add("http://www.w3.org/2001/04/xmldsig-more#hmac-sha256", "System.Security.Cryptography.HMACSHA256");
hashtable.Add("http://www.w3.org/2001/04/xmldsig-more#hmac-sha384", "System.Security.Cryptography.HMACSHA384");
hashtable.Add("http://www.w3.org/2001/04/xmldsig-more#hmac-sha512", "System.Security.Cryptography.HMACSHA512");
hashtable.Add("http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160", "System.Security.Cryptography.HMACRIPEMD160");
hashtable.Add("http://www.w3.org/2000/09/xmldsig# X509Data", "System.Security.Cryptography.Xml.KeyInfoX509Data, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2000/09/xmldsig# KeyName", "System.Security.Cryptography.Xml.KeyInfoName, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2000/09/xmldsig# KeyValue/DSAKeyValue", "System.Security.Cryptography.Xml.DSAKeyValue, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2000/09/xmldsig# KeyValue/RSAKeyValue", "System.Security.Cryptography.Xml.RSAKeyValue, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("http://www.w3.org/2000/09/xmldsig# RetrievalMethod", "System.Security.Cryptography.Xml.KeyInfoRetrievalMethod, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
hashtable.Add("2.5.29.14", "System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierExtension, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
hashtable.Add("2.5.29.15", "System.Security.Cryptography.X509Certificates.X509KeyUsageExtension, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
hashtable.Add("2.5.29.19", "System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
hashtable.Add("2.5.29.37", "System.Security.Cryptography.X509Certificates.X509EnhancedKeyUsageExtension, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
hashtable.Add("X509Chain", "System.Security.Cryptography.X509Certificates.X509Chain, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
Hashtable hashtable2 = new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer());
hashtable2.Add("System.Security.Cryptography.SHA1CryptoServiceProvider", "1.3.14.3.2.26");
hashtable2.Add("System.Security.Cryptography.SHA1Managed", "1.3.14.3.2.26");
hashtable2.Add("SHA1", "1.3.14.3.2.26");
hashtable2.Add("System.Security.Cryptography.SHA1", "1.3.14.3.2.26");
hashtable2.Add("System.Security.Cryptography.MD5CryptoServiceProvider", "1.2.840.113549.2.5");
hashtable2.Add("MD5", "1.2.840.113549.2.5");
hashtable2.Add("System.Security.Cryptography.MD5", "1.2.840.113549.2.5");
hashtable2.Add("System.Security.Cryptography.SHA256Managed", "2.16.840.1.101.3.4.2.1");
hashtable2.Add("SHA256", "2.16.840.1.101.3.4.2.1");
hashtable2.Add("System.Security.Cryptography.SHA256", "2.16.840.1.101.3.4.2.1");
hashtable2.Add("System.Security.Cryptography.SHA384Managed", "2.16.840.1.101.3.4.2.2");
hashtable2.Add("SHA384", "2.16.840.1.101.3.4.2.2");
hashtable2.Add("System.Security.Cryptography.SHA384", "2.16.840.1.101.3.4.2.2");
hashtable2.Add("System.Security.Cryptography.SHA512Managed", "2.16.840.1.101.3.4.2.3");
hashtable2.Add("SHA512", "2.16.840.1.101.3.4.2.3");
hashtable2.Add("System.Security.Cryptography.SHA512", "2.16.840.1.101.3.4.2.3");
hashtable2.Add("TripleDESKeyWrap", "1.2.840.113549.1.9.16.3.6");
hashtable2.Add("DES", "1.3.14.3.2.7");
hashtable2.Add("TripleDES", "1.2.840.113549.3.7");
hashtable2.Add("RC2", "1.2.840.113549.3.2");
CryptoConfig.algorithms = hashtable;
CryptoConfig.oid = hashtable2;
}
// Token: 0x06002EAD RID: 11949 RVA: 0x00095964 File Offset: 0x00093B64
private static void LoadConfig(string filename, Hashtable algorithms, Hashtable oid)
{
if (!File.Exists(filename))
{
return;
}
try
{
using (TextReader textReader = new StreamReader(filename))
{
CryptoConfig.CryptoHandler cryptoHandler = new CryptoConfig.CryptoHandler(algorithms, oid);
SmallXmlParser smallXmlParser = new SmallXmlParser();
smallXmlParser.Parse(textReader, cryptoHandler);
}
}
catch
{
}
}
/// <summary>Creates a new instance of the specified cryptographic object.</summary>
/// <returns>A new instance of the specified cryptographic object.</returns>
/// <param name="name">The simple name of the cryptographic object of which to create an instance. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="name" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
// Token: 0x06002EAE RID: 11950 RVA: 0x000959EC File Offset: 0x00093BEC
public static object CreateFromName(string name)
{
return CryptoConfig.CreateFromName(name, null);
}
/// <summary>Creates a new instance of the specified cryptographic object with the specified arguments.</summary>
/// <returns>A new instance of the specified cryptographic object.</returns>
/// <param name="name">The simple name of the cryptographic object of which to create an instance. </param>
/// <param name="args">The arguments used to create the specified cryptographic object. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="name" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
// Token: 0x06002EAF RID: 11951 RVA: 0x000959F8 File Offset: 0x00093BF8
public static object CreateFromName(string name, params object[] args)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
object obj = CryptoConfig.lockObject;
lock (obj)
{
if (CryptoConfig.algorithms == null)
{
CryptoConfig.Initialize();
}
}
object obj2;
try
{
string text = (string)CryptoConfig.algorithms[name];
if (text == null)
{
text = name;
}
Type type = Type.GetType(text);
obj2 = Activator.CreateInstance(type, args);
}
catch
{
obj2 = null;
}
return obj2;
}
/// <summary>Gets the object identifier (OID) of the algorithm corresponding to the specified simple name.</summary>
/// <returns>The OID of the specified algorithm.</returns>
/// <param name="name">The simple name of the algorithm for which to get the OID. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
// Token: 0x06002EB0 RID: 11952 RVA: 0x00095AB4 File Offset: 0x00093CB4
public static string MapNameToOID(string name)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
object obj = CryptoConfig.lockObject;
lock (obj)
{
if (CryptoConfig.oid == null)
{
CryptoConfig.Initialize();
}
}
return (string)CryptoConfig.oid[name];
}
/// <summary>Encodes the specified object identifier (OID).</summary>
/// <returns>A byte array containing the encoded OID.</returns>
/// <param name="str">The OID to encode. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="str" /> parameter is null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">An error occurred while encoding the OID. </exception>
// Token: 0x06002EB1 RID: 11953 RVA: 0x00095B28 File Offset: 0x00093D28
public static byte[] EncodeOID(string str)
{
if (str == null)
{
throw new ArgumentNullException("str");
}
char[] array = new char[] { '.' };
string[] array2 = str.Split(array);
if (array2.Length < 2)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("OID must have at least two parts"));
}
byte[] array3 = new byte[str.Length];
try
{
byte b = Convert.ToByte(array2[0]);
byte b2 = Convert.ToByte(array2[1]);
array3[2] = Convert.ToByte((int)(b * 40 + b2));
}
catch
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("Invalid OID"));
}
int num = 3;
for (int i = 2; i < array2.Length; i++)
{
long num2 = Convert.ToInt64(array2[i]);
if (num2 > 127L)
{
byte[] array4 = CryptoConfig.EncodeLongNumber(num2);
Buffer.BlockCopy(array4, 0, array3, num, array4.Length);
num += array4.Length;
}
else
{
array3[num++] = Convert.ToByte(num2);
}
}
int num3 = 2;
byte[] array5 = new byte[num];
array5[0] = 6;
if (num > 127)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("OID > 127 bytes"));
}
array5[1] = Convert.ToByte(num - 2);
Buffer.BlockCopy(array3, num3, array5, num3, num - num3);
return array5;
}
// Token: 0x06002EB2 RID: 11954 RVA: 0x00095C88 File Offset: 0x00093E88
private static byte[] EncodeLongNumber(long x)
{
if (x > 2147483647L || x < -2147483648L)
{
throw new OverflowException(Locale.GetText("Part of OID doesn't fit in Int32"));
}
long num = x;
int num2 = 1;
while (num > 127L)
{
num >>= 7;
num2++;
}
byte[] array = new byte[num2];
for (int i = 0; i < num2; i++)
{
num = x >> 7 * i;
num &= 127L;
if (i != 0)
{
num += 128L;
}
array[num2 - i - 1] = Convert.ToByte(num);
}
return array;
}
// Token: 0x04001272 RID: 4722
private const string defaultNamespace = "System.Security.Cryptography.";
// Token: 0x04001273 RID: 4723
private const string defaultSHA1 = "System.Security.Cryptography.SHA1CryptoServiceProvider";
// Token: 0x04001274 RID: 4724
private const string defaultMD5 = "System.Security.Cryptography.MD5CryptoServiceProvider";
// Token: 0x04001275 RID: 4725
private const string defaultSHA256 = "System.Security.Cryptography.SHA256Managed";
// Token: 0x04001276 RID: 4726
private const string defaultSHA384 = "System.Security.Cryptography.SHA384Managed";
// Token: 0x04001277 RID: 4727
private const string defaultSHA512 = "System.Security.Cryptography.SHA512Managed";
// Token: 0x04001278 RID: 4728
private const string defaultRSA = "System.Security.Cryptography.RSACryptoServiceProvider";
// Token: 0x04001279 RID: 4729
private const string defaultDSA = "System.Security.Cryptography.DSACryptoServiceProvider";
// Token: 0x0400127A RID: 4730
private const string defaultDES = "System.Security.Cryptography.DESCryptoServiceProvider";
// Token: 0x0400127B RID: 4731
private const string default3DES = "System.Security.Cryptography.TripleDESCryptoServiceProvider";
// Token: 0x0400127C RID: 4732
private const string defaultRC2 = "System.Security.Cryptography.RC2CryptoServiceProvider";
// Token: 0x0400127D RID: 4733
private const string defaultAES = "System.Security.Cryptography.RijndaelManaged";
// Token: 0x0400127E RID: 4734
private const string defaultRNG = "System.Security.Cryptography.RNGCryptoServiceProvider";
// Token: 0x0400127F RID: 4735
private const string defaultHMAC = "System.Security.Cryptography.HMACSHA1";
// Token: 0x04001280 RID: 4736
private const string defaultMAC3DES = "System.Security.Cryptography.MACTripleDES";
// Token: 0x04001281 RID: 4737
private const string defaultDSASigDesc = "System.Security.Cryptography.DSASignatureDescription";
// Token: 0x04001282 RID: 4738
private const string defaultRSASigDesc = "System.Security.Cryptography.RSAPKCS1SHA1SignatureDescription";
// Token: 0x04001283 RID: 4739
private const string defaultRIPEMD160 = "System.Security.Cryptography.RIPEMD160Managed";
// Token: 0x04001284 RID: 4740
private const string defaultHMACMD5 = "System.Security.Cryptography.HMACMD5";
// Token: 0x04001285 RID: 4741
private const string defaultHMACRIPEMD160 = "System.Security.Cryptography.HMACRIPEMD160";
// Token: 0x04001286 RID: 4742
private const string defaultHMACSHA256 = "System.Security.Cryptography.HMACSHA256";
// Token: 0x04001287 RID: 4743
private const string defaultHMACSHA384 = "System.Security.Cryptography.HMACSHA384";
// Token: 0x04001288 RID: 4744
private const string defaultHMACSHA512 = "System.Security.Cryptography.HMACSHA512";
// Token: 0x04001289 RID: 4745
private const string defaultC14N = "System.Security.Cryptography.Xml.XmlDsigC14NTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x0400128A RID: 4746
private const string defaultC14NWithComments = "System.Security.Cryptography.Xml.XmlDsigC14NWithCommentsTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x0400128B RID: 4747
private const string defaultBase64 = "System.Security.Cryptography.Xml.XmlDsigBase64Transform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x0400128C RID: 4748
private const string defaultXPath = "System.Security.Cryptography.Xml.XmlDsigXPathTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x0400128D RID: 4749
private const string defaultXslt = "System.Security.Cryptography.Xml.XmlDsigXsltTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x0400128E RID: 4750
private const string defaultEnveloped = "System.Security.Cryptography.Xml.XmlDsigEnvelopedSignatureTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x0400128F RID: 4751
private const string defaultXmlDecryption = "System.Security.Cryptography.Xml.XmlDecryptionTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x04001290 RID: 4752
private const string defaultExcC14N = "System.Security.Cryptography.Xml.XmlDsigExcC14NTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x04001291 RID: 4753
private const string defaultExcC14NWithComments = "System.Security.Cryptography.Xml.XmlDsigExcC14NWithCommentsTransform, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x04001292 RID: 4754
private const string defaultX509Data = "System.Security.Cryptography.Xml.KeyInfoX509Data, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x04001293 RID: 4755
private const string defaultKeyName = "System.Security.Cryptography.Xml.KeyInfoName, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x04001294 RID: 4756
private const string defaultKeyValueDSA = "System.Security.Cryptography.Xml.DSAKeyValue, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x04001295 RID: 4757
private const string defaultKeyValueRSA = "System.Security.Cryptography.Xml.RSAKeyValue, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x04001296 RID: 4758
private const string defaultRetrievalMethod = "System.Security.Cryptography.Xml.KeyInfoRetrievalMethod, System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
// Token: 0x04001297 RID: 4759
private const string managedSHA1 = "System.Security.Cryptography.SHA1Managed";
// Token: 0x04001298 RID: 4760
private const string oidSHA1 = "1.3.14.3.2.26";
// Token: 0x04001299 RID: 4761
private const string oidMD5 = "1.2.840.113549.2.5";
// Token: 0x0400129A RID: 4762
private const string oidSHA256 = "2.16.840.1.101.3.4.2.1";
// Token: 0x0400129B RID: 4763
private const string oidSHA384 = "2.16.840.1.101.3.4.2.2";
// Token: 0x0400129C RID: 4764
private const string oidSHA512 = "2.16.840.1.101.3.4.2.3";
// Token: 0x0400129D RID: 4765
private const string oidDSA = "1.2.840.10040.4.1";
// Token: 0x0400129E RID: 4766
private const string oidDES = "1.3.14.3.2.7";
// Token: 0x0400129F RID: 4767
private const string oid3DES = "1.2.840.113549.3.7";
// Token: 0x040012A0 RID: 4768
private const string oidRC2 = "1.2.840.113549.3.2";
// Token: 0x040012A1 RID: 4769
private const string oid3DESKeyWrap = "1.2.840.113549.1.9.16.3.6";
// Token: 0x040012A2 RID: 4770
private const string nameSHA1a = "SHA";
// Token: 0x040012A3 RID: 4771
private const string nameSHA1b = "SHA1";
// Token: 0x040012A4 RID: 4772
private const string nameSHA1c = "System.Security.Cryptography.SHA1";
// Token: 0x040012A5 RID: 4773
private const string nameSHA1d = "System.Security.Cryptography.HashAlgorithm";
// Token: 0x040012A6 RID: 4774
private const string nameMD5a = "MD5";
// Token: 0x040012A7 RID: 4775
private const string nameMD5b = "System.Security.Cryptography.MD5";
// Token: 0x040012A8 RID: 4776
private const string nameSHA256a = "SHA256";
// Token: 0x040012A9 RID: 4777
private const string nameSHA256b = "SHA-256";
// Token: 0x040012AA RID: 4778
private const string nameSHA256c = "System.Security.Cryptography.SHA256";
// Token: 0x040012AB RID: 4779
private const string nameSHA384a = "SHA384";
// Token: 0x040012AC RID: 4780
private const string nameSHA384b = "SHA-384";
// Token: 0x040012AD RID: 4781
private const string nameSHA384c = "System.Security.Cryptography.SHA384";
// Token: 0x040012AE RID: 4782
private const string nameSHA512a = "SHA512";
// Token: 0x040012AF RID: 4783
private const string nameSHA512b = "SHA-512";
// Token: 0x040012B0 RID: 4784
private const string nameSHA512c = "System.Security.Cryptography.SHA512";
// Token: 0x040012B1 RID: 4785
private const string nameRSAa = "RSA";
// Token: 0x040012B2 RID: 4786
private const string nameRSAb = "System.Security.Cryptography.RSA";
// Token: 0x040012B3 RID: 4787
private const string nameRSAc = "System.Security.Cryptography.AsymmetricAlgorithm";
// Token: 0x040012B4 RID: 4788
private const string nameDSAa = "DSA";
// Token: 0x040012B5 RID: 4789
private const string nameDSAb = "System.Security.Cryptography.DSA";
// Token: 0x040012B6 RID: 4790
private const string nameDESa = "DES";
// Token: 0x040012B7 RID: 4791
private const string nameDESb = "System.Security.Cryptography.DES";
// Token: 0x040012B8 RID: 4792
private const string name3DESa = "3DES";
// Token: 0x040012B9 RID: 4793
private const string name3DESb = "TripleDES";
// Token: 0x040012BA RID: 4794
private const string name3DESc = "Triple DES";
// Token: 0x040012BB RID: 4795
private const string name3DESd = "System.Security.Cryptography.TripleDES";
// Token: 0x040012BC RID: 4796
private const string nameRC2a = "RC2";
// Token: 0x040012BD RID: 4797
private const string nameRC2b = "System.Security.Cryptography.RC2";
// Token: 0x040012BE RID: 4798
private const string nameAESa = "Rijndael";
// Token: 0x040012BF RID: 4799
private const string nameAESb = "System.Security.Cryptography.Rijndael";
// Token: 0x040012C0 RID: 4800
private const string nameAESc = "System.Security.Cryptography.SymmetricAlgorithm";
// Token: 0x040012C1 RID: 4801
private const string nameRNGa = "RandomNumberGenerator";
// Token: 0x040012C2 RID: 4802
private const string nameRNGb = "System.Security.Cryptography.RandomNumberGenerator";
// Token: 0x040012C3 RID: 4803
private const string nameKeyHasha = "System.Security.Cryptography.KeyedHashAlgorithm";
// Token: 0x040012C4 RID: 4804
private const string nameHMACSHA1a = "HMACSHA1";
// Token: 0x040012C5 RID: 4805
private const string nameHMACSHA1b = "System.Security.Cryptography.HMACSHA1";
// Token: 0x040012C6 RID: 4806
private const string nameMAC3DESa = "MACTripleDES";
// Token: 0x040012C7 RID: 4807
private const string nameMAC3DESb = "System.Security.Cryptography.MACTripleDES";
// Token: 0x040012C8 RID: 4808
private const string name3DESKeyWrap = "TripleDESKeyWrap";
// Token: 0x040012C9 RID: 4809
private const string nameRIPEMD160a = "RIPEMD160";
// Token: 0x040012CA RID: 4810
private const string nameRIPEMD160b = "RIPEMD-160";
// Token: 0x040012CB RID: 4811
private const string nameRIPEMD160c = "System.Security.Cryptography.RIPEMD160";
// Token: 0x040012CC RID: 4812
private const string nameHMACa = "HMAC";
// Token: 0x040012CD RID: 4813
private const string nameHMACb = "System.Security.Cryptography.HMAC";
// Token: 0x040012CE RID: 4814
private const string nameHMACMD5a = "HMACMD5";
// Token: 0x040012CF RID: 4815
private const string nameHMACMD5b = "System.Security.Cryptography.HMACMD5";
// Token: 0x040012D0 RID: 4816
private const string nameHMACRIPEMD160a = "HMACRIPEMD160";
// Token: 0x040012D1 RID: 4817
private const string nameHMACRIPEMD160b = "System.Security.Cryptography.HMACRIPEMD160";
// Token: 0x040012D2 RID: 4818
private const string nameHMACSHA256a = "HMACSHA256";
// Token: 0x040012D3 RID: 4819
private const string nameHMACSHA256b = "System.Security.Cryptography.HMACSHA256";
// Token: 0x040012D4 RID: 4820
private const string nameHMACSHA384a = "HMACSHA384";
// Token: 0x040012D5 RID: 4821
private const string nameHMACSHA384b = "System.Security.Cryptography.HMACSHA384";
// Token: 0x040012D6 RID: 4822
private const string nameHMACSHA512a = "HMACSHA512";
// Token: 0x040012D7 RID: 4823
private const string nameHMACSHA512b = "System.Security.Cryptography.HMACSHA512";
// Token: 0x040012D8 RID: 4824
private const string urlXmlDsig = "http://www.w3.org/2000/09/xmldsig#";
// Token: 0x040012D9 RID: 4825
private const string urlDSASHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1";
// Token: 0x040012DA RID: 4826
private const string urlRSASHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
// Token: 0x040012DB RID: 4827
private const string urlSHA1 = "http://www.w3.org/2000/09/xmldsig#sha1";
// Token: 0x040012DC RID: 4828
private const string urlC14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
// Token: 0x040012DD RID: 4829
private const string urlC14NWithComments = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";
// Token: 0x040012DE RID: 4830
private const string urlBase64 = "http://www.w3.org/2000/09/xmldsig#base64";
// Token: 0x040012DF RID: 4831
private const string urlXPath = "http://www.w3.org/TR/1999/REC-xpath-19991116";
// Token: 0x040012E0 RID: 4832
private const string urlXslt = "http://www.w3.org/TR/1999/REC-xslt-19991116";
// Token: 0x040012E1 RID: 4833
private const string urlEnveloped = "http://www.w3.org/2000/09/xmldsig#enveloped-signature";
// Token: 0x040012E2 RID: 4834
private const string urlXmlDecryption = "http://www.w3.org/2002/07/decrypt#XML";
// Token: 0x040012E3 RID: 4835
private const string urlExcC14NWithComments = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments";
// Token: 0x040012E4 RID: 4836
private const string urlExcC14N = "http://www.w3.org/2001/10/xml-exc-c14n#";
// Token: 0x040012E5 RID: 4837
private const string urlSHA256 = "http://www.w3.org/2001/04/xmlenc#sha256";
// Token: 0x040012E6 RID: 4838
private const string urlSHA512 = "http://www.w3.org/2001/04/xmlenc#sha512";
// Token: 0x040012E7 RID: 4839
private const string urlHMACSHA256 = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha256";
// Token: 0x040012E8 RID: 4840
private const string urlHMACSHA384 = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha384";
// Token: 0x040012E9 RID: 4841
private const string urlHMACSHA512 = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha512";
// Token: 0x040012EA RID: 4842
private const string urlHMACRIPEMD160 = "http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160";
// Token: 0x040012EB RID: 4843
private const string urlX509Data = "http://www.w3.org/2000/09/xmldsig# X509Data";
// Token: 0x040012EC RID: 4844
private const string urlKeyName = "http://www.w3.org/2000/09/xmldsig# KeyName";
// Token: 0x040012ED RID: 4845
private const string urlKeyValueDSA = "http://www.w3.org/2000/09/xmldsig# KeyValue/DSAKeyValue";
// Token: 0x040012EE RID: 4846
private const string urlKeyValueRSA = "http://www.w3.org/2000/09/xmldsig# KeyValue/RSAKeyValue";
// Token: 0x040012EF RID: 4847
private const string urlRetrievalMethod = "http://www.w3.org/2000/09/xmldsig# RetrievalMethod";
// Token: 0x040012F0 RID: 4848
private const string oidX509SubjectKeyIdentifier = "2.5.29.14";
// Token: 0x040012F1 RID: 4849
private const string oidX509KeyUsage = "2.5.29.15";
// Token: 0x040012F2 RID: 4850
private const string oidX509BasicConstraints = "2.5.29.19";
// Token: 0x040012F3 RID: 4851
private const string oidX509EnhancedKeyUsage = "2.5.29.37";
// Token: 0x040012F4 RID: 4852
private const string nameX509SubjectKeyIdentifier = "System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierExtension, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
// Token: 0x040012F5 RID: 4853
private const string nameX509KeyUsage = "System.Security.Cryptography.X509Certificates.X509KeyUsageExtension, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
// Token: 0x040012F6 RID: 4854
private const string nameX509BasicConstraints = "System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
// Token: 0x040012F7 RID: 4855
private const string nameX509EnhancedKeyUsage = "System.Security.Cryptography.X509Certificates.X509EnhancedKeyUsageExtension, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
// Token: 0x040012F8 RID: 4856
private const string nameX509Chain = "X509Chain";
// Token: 0x040012F9 RID: 4857
private const string defaultX509Chain = "System.Security.Cryptography.X509Certificates.X509Chain, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
// Token: 0x040012FA RID: 4858
private static object lockObject = new object();
// Token: 0x040012FB RID: 4859
private static Hashtable algorithms;
// Token: 0x040012FC RID: 4860
private static Hashtable oid;
// Token: 0x020004EE RID: 1262
private class CryptoHandler : SmallXmlParser.IContentHandler
{
// Token: 0x06002EB3 RID: 11955 RVA: 0x00095D1C File Offset: 0x00093F1C
public CryptoHandler(Hashtable algorithms, Hashtable oid)
{
this.algorithms = algorithms;
this.oid = oid;
this.names = new Hashtable();
this.classnames = new Hashtable();
}
// Token: 0x06002EB4 RID: 11956 RVA: 0x00095D54 File Offset: 0x00093F54
public void OnStartParsing(SmallXmlParser parser)
{
}
// Token: 0x06002EB5 RID: 11957 RVA: 0x00095D58 File Offset: 0x00093F58
public void OnEndParsing(SmallXmlParser parser)
{
foreach (object obj in this.names)
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)obj;
try
{
this.algorithms.Add(dictionaryEntry.Key, this.classnames[dictionaryEntry.Value]);
}
catch
{
}
}
this.names.Clear();
this.classnames.Clear();
}
// Token: 0x06002EB6 RID: 11958 RVA: 0x00095E20 File Offset: 0x00094020
private string Get(SmallXmlParser.IAttrList attrs, string name)
{
for (int i = 0; i < attrs.Names.Length; i++)
{
if (attrs.Names[i] == name)
{
return attrs.Values[i];
}
}
return string.Empty;
}
// Token: 0x06002EB7 RID: 11959 RVA: 0x00095E68 File Offset: 0x00094068
public void OnStartElement(string name, SmallXmlParser.IAttrList attrs)
{
switch (this.level)
{
case 0:
if (name == "configuration")
{
this.level++;
}
break;
case 1:
if (name == "mscorlib")
{
this.level++;
}
break;
case 2:
if (name == "cryptographySettings")
{
this.level++;
}
break;
case 3:
if (name == "oidMap")
{
this.level++;
}
else if (name == "cryptoNameMapping")
{
this.level++;
}
break;
case 4:
if (name == "oidEntry")
{
this.oid.Add(this.Get(attrs, "name"), this.Get(attrs, "OID"));
}
else if (name == "nameEntry")
{
this.names.Add(this.Get(attrs, "name"), this.Get(attrs, "class"));
}
else if (name == "cryptoClasses")
{
this.level++;
}
break;
case 5:
if (name == "cryptoClass")
{
this.classnames.Add(attrs.Names[0], attrs.Values[0]);
}
break;
}
}
// Token: 0x06002EB8 RID: 11960 RVA: 0x00096014 File Offset: 0x00094214
public void OnEndElement(string name)
{
switch (this.level)
{
case 1:
if (name == "configuration")
{
this.level--;
}
break;
case 2:
if (name == "mscorlib")
{
this.level--;
}
break;
case 3:
if (name == "cryptographySettings")
{
this.level--;
}
break;
case 4:
if (name == "oidMap" || name == "cryptoNameMapping")
{
this.level--;
}
break;
case 5:
if (name == "cryptoClasses")
{
this.level--;
}
break;
}
}
// Token: 0x06002EB9 RID: 11961 RVA: 0x00096108 File Offset: 0x00094308
public void OnProcessingInstruction(string name, string text)
{
}
// Token: 0x06002EBA RID: 11962 RVA: 0x0009610C File Offset: 0x0009430C
public void OnChars(string text)
{
}
// Token: 0x06002EBB RID: 11963 RVA: 0x00096110 File Offset: 0x00094310
public void OnIgnorableWhitespace(string text)
{
}
// Token: 0x040012FD RID: 4861
private Hashtable algorithms;
// Token: 0x040012FE RID: 4862
private Hashtable oid;
// Token: 0x040012FF RID: 4863
private Hashtable names;
// Token: 0x04001300 RID: 4864
private Hashtable classnames;
// Token: 0x04001301 RID: 4865
private int level;
}
}
}
@@ -0,0 +1,465 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Defines a stream that links data streams to cryptographic transformations.</summary>
// Token: 0x020004EF RID: 1263
[ComVisible(true)]
public class CryptoStream : Stream
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptoStream" /> class with a target data stream, the transformation to use, and the mode of the stream.</summary>
/// <param name="stream">The stream on which to perform the cryptographic transformation. </param>
/// <param name="transform">The cryptographic transformation that is to be performed on the stream. </param>
/// <param name="mode">One of the <see cref="T:System.Security.Cryptography.CryptoStreamMode" /> values. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="stream" /> is not readable.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="stream" /> is not writable.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="stream" /> is invalid.</exception>
// Token: 0x06002EBC RID: 11964 RVA: 0x00096114 File Offset: 0x00094314
public CryptoStream(Stream stream, ICryptoTransform transform, CryptoStreamMode mode)
{
if (mode == CryptoStreamMode.Read && !stream.CanRead)
{
throw new ArgumentException(Locale.GetText("Can't read on stream"));
}
if (mode == CryptoStreamMode.Write && !stream.CanWrite)
{
throw new ArgumentException(Locale.GetText("Can't write on stream"));
}
this._stream = stream;
this._transform = transform;
this._mode = mode;
this._disposed = false;
if (transform != null)
{
if (mode == CryptoStreamMode.Read)
{
this._currentBlock = new byte[transform.InputBlockSize];
this._workingBlock = new byte[transform.InputBlockSize];
}
else if (mode == CryptoStreamMode.Write)
{
this._currentBlock = new byte[transform.OutputBlockSize];
this._workingBlock = new byte[transform.OutputBlockSize];
}
}
}
// Token: 0x06002EBD RID: 11965 RVA: 0x000961E4 File Offset: 0x000943E4
~CryptoStream()
{
this.Dispose(false);
}
/// <summary>Gets a value indicating whether the current <see cref="T:System.Security.Cryptography.CryptoStream" /> is readable.</summary>
/// <returns>true if the current stream is readable; otherwise, false.</returns>
// Token: 0x17000935 RID: 2357
// (get) Token: 0x06002EBE RID: 11966 RVA: 0x00096220 File Offset: 0x00094420
public override bool CanRead
{
get
{
return this._mode == CryptoStreamMode.Read;
}
}
/// <summary>Gets a value indicating whether you can seek within the current <see cref="T:System.Security.Cryptography.CryptoStream" />.</summary>
/// <returns>Always false.</returns>
// Token: 0x17000936 RID: 2358
// (get) Token: 0x06002EBF RID: 11967 RVA: 0x0009622C File Offset: 0x0009442C
public override bool CanSeek
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the current <see cref="T:System.Security.Cryptography.CryptoStream" /> is writable.</summary>
/// <returns>true if the current stream is writable; otherwise, false.</returns>
// Token: 0x17000937 RID: 2359
// (get) Token: 0x06002EC0 RID: 11968 RVA: 0x00096230 File Offset: 0x00094430
public override bool CanWrite
{
get
{
return this._mode == CryptoStreamMode.Write;
}
}
/// <summary>Gets the length in bytes of the stream.</summary>
/// <returns>This property is not supported.</returns>
/// <exception cref="T:System.NotSupportedException">This property is not supported. </exception>
// Token: 0x17000938 RID: 2360
// (get) Token: 0x06002EC1 RID: 11969 RVA: 0x0009623C File Offset: 0x0009443C
public override long Length
{
get
{
throw new NotSupportedException("Length");
}
}
/// <summary>Gets or sets the position within the current stream.</summary>
/// <returns>This property is not supported.</returns>
/// <exception cref="T:System.NotSupportedException">This property is not supported. </exception>
// Token: 0x17000939 RID: 2361
// (get) Token: 0x06002EC2 RID: 11970 RVA: 0x00096248 File Offset: 0x00094448
// (set) Token: 0x06002EC3 RID: 11971 RVA: 0x00096254 File Offset: 0x00094454
public override long Position
{
get
{
throw new NotSupportedException("Position");
}
set
{
throw new NotSupportedException("Position");
}
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.CryptoStream" />.</summary>
// Token: 0x06002EC4 RID: 11972 RVA: 0x00096260 File Offset: 0x00094460
public void Clear()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.</summary>
/// <exception cref="T:System.NotSupportedException">The current stream is not writable. </exception>
// Token: 0x06002EC5 RID: 11973 RVA: 0x00096270 File Offset: 0x00094470
public override void Close()
{
if (!this._flushedFinalBlock && this._mode == CryptoStreamMode.Write)
{
this.FlushFinalBlock();
}
if (this._stream != null)
{
this._stream.Close();
}
}
/// <summary>Reads a sequence of bytes from the current <see cref="T:System.Security.Cryptography.CryptoStream" /> and advances the position within the stream by the number of bytes read.</summary>
/// <returns>The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream has been reached.</returns>
/// <param name="buffer">An array of bytes. A maximum of <paramref name="count" /> bytes are read from the current stream and stored in <paramref name="buffer" />. </param>
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin storing the data read from the current stream. </param>
/// <param name="count">The maximum number of bytes to be read from the current stream. </param>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Security.Cryptography.CryptoStreamMode" /> associated with current <see cref="T:System.Security.Cryptography.CryptoStream" /> object does not match the underlying stream. For example, this exception is thrown when using <see cref="F:System.Security.Cryptography.CryptoStreamMode.Read" /> with an underlying stream that is write only. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than zero.-or- The <paramref name="count" /> parameter is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">Thesum of the <paramref name="count" /> and <paramref name="offset" /> parameters is longer than the length of the buffer. </exception>
// Token: 0x06002EC6 RID: 11974 RVA: 0x000962A8 File Offset: 0x000944A8
public override int Read([In] [Out] byte[] buffer, int offset, int count)
{
if (this._mode != CryptoStreamMode.Read)
{
throw new NotSupportedException(Locale.GetText("not in Read mode"));
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", Locale.GetText("negative"));
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", Locale.GetText("negative"));
}
if (offset > buffer.Length - count)
{
throw new ArgumentException("(offset+count)", Locale.GetText("buffer overflow"));
}
if (this._workingBlock == null)
{
return 0;
}
int num = 0;
if (count == 0 || (this._transformedPos == this._transformedCount && this._endOfStream))
{
return num;
}
if (this._waitingBlock == null)
{
this._transformedBlock = new byte[this._transform.OutputBlockSize << 2];
this._transformedPos = 0;
this._transformedCount = 0;
this._waitingBlock = new byte[this._transform.InputBlockSize];
this._waitingCount = this._stream.Read(this._waitingBlock, 0, this._waitingBlock.Length);
}
while (count > 0)
{
int num2 = this._transformedCount - this._transformedPos;
if (num2 < this._transform.InputBlockSize)
{
int num3 = 0;
this._workingCount = this._stream.Read(this._workingBlock, 0, this._transform.InputBlockSize);
this._endOfStream = this._workingCount < this._transform.InputBlockSize;
if (!this._endOfStream)
{
num3 = this._transform.TransformBlock(this._waitingBlock, 0, this._waitingBlock.Length, this._transformedBlock, this._transformedCount);
Buffer.BlockCopy(this._workingBlock, 0, this._waitingBlock, 0, this._workingCount);
this._waitingCount = this._workingCount;
}
else
{
if (this._workingCount > 0)
{
num3 = this._transform.TransformBlock(this._waitingBlock, 0, this._waitingBlock.Length, this._transformedBlock, this._transformedCount);
Buffer.BlockCopy(this._workingBlock, 0, this._waitingBlock, 0, this._workingCount);
this._waitingCount = this._workingCount;
num2 += num3;
this._transformedCount += num3;
}
if (!this._flushedFinalBlock)
{
byte[] array = this._transform.TransformFinalBlock(this._waitingBlock, 0, this._waitingCount);
num3 = array.Length;
Buffer.BlockCopy(array, 0, this._transformedBlock, this._transformedCount, array.Length);
Array.Clear(array, 0, array.Length);
this._flushedFinalBlock = true;
}
}
num2 += num3;
this._transformedCount += num3;
}
if (this._transformedPos > this._transform.OutputBlockSize)
{
Buffer.BlockCopy(this._transformedBlock, this._transformedPos, this._transformedBlock, 0, num2);
this._transformedCount -= this._transformedPos;
this._transformedPos = 0;
}
num2 = ((count >= num2) ? num2 : count);
if (num2 > 0)
{
Buffer.BlockCopy(this._transformedBlock, this._transformedPos, buffer, offset, num2);
this._transformedPos += num2;
num += num2;
offset += num2;
count -= num2;
}
if ((num2 != this._transform.InputBlockSize && this._waitingCount != this._transform.InputBlockSize) || this._endOfStream)
{
count = 0;
}
}
return num;
}
/// <summary>Writes a sequence of bytes to the current <see cref="T:System.Security.Cryptography.CryptoStream" /> and advances the current position within this stream by the number of bytes written.</summary>
/// <param name="buffer">An array of bytes. This method copies <paramref name="count" /> bytes from <paramref name="buffer" /> to the current stream. </param>
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin copying bytes to the current stream. </param>
/// <param name="count">The number of bytes to be written to the current stream. </param>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Security.Cryptography.CryptoStreamMode" /> associated with current <see cref="T:System.Security.Cryptography.CryptoStream" /> object does not match the underlying stream. For example, this exception is thrown when using <see cref="F:System.Security.Cryptography.CryptoStreamMode.Write" /> with an underlying stream that is read only. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than zero.-or- The <paramref name="count" /> parameter is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">The sum of the <paramref name="count" /> and <paramref name="offset" /> parameters is longer than the length of the buffer. </exception>
// Token: 0x06002EC7 RID: 11975 RVA: 0x00096618 File Offset: 0x00094818
public override void Write(byte[] buffer, int offset, int count)
{
if (this._mode != CryptoStreamMode.Write)
{
throw new NotSupportedException(Locale.GetText("not in Write mode"));
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", Locale.GetText("negative"));
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", Locale.GetText("negative"));
}
if (offset > buffer.Length - count)
{
throw new ArgumentException("(offset+count)", Locale.GetText("buffer overflow"));
}
if (this._stream == null)
{
throw new ArgumentNullException("inner stream was diposed");
}
int num = count;
if (this._partialCount > 0 && this._partialCount != this._transform.InputBlockSize)
{
int num2 = this._transform.InputBlockSize - this._partialCount;
num2 = ((count >= num2) ? num2 : count);
Buffer.BlockCopy(buffer, offset, this._workingBlock, this._partialCount, num2);
this._partialCount += num2;
offset += num2;
count -= num2;
}
int num3 = offset;
while (count > 0)
{
if (this._partialCount == this._transform.InputBlockSize)
{
int num4 = this._transform.TransformBlock(this._workingBlock, 0, this._partialCount, this._currentBlock, 0);
this._stream.Write(this._currentBlock, 0, num4);
this._partialCount = 0;
}
if (this._transform.CanTransformMultipleBlocks)
{
int num5 = count & ~(this._transform.InputBlockSize - 1);
int num6 = count & (this._transform.InputBlockSize - 1);
int num7 = (1 + num5 / this._transform.InputBlockSize) * this._transform.OutputBlockSize;
if (this._workingBlock.Length < num7)
{
Array.Clear(this._workingBlock, 0, this._workingBlock.Length);
this._workingBlock = new byte[num7];
}
if (num5 > 0)
{
int num8 = this._transform.TransformBlock(buffer, offset, num5, this._workingBlock, 0);
this._stream.Write(this._workingBlock, 0, num8);
}
if (num6 > 0)
{
Buffer.BlockCopy(buffer, num - num6, this._workingBlock, 0, num6);
}
this._partialCount = num6;
count = 0;
}
else
{
int num9 = Math.Min(this._transform.InputBlockSize - this._partialCount, count);
Buffer.BlockCopy(buffer, num3, this._workingBlock, this._partialCount, num9);
num3 += num9;
this._partialCount += num9;
count -= num9;
}
}
}
/// <summary>Clears all buffers for this stream and causes any buffered data to be written to the underlying device.</summary>
// Token: 0x06002EC8 RID: 11976 RVA: 0x000968A8 File Offset: 0x00094AA8
public override void Flush()
{
if (this._stream != null)
{
this._stream.Flush();
}
}
/// <summary>Updates the underlying data source or repository with the current state of the buffer, then clears the buffer.</summary>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key is corrupt which can cause invalid padding to the stream. </exception>
/// <exception cref="T:System.NotSupportedException">The current stream is not writable.-or- The final block has already been transformed. </exception>
// Token: 0x06002EC9 RID: 11977 RVA: 0x000968C0 File Offset: 0x00094AC0
public void FlushFinalBlock()
{
if (this._flushedFinalBlock)
{
throw new NotSupportedException(Locale.GetText("This method cannot be called twice."));
}
if (this._disposed)
{
throw new NotSupportedException(Locale.GetText("CryptoStream was disposed."));
}
if (this._mode != CryptoStreamMode.Write)
{
return;
}
this._flushedFinalBlock = true;
byte[] array = this._transform.TransformFinalBlock(this._workingBlock, 0, this._partialCount);
if (this._stream != null)
{
this._stream.Write(array, 0, array.Length);
if (this._stream is CryptoStream)
{
(this._stream as CryptoStream).FlushFinalBlock();
}
this._stream.Flush();
}
Array.Clear(array, 0, array.Length);
}
/// <summary>Sets the position within the current stream.</summary>
/// <returns>This method is not supported.</returns>
/// <param name="offset">A byte offset relative to the <paramref name="origin" /> parameter. </param>
/// <param name="origin">A <see cref="T:System.IO.SeekOrigin" /> object indicating the reference point used to obtain the new position. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06002ECA RID: 11978 RVA: 0x00096980 File Offset: 0x00094B80
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException("Seek");
}
/// <summary>Sets the length of the current stream.</summary>
/// <param name="value">The desired length of the current stream in bytes. </param>
/// <exception cref="T:System.NotSupportedException">This property exists only to support inheritance from <see cref="T:System.IO.Stream" />, and cannot be used.</exception>
// Token: 0x06002ECB RID: 11979 RVA: 0x0009698C File Offset: 0x00094B8C
public override void SetLength(long value)
{
throw new NotSupportedException("SetLength");
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.CryptoStream" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002ECC RID: 11980 RVA: 0x00096998 File Offset: 0x00094B98
protected override void Dispose(bool disposing)
{
if (!this._disposed)
{
this._disposed = true;
if (this._workingBlock != null)
{
Array.Clear(this._workingBlock, 0, this._workingBlock.Length);
}
if (this._currentBlock != null)
{
Array.Clear(this._currentBlock, 0, this._currentBlock.Length);
}
if (disposing)
{
this._stream = null;
this._workingBlock = null;
this._currentBlock = null;
}
}
}
// Token: 0x04001302 RID: 4866
private Stream _stream;
// Token: 0x04001303 RID: 4867
private ICryptoTransform _transform;
// Token: 0x04001304 RID: 4868
private CryptoStreamMode _mode;
// Token: 0x04001305 RID: 4869
private byte[] _currentBlock;
// Token: 0x04001306 RID: 4870
private bool _disposed;
// Token: 0x04001307 RID: 4871
private bool _flushedFinalBlock;
// Token: 0x04001308 RID: 4872
private int _partialCount;
// Token: 0x04001309 RID: 4873
private bool _endOfStream;
// Token: 0x0400130A RID: 4874
private byte[] _waitingBlock;
// Token: 0x0400130B RID: 4875
private int _waitingCount;
// Token: 0x0400130C RID: 4876
private byte[] _transformedBlock;
// Token: 0x0400130D RID: 4877
private int _transformedPos;
// Token: 0x0400130E RID: 4878
private int _transformedCount;
// Token: 0x0400130F RID: 4879
private byte[] _workingBlock;
// Token: 0x04001310 RID: 4880
private int _workingCount;
}
}
@@ -0,0 +1,19 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Specifies the mode of a cryptographic stream.</summary>
// Token: 0x020004F0 RID: 1264
[ComVisible(true)]
[Serializable]
public enum CryptoStreamMode
{
/// <summary>Read access to a cryptographic stream.</summary>
// Token: 0x04001312 RID: 4882
Read,
/// <summary>Write access to a cryptographic stream.</summary>
// Token: 0x04001313 RID: 4883
Write
}
}
@@ -0,0 +1,67 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.Security.Cryptography
{
/// <summary>The exception that is thrown when an error occurs during a cryptographic operation.</summary>
// Token: 0x020004F1 RID: 1265
[ComVisible(true)]
[Serializable]
public class CryptographicException : SystemException, _Exception
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicException" /> class with default properties.</summary>
// Token: 0x06002ECD RID: 11981 RVA: 0x00096A10 File Offset: 0x00094C10
public CryptographicException()
: base(Locale.GetText("Error occured during a cryptographic operation."))
{
base.HResult = -2146233296;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicException" /> class with the specified HRESULT error code.</summary>
/// <param name="hr">The HRESULT error code. </param>
// Token: 0x06002ECE RID: 11982 RVA: 0x00096A30 File Offset: 0x00094C30
public CryptographicException(int hr)
{
base.HResult = hr;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicException" /> class with a specified error message.</summary>
/// <param name="message">The error message that explains the reason for the exception. </param>
// Token: 0x06002ECF RID: 11983 RVA: 0x00096A40 File Offset: 0x00094C40
public CryptographicException(string message)
: base(message)
{
base.HResult = -2146233296;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</summary>
/// <param name="message">The error message that explains the reason for the exception. </param>
/// <param name="inner">The exception that is the cause of the current exception. If the <paramref name="inner" /> parameter is not null, the current exception is raised in a catch block that handles the inner exception. </param>
// Token: 0x06002ED0 RID: 11984 RVA: 0x00096A54 File Offset: 0x00094C54
public CryptographicException(string message, Exception inner)
: base(message, inner)
{
base.HResult = -2146233296;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicException" /> class with a specified error message in the specified format.</summary>
/// <param name="format">The format used to output the error message. </param>
/// <param name="insert">The error message that explains the reason for the exception. </param>
// Token: 0x06002ED1 RID: 11985 RVA: 0x00096A6C File Offset: 0x00094C6C
public CryptographicException(string format, string insert)
: base(string.Format(format, insert))
{
base.HResult = -2146233296;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicException" /> class with serialized data.</summary>
/// <param name="info">The object that holds the serialized object data. </param>
/// <param name="context">The contextual information about the source or destination. </param>
// Token: 0x06002ED2 RID: 11986 RVA: 0x00096A88 File Offset: 0x00094C88
protected CryptographicException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
@@ -0,0 +1,59 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.Security.Cryptography
{
/// <summary>The exception that is thrown when an unexpected operation occurs during a cryptographic operation.</summary>
// Token: 0x020004F2 RID: 1266
[ComVisible(true)]
[Serializable]
public class CryptographicUnexpectedOperationException : CryptographicException
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException" /> class with default properties.</summary>
// Token: 0x06002ED3 RID: 11987 RVA: 0x00096A94 File Offset: 0x00094C94
public CryptographicUnexpectedOperationException()
: base(Locale.GetText("Unexpected error occured during a cryptographic operation."))
{
base.HResult = -2146233295;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException" /> class with a specified error message.</summary>
/// <param name="message">The error message that explains the reason for the exception. </param>
// Token: 0x06002ED4 RID: 11988 RVA: 0x00096AB4 File Offset: 0x00094CB4
public CryptographicUnexpectedOperationException(string message)
: base(message)
{
base.HResult = -2146233295;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</summary>
/// <param name="message">The error message that explains the reason for the exception. </param>
/// <param name="inner">The exception that is the cause of the current exception. If the <paramref name="inner" /> parameter is not null, the current exception is raised in a catch block that handles the inner exception. </param>
// Token: 0x06002ED5 RID: 11989 RVA: 0x00096AC8 File Offset: 0x00094CC8
public CryptographicUnexpectedOperationException(string message, Exception inner)
: base(message, inner)
{
base.HResult = -2146233295;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException" /> class with a specified error message in the specified format.</summary>
/// <param name="format">The format used to output the error message. </param>
/// <param name="insert">The error message that explains the reason for the exception. </param>
// Token: 0x06002ED6 RID: 11990 RVA: 0x00096AE0 File Offset: 0x00094CE0
public CryptographicUnexpectedOperationException(string format, string insert)
: base(string.Format(format, insert))
{
base.HResult = -2146233295;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException" /> class with serialized data.</summary>
/// <param name="info">The object that holds the serialized object data. </param>
/// <param name="context">The contextual information about the source or destination. </param>
// Token: 0x06002ED7 RID: 11991 RVA: 0x00096AFC File Offset: 0x00094CFC
protected CryptographicUnexpectedOperationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
@@ -0,0 +1,194 @@
using System;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
namespace System.Security.Cryptography
{
/// <summary>Provides additional information about a cryptographic key pair. This class cannot be inherited.</summary>
// Token: 0x020004F3 RID: 1267
[ComVisible(true)]
public sealed class CspKeyContainerInfo
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CspKeyContainerInfo" /> class using the specified parameters.</summary>
/// <param name="parameters">A <see cref="T:System.Security.Cryptography.CspParameters" /> object that provides information about the key.</param>
// Token: 0x06002ED8 RID: 11992 RVA: 0x00096B08 File Offset: 0x00094D08
public CspKeyContainerInfo(CspParameters parameters)
{
this._params = parameters;
this._random = true;
}
/// <summary>Gets a value indicating whether a key in a key container is accessible.</summary>
/// <returns>true if the key is accessible; otherwise, false.</returns>
/// <exception cref="T:System.NotSupportedException">The key type is not supported.</exception>
// Token: 0x1700093A RID: 2362
// (get) Token: 0x06002ED9 RID: 11993 RVA: 0x00096B20 File Offset: 0x00094D20
public bool Accessible
{
get
{
return true;
}
}
/// <summary>Gets a <see cref="T:System.Security.AccessControl.CryptoKeySecurity" /> object that represents access rights and audit rules for a container. </summary>
/// <returns>A <see cref="T:System.Security.AccessControl.CryptoKeySecurity" /> object that represents access rights and audit rules for a container.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key type is not supported.</exception>
/// <exception cref="T:System.NotSupportedException">The cryptographic service provider cannot be found.-or-The key container was not found.</exception>
// Token: 0x1700093B RID: 2363
// (get) Token: 0x06002EDA RID: 11994 RVA: 0x00096B24 File Offset: 0x00094D24
public CryptoKeySecurity CryptoKeySecurity
{
get
{
return null;
}
}
/// <summary>Gets a value indicating whether a key can be exported from a key container.</summary>
/// <returns>true if the key can be exported; otherwise, false.</returns>
/// <exception cref="T:System.NotSupportedException">The key type is not supported.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider cannot be found.-or-The key container was not found.</exception>
// Token: 0x1700093C RID: 2364
// (get) Token: 0x06002EDB RID: 11995 RVA: 0x00096B28 File Offset: 0x00094D28
public bool Exportable
{
get
{
return true;
}
}
/// <summary>Gets a value indicating whether a key is a hardware key.</summary>
/// <returns>true if the key is a hardware key; otherwise, false.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider cannot be found.</exception>
// Token: 0x1700093D RID: 2365
// (get) Token: 0x06002EDC RID: 11996 RVA: 0x00096B2C File Offset: 0x00094D2C
public bool HardwareDevice
{
get
{
return false;
}
}
/// <summary>Gets a key container name.</summary>
/// <returns>The key container name.</returns>
// Token: 0x1700093E RID: 2366
// (get) Token: 0x06002EDD RID: 11997 RVA: 0x00096B30 File Offset: 0x00094D30
public string KeyContainerName
{
get
{
return this._params.KeyContainerName;
}
}
/// <summary>Gets a value that describes whether an asymmetric key was created as a signature key or an exchange key.</summary>
/// <returns>One of the <see cref="T:System.Security.Cryptography.KeyNumber" /> values that describes whether an asymmetric key was created as a signature key or an exchange key.</returns>
// Token: 0x1700093F RID: 2367
// (get) Token: 0x06002EDE RID: 11998 RVA: 0x00096B40 File Offset: 0x00094D40
public KeyNumber KeyNumber
{
get
{
return (KeyNumber)this._params.KeyNumber;
}
}
/// <summary>Gets a value indicating whether a key is from a machine key set.</summary>
/// <returns>true if the key is from the machine key set; otherwise, false.</returns>
// Token: 0x17000940 RID: 2368
// (get) Token: 0x06002EDF RID: 11999 RVA: 0x00096B50 File Offset: 0x00094D50
public bool MachineKeyStore
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether a key pair is protected.</summary>
/// <returns>true if the key pair is protected; otherwise, false.</returns>
/// <exception cref="T:System.NotSupportedException">The key type is not supported.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider cannot be found.-or-The key container was not found.</exception>
// Token: 0x17000941 RID: 2369
// (get) Token: 0x06002EE0 RID: 12000 RVA: 0x00096B54 File Offset: 0x00094D54
public bool Protected
{
get
{
return false;
}
}
/// <summary>Gets the provider name of a key.</summary>
/// <returns>The provider name.</returns>
// Token: 0x17000942 RID: 2370
// (get) Token: 0x06002EE1 RID: 12001 RVA: 0x00096B58 File Offset: 0x00094D58
public string ProviderName
{
get
{
return this._params.ProviderName;
}
}
/// <summary>Gets the provider type of a key.</summary>
/// <returns>The provider type. The default is 1.</returns>
// Token: 0x17000943 RID: 2371
// (get) Token: 0x06002EE2 RID: 12002 RVA: 0x00096B68 File Offset: 0x00094D68
public int ProviderType
{
get
{
return this._params.ProviderType;
}
}
/// <summary>Gets a value indicating whether a key container was randomly generated by a managed cryptography class.</summary>
/// <returns>true if the key container was randomly generated; otherwise, false.</returns>
// Token: 0x17000944 RID: 2372
// (get) Token: 0x06002EE3 RID: 12003 RVA: 0x00096B78 File Offset: 0x00094D78
public bool RandomlyGenerated
{
get
{
return this._random;
}
}
/// <summary>Gets a value indicating whether a key can be removed from a key container.</summary>
/// <returns>true if the key is removable; otherwise, false.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) was not found.</exception>
// Token: 0x17000945 RID: 2373
// (get) Token: 0x06002EE4 RID: 12004 RVA: 0x00096B80 File Offset: 0x00094D80
public bool Removable
{
get
{
return false;
}
}
/// <summary>Gets a unique key container name.</summary>
/// <returns>The unique key container name.</returns>
/// <exception cref="T:System.NotSupportedException">The key type is not supported.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider cannot be found.-or-The key container was not found.</exception>
// Token: 0x17000946 RID: 2374
// (get) Token: 0x06002EE5 RID: 12005 RVA: 0x00096B84 File Offset: 0x00094D84
public string UniqueKeyContainerName
{
get
{
return this._params.ProviderName + "\\" + this._params.KeyContainerName;
}
}
// Token: 0x04001314 RID: 4884
private CspParameters _params;
// Token: 0x04001315 RID: 4885
internal bool _random;
}
}
@@ -0,0 +1,177 @@
using System;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
namespace System.Security.Cryptography
{
/// <summary>Contains parameters that are passed to the cryptographic service provider (CSP) that performs cryptographic computations. This class cannot be inherited.</summary>
// Token: 0x020004F4 RID: 1268
[ComVisible(true)]
public sealed class CspParameters
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CspParameters" /> class.</summary>
// Token: 0x06002EE6 RID: 12006 RVA: 0x00096BB4 File Offset: 0x00094DB4
public CspParameters()
: this(1)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CspParameters" /> class with the specified provider type code.</summary>
/// <param name="dwTypeIn">A provider type code that specifies the kind of provider to create. </param>
// Token: 0x06002EE7 RID: 12007 RVA: 0x00096BC0 File Offset: 0x00094DC0
public CspParameters(int dwTypeIn)
: this(dwTypeIn, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CspParameters" /> class with the specified provider type code and name.</summary>
/// <param name="dwTypeIn">A provider type code that specifies the kind of provider to create.</param>
/// <param name="strProviderNameIn">A provider name. </param>
// Token: 0x06002EE8 RID: 12008 RVA: 0x00096BCC File Offset: 0x00094DCC
public CspParameters(int dwTypeIn, string strProviderNameIn)
: this(dwTypeIn, null, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CspParameters" /> class with the specified provider type code and name, and the specified container name.</summary>
/// <param name="dwTypeIn">The provider type code that specifies the kind of provider to create.</param>
/// <param name="strProviderNameIn">A provider name. </param>
/// <param name="strContainerNameIn">A container name. </param>
// Token: 0x06002EE9 RID: 12009 RVA: 0x00096BD8 File Offset: 0x00094DD8
public CspParameters(int dwTypeIn, string strProviderNameIn, string strContainerNameIn)
{
this.ProviderType = dwTypeIn;
this.ProviderName = strProviderNameIn;
this.KeyContainerName = strContainerNameIn;
this.KeyNumber = -1;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CspParameters" /> class using a provider type, a provider name, a container name, access information, and a handle to an unmanaged smart card password dialog. </summary>
/// <param name="providerType">The provider type code that specifies the kind of provider to create.</param>
/// <param name="providerName">A provider name. </param>
/// <param name="keyContainerName">A container name. </param>
/// <param name="cryptoKeySecurity">A <see cref="T:System.Security.AccessControl.CryptoKeySecurity" /> object that represents access rights and audit rules for the container.</param>
/// <param name="parentWindowHandle">A handle to the parent window for a smart card password dialog.</param>
// Token: 0x06002EEA RID: 12010 RVA: 0x00096C08 File Offset: 0x00094E08
public CspParameters(int providerType, string providerName, string keyContainerName, CryptoKeySecurity cryptoKeySecurity, IntPtr parentWindowHandle)
: this(providerType, providerName, keyContainerName)
{
if (cryptoKeySecurity != null)
{
this.CryptoKeySecurity = cryptoKeySecurity;
}
this._windowHandle = parentWindowHandle;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.CspParameters" /> class using a provider type, a provider name, a container name, access information, and a password associated with a smart card key.</summary>
/// <param name="providerType">The provider type code that specifies the kind of provider to create.</param>
/// <param name="providerName">A provider name. </param>
/// <param name="keyContainerName">A container name. </param>
/// <param name="cryptoKeySecurity">A <see cref="T:System.Security.AccessControl.CryptoKeySecurity" /> object that represents access rights and audit rules for a container. </param>
/// <param name="keyPassword">A password associated with a smart card key.</param>
// Token: 0x06002EEB RID: 12011 RVA: 0x00096C38 File Offset: 0x00094E38
public CspParameters(int providerType, string providerName, string keyContainerName, CryptoKeySecurity cryptoKeySecurity, SecureString keyPassword)
: this(providerType, providerName, keyContainerName)
{
if (cryptoKeySecurity != null)
{
this.CryptoKeySecurity = cryptoKeySecurity;
}
this._password = keyPassword;
}
/// <summary>Represents the flags for <see cref="T:System.Security.Cryptography.CspParameters" /> that modify the behavior of the cryptographic service provider (CSP).</summary>
/// <returns>An enumeration value, or a bitwise combination of enumeration values.</returns>
// Token: 0x17000947 RID: 2375
// (get) Token: 0x06002EEC RID: 12012 RVA: 0x00096C68 File Offset: 0x00094E68
// (set) Token: 0x06002EED RID: 12013 RVA: 0x00096C70 File Offset: 0x00094E70
public CspProviderFlags Flags
{
get
{
return this._Flags;
}
set
{
this._Flags = value;
}
}
/// <summary>Gets or sets a <see cref="T:System.Security.AccessControl.CryptoKeySecurity" /> object that represents access rights and audit rules for a container. </summary>
/// <returns>A <see cref="T:System.Security.AccessControl.CryptoKeySecurity" /> object that represents access rights and audit rules for a container.</returns>
// Token: 0x17000948 RID: 2376
// (get) Token: 0x06002EEE RID: 12014 RVA: 0x00096C7C File Offset: 0x00094E7C
// (set) Token: 0x06002EEF RID: 12015 RVA: 0x00096C84 File Offset: 0x00094E84
[MonoTODO("access control isn't implemented")]
public CryptoKeySecurity CryptoKeySecurity
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
/// <summary>Gets or sets a password associated with a smart card key. </summary>
/// <returns>A password associated with a smart card key.</returns>
// Token: 0x17000949 RID: 2377
// (get) Token: 0x06002EF0 RID: 12016 RVA: 0x00096C8C File Offset: 0x00094E8C
// (set) Token: 0x06002EF1 RID: 12017 RVA: 0x00096C94 File Offset: 0x00094E94
public SecureString KeyPassword
{
get
{
return this._password;
}
set
{
this._password = value;
}
}
/// <summary>Gets or sets a handle to the unmanaged parent window for a smart card password dialog.</summary>
/// <returns>A handle to the parent window for a smart card password dialog.</returns>
// Token: 0x1700094A RID: 2378
// (get) Token: 0x06002EF2 RID: 12018 RVA: 0x00096CA0 File Offset: 0x00094EA0
// (set) Token: 0x06002EF3 RID: 12019 RVA: 0x00096CA8 File Offset: 0x00094EA8
public IntPtr ParentWindowHandle
{
get
{
return this._windowHandle;
}
set
{
this._windowHandle = value;
}
}
// Token: 0x04001316 RID: 4886
private CspProviderFlags _Flags;
/// <summary>Represents the key container name for <see cref="T:System.Security.Cryptography.CspParameters" />.</summary>
// Token: 0x04001317 RID: 4887
public string KeyContainerName;
/// <summary>Specifies whether an asymmetric key is created as a signature key or an exchange key.</summary>
// Token: 0x04001318 RID: 4888
public int KeyNumber;
/// <summary>Represents the provider name for <see cref="T:System.Security.Cryptography.CspParameters" />.</summary>
// Token: 0x04001319 RID: 4889
public string ProviderName;
/// <summary>Represents the provider type code for <see cref="T:System.Security.Cryptography.CspParameters" />.</summary>
// Token: 0x0400131A RID: 4890
public int ProviderType;
// Token: 0x0400131B RID: 4891
private SecureString _password;
// Token: 0x0400131C RID: 4892
private IntPtr _windowHandle;
}
}
@@ -0,0 +1,38 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Specifies flags that modify the behavior of the cryptographic service providers (CSP).</summary>
// Token: 0x020004F5 RID: 1269
[Flags]
[ComVisible(true)]
[Serializable]
public enum CspProviderFlags
{
/// <summary>Use key information from the computer's key store.</summary>
// Token: 0x0400131E RID: 4894
UseMachineKeyStore = 1,
/// <summary>Use key information from the default key container.</summary>
// Token: 0x0400131F RID: 4895
UseDefaultKeyContainer = 2,
/// <summary>Use key information from the current key.</summary>
// Token: 0x04001320 RID: 4896
UseExistingKey = 8,
/// <summary>Don't specify any settings.</summary>
// Token: 0x04001321 RID: 4897
NoFlags = 0,
/// <summary>Prevent the CSP from displaying any user interface (UI) for this context.</summary>
// Token: 0x04001322 RID: 4898
NoPrompt = 64,
/// <summary>Allow a key to be exported for archival or recovery.</summary>
// Token: 0x04001323 RID: 4899
UseArchivableKey = 16,
/// <summary>Use key information that can not be exported.</summary>
// Token: 0x04001324 RID: 4900
UseNonExportableKey = 4,
/// <summary>Notify the user through a dialog box or another method when certain actions are attempting to use a key. This flag is not compatible with the <see cref="F:System.Security.Cryptography.CspProviderFlags.NoPrompt" /> flag.</summary>
// Token: 0x04001325 RID: 4901
UseUserProtectedKey = 32
}
}
@@ -0,0 +1,195 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class for the Data Encryption Standard (DES) algorithm from which all <see cref="T:System.Security.Cryptography.DES" /> implementations must derive.</summary>
// Token: 0x020004F6 RID: 1270
[ComVisible(true)]
public abstract class DES : SymmetricAlgorithm
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DES" /> class.</summary>
// Token: 0x06002EF4 RID: 12020 RVA: 0x00096CB4 File Offset: 0x00094EB4
protected DES()
{
this.KeySizeValue = 64;
this.BlockSizeValue = 64;
this.FeedbackSizeValue = 8;
this.LegalKeySizesValue = new KeySizes[1];
this.LegalKeySizesValue[0] = new KeySizes(64, 64, 0);
this.LegalBlockSizesValue = new KeySizes[1];
this.LegalBlockSizesValue[0] = new KeySizes(64, 64, 0);
}
/// <summary>Creates an instance of a cryptographic object to perform the Data Encryption Standard (<see cref="T:System.Security.Cryptography.DES" />) algorithm.</summary>
/// <returns>A cryptographic object.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002EF6 RID: 12022 RVA: 0x00096D58 File Offset: 0x00094F58
public new static DES Create()
{
return DES.Create("System.Security.Cryptography.DES");
}
/// <summary>Creates an instance of a cryptographic object to perform the specified implementation of the Data Encryption Standard (<see cref="T:System.Security.Cryptography.DES" />) algorithm.</summary>
/// <returns>A cryptographic object.</returns>
/// <param name="algName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.DES" /> to use. </param>
// Token: 0x06002EF7 RID: 12023 RVA: 0x00096D64 File Offset: 0x00094F64
public new static DES Create(string algName)
{
return (DES)CryptoConfig.CreateFromName(algName);
}
/// <summary>Determines whether the specified key is weak.</summary>
/// <returns>true if the key is weak; otherwise, false.</returns>
/// <param name="rgbKey">The secret key to test for weakness. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The size of the <paramref name="rgbKey" /> parameter is not valid. </exception>
// Token: 0x06002EF8 RID: 12024 RVA: 0x00096D74 File Offset: 0x00094F74
public static bool IsWeakKey(byte[] rgbKey)
{
if (rgbKey == null)
{
throw new CryptographicException(Locale.GetText("Null Key"));
}
if (rgbKey.Length != 8)
{
throw new CryptographicException(Locale.GetText("Wrong Key Length"));
}
for (int i = 0; i < rgbKey.Length; i++)
{
int num = (int)(rgbKey[i] | 17);
if (num != 17 && num != 31 && num != 241 && num != 255)
{
return false;
}
}
for (int j = 0; j < DES.weakKeys.Length >> 3; j++)
{
int k;
for (k = 0; k < rgbKey.Length; k++)
{
if ((rgbKey[k] ^ DES.weakKeys[j, k]) > 1)
{
break;
}
}
if (k == 8)
{
return true;
}
}
return false;
}
/// <summary>Determines whether the specified key is semi-weak.</summary>
/// <returns>true if the key is semi-weak; otherwise, false.</returns>
/// <param name="rgbKey">The secret key to test for semi-weakness. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The size of the <paramref name="rgbKey" /> parameter is not valid. </exception>
// Token: 0x06002EF9 RID: 12025 RVA: 0x00096E54 File Offset: 0x00095054
public static bool IsSemiWeakKey(byte[] rgbKey)
{
if (rgbKey == null)
{
throw new CryptographicException(Locale.GetText("Null Key"));
}
if (rgbKey.Length != 8)
{
throw new CryptographicException(Locale.GetText("Wrong Key Length"));
}
for (int i = 0; i < rgbKey.Length; i++)
{
int num = (int)(rgbKey[i] | 17);
if (num != 17 && num != 31 && num != 241 && num != 255)
{
return false;
}
}
for (int j = 0; j < DES.semiWeakKeys.Length >> 3; j++)
{
int k;
for (k = 0; k < rgbKey.Length; k++)
{
if ((rgbKey[k] ^ DES.semiWeakKeys[j, k]) > 1)
{
break;
}
}
if (k == 8)
{
return true;
}
}
return false;
}
/// <summary>Gets or sets the secret key for the Data Encryption Standard (<see cref="T:System.Security.Cryptography.DES" />) algorithm.</summary>
/// <returns>The secret key for the <see cref="T:System.Security.Cryptography.DES" /> algorithm.</returns>
/// <exception cref="T:System.ArgumentNullException">An attempt was made to set the key to null. </exception>
/// <exception cref="T:System.ArgumentException">An attempt was made to set a key whose length is not equal to <see cref="F:System.Security.Cryptography.SymmetricAlgorithm.BlockSizeValue" />. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An attempt was made to set a weak key (see <see cref="M:System.Security.Cryptography.DES.IsWeakKey(System.Byte[])" />) or a semi-weak key (see <see cref="M:System.Security.Cryptography.DES.IsSemiWeakKey(System.Byte[])" />). </exception>
// Token: 0x1700094B RID: 2379
// (get) Token: 0x06002EFA RID: 12026 RVA: 0x00096F34 File Offset: 0x00095134
// (set) Token: 0x06002EFB RID: 12027 RVA: 0x00096F58 File Offset: 0x00095158
public override byte[] Key
{
get
{
if (this.KeyValue == null)
{
this.GenerateKey();
}
return (byte[])this.KeyValue.Clone();
}
set
{
if (value == null)
{
throw new ArgumentNullException("Key");
}
if (value.Length != 8)
{
throw new ArgumentException(Locale.GetText("Wrong Key Length"));
}
if (DES.IsWeakKey(value))
{
throw new CryptographicException(Locale.GetText("Weak Key"));
}
if (DES.IsSemiWeakKey(value))
{
throw new CryptographicException(Locale.GetText("Semi Weak Key"));
}
this.KeyValue = (byte[])value.Clone();
}
}
// Token: 0x04001326 RID: 4902
private const int keySizeByte = 8;
// Token: 0x04001327 RID: 4903
internal static readonly byte[,] weakKeys = new byte[,]
{
{ 1, 1, 1, 1, 1, 1, 1, 1 },
{ 31, 31, 31, 31, 15, 15, 15, 15 },
{ 225, 225, 225, 225, 241, 241, 241, 241 },
{ byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue }
};
// Token: 0x04001328 RID: 4904
internal static readonly byte[,] semiWeakKeys = new byte[,]
{
{ 0, 30, 0, 30, 0, 14, 0, 14 },
{ 0, 224, 0, 224, 0, 240, 0, 240 },
{ 0, 254, 0, 254, 0, 254, 0, 254 },
{ 30, 0, 30, 0, 14, 0, 14, 0 },
{ 30, 224, 30, 224, 14, 240, 14, 240 },
{ 30, 254, 30, 254, 14, 254, 14, 254 },
{ 224, 0, 224, 0, 240, 0, 240, 0 },
{ 224, 30, 224, 30, 240, 14, 240, 14 },
{ 224, 254, 224, 254, 240, 254, 240, 254 },
{ 254, 0, 254, 0, 254, 0, 254, 0 },
{ 254, 30, 254, 30, 254, 14, 254, 14 },
{ 254, 224, 254, 224, 254, 240, 254, 240 }
};
}
}
@@ -0,0 +1,54 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Defines a wrapper object to access the cryptographic service provider (CSP) version of the Data Encryption Standard (<see cref="T:System.Security.Cryptography.DES" />) algorithm. This class cannot be inherited.</summary>
// Token: 0x020004F8 RID: 1272
[ComVisible(true)]
public sealed class DESCryptoServiceProvider : DES
{
/// <summary>Creates a symmetric Data Encryption Standard (<see cref="T:System.Security.Cryptography.DES" />) decryptor object with the specified key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />) and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric <see cref="T:System.Security.Cryptography.DES" /> decryptor object.</returns>
/// <param name="rgbKey">The secret key to use for the symmetric algorithm. </param>
/// <param name="rgbIV">The initialization vector to use for the symmetric algorithm. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> property is <see cref="F:System.Security.Cryptography.CipherMode.OFB" />.-or-The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" />property is <see cref="F:System.Security.Cryptography.CipherMode.CFB" />, and the value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.FeedbackSize" /> property is not 8.-or-An invalid key size was used.-or-The algorithm key size was not available.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F06 RID: 12038 RVA: 0x000977E0 File Offset: 0x000959E0
public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
{
return new DESTransform(this, false, rgbKey, rgbIV);
}
/// <summary>Creates a symmetric Data Encryption Standard (<see cref="T:System.Security.Cryptography.DES" />) encryptor object with the specified key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />) and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric <see cref="T:System.Security.Cryptography.DES" /> encryptor object.</returns>
/// <param name="rgbKey">The secret key to use for the symmetric algorithm. </param>
/// <param name="rgbIV">The initialization vector to use for the symmetric algorithm. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> property is <see cref="F:System.Security.Cryptography.CipherMode.OFB" />.-or-The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> property is <see cref="F:System.Security.Cryptography.CipherMode.CFB" /> and the value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.FeedbackSize" /> property is not 8.-or-An invalid key size was used.-or-The algorithm key size was not available.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F07 RID: 12039 RVA: 0x000977EC File Offset: 0x000959EC
public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
{
return new DESTransform(this, true, rgbKey, rgbIV);
}
/// <summary>Generates a random initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />) to use for the algorithm.</summary>
// Token: 0x06002F08 RID: 12040 RVA: 0x000977F8 File Offset: 0x000959F8
public override void GenerateIV()
{
this.IVValue = KeyBuilder.IV(DESTransform.BLOCK_BYTE_SIZE);
}
/// <summary>Generates a random key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />) to be used for the algorithm.</summary>
// Token: 0x06002F09 RID: 12041 RVA: 0x0009780C File Offset: 0x00095A0C
public override void GenerateKey()
{
this.KeyValue = DESTransform.GetStrongKey();
}
}
}
@@ -0,0 +1,450 @@
using System;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
// Token: 0x020004F7 RID: 1271
internal class DESTransform : SymmetricTransform
{
// Token: 0x06002EFC RID: 12028 RVA: 0x00096FD8 File Offset: 0x000951D8
internal DESTransform(SymmetricAlgorithm symmAlgo, bool encryption, byte[] key, byte[] iv)
: base(symmAlgo, encryption, iv)
{
byte[] array = null;
if (key == null)
{
key = DESTransform.GetStrongKey();
array = key;
}
if (DES.IsWeakKey(key) || DES.IsSemiWeakKey(key))
{
string text = Locale.GetText("This is a known weak, or semi-weak, key.");
throw new CryptographicException(text);
}
if (array == null)
{
array = (byte[])key.Clone();
}
this.keySchedule = new byte[DESTransform.KEY_BYTE_SIZE * 16];
this.byteBuff = new byte[DESTransform.BLOCK_BYTE_SIZE];
this.dwordBuff = new uint[DESTransform.BLOCK_BYTE_SIZE / 4];
this.SetKey(array);
}
// Token: 0x06002EFE RID: 12030 RVA: 0x00097140 File Offset: 0x00095340
private uint CipherFunct(uint r, int n)
{
uint num = 0U;
byte[] array = this.keySchedule;
int num2 = n << 3;
uint num3 = (r >> 1) | (r << 31);
num |= DESTransform.spBoxes[(int)((UIntPtr)(0U + (((num3 >> 26) ^ (uint)array[num2++]) & 63U)))];
num |= DESTransform.spBoxes[(int)((UIntPtr)(64U + (((num3 >> 22) ^ (uint)array[num2++]) & 63U)))];
num |= DESTransform.spBoxes[(int)((UIntPtr)(128U + (((num3 >> 18) ^ (uint)array[num2++]) & 63U)))];
num |= DESTransform.spBoxes[(int)((UIntPtr)(192U + (((num3 >> 14) ^ (uint)array[num2++]) & 63U)))];
num |= DESTransform.spBoxes[(int)((UIntPtr)(256U + (((num3 >> 10) ^ (uint)array[num2++]) & 63U)))];
num |= DESTransform.spBoxes[(int)((UIntPtr)(320U + (((num3 >> 6) ^ (uint)array[num2++]) & 63U)))];
num |= DESTransform.spBoxes[(int)((UIntPtr)(384U + (((num3 >> 2) ^ (uint)array[num2++]) & 63U)))];
num3 = (r << 1) | (r >> 31);
return num | DESTransform.spBoxes[(int)((UIntPtr)(448U + ((num3 ^ (uint)array[num2]) & 63U)))];
}
// Token: 0x06002EFF RID: 12031 RVA: 0x00097258 File Offset: 0x00095458
internal static void Permutation(byte[] input, byte[] output, uint[] permTab, bool preSwap)
{
if (preSwap && BitConverter.IsLittleEndian)
{
DESTransform.BSwap(input);
}
int num = input[0] >> 4 << 1;
int num2 = 32 + ((int)(input[0] & 15) << 1);
uint num3 = permTab[num++] | permTab[num2++];
uint num4 = permTab[num] | permTab[num2];
int num5 = DESTransform.BLOCK_BYTE_SIZE << 1;
int i = 2;
int num6 = 1;
while (i < num5)
{
int num7 = (int)input[num6];
num = (i << 5) + (num7 >> 4 << 1);
num2 = (i + 1 << 5) + ((num7 & 15) << 1);
num3 |= permTab[num++] | permTab[num2++];
num4 |= permTab[num] | permTab[num2];
i += 2;
num6++;
}
if (preSwap || !BitConverter.IsLittleEndian)
{
output[0] = (byte)num3;
output[1] = (byte)(num3 >> 8);
output[2] = (byte)(num3 >> 16);
output[3] = (byte)(num3 >> 24);
output[4] = (byte)num4;
output[5] = (byte)(num4 >> 8);
output[6] = (byte)(num4 >> 16);
output[7] = (byte)(num4 >> 24);
}
else
{
output[0] = (byte)(num3 >> 24);
output[1] = (byte)(num3 >> 16);
output[2] = (byte)(num3 >> 8);
output[3] = (byte)num3;
output[4] = (byte)(num4 >> 24);
output[5] = (byte)(num4 >> 16);
output[6] = (byte)(num4 >> 8);
output[7] = (byte)num4;
}
}
// Token: 0x06002F00 RID: 12032 RVA: 0x00097394 File Offset: 0x00095594
private static void BSwap(byte[] byteBuff)
{
byte b = byteBuff[0];
byteBuff[0] = byteBuff[3];
byteBuff[3] = b;
b = byteBuff[1];
byteBuff[1] = byteBuff[2];
byteBuff[2] = b;
b = byteBuff[4];
byteBuff[4] = byteBuff[7];
byteBuff[7] = b;
b = byteBuff[5];
byteBuff[5] = byteBuff[6];
byteBuff[6] = b;
}
// Token: 0x06002F01 RID: 12033 RVA: 0x000973DC File Offset: 0x000955DC
internal void SetKey(byte[] key)
{
Array.Clear(this.keySchedule, 0, this.keySchedule.Length);
int num = DESTransform.PC1.Length;
byte[] array = new byte[num];
byte[] array2 = new byte[num];
int num2 = 0;
foreach (byte b in DESTransform.PC1)
{
array[num2++] = (byte)((key[b >> 3] >> (int)(7 ^ (b & 7))) & 1);
}
for (int j = 0; j < DESTransform.KEY_BYTE_SIZE * 2; j++)
{
int num3 = num >> 1;
int k;
for (k = 0; k < num3; k++)
{
int num4 = k + (int)DESTransform.leftRotTotal[j];
array2[k] = array[(num4 >= num3) ? (num4 - num3) : num4];
}
for (k = num3; k < num; k++)
{
int num5 = k + (int)DESTransform.leftRotTotal[j];
array2[k] = array[(num5 >= num) ? (num5 - num3) : num5];
}
int num6 = j * DESTransform.KEY_BYTE_SIZE;
k = 0;
foreach (byte b2 in DESTransform.PC2)
{
if (array2[(int)b2] != 0)
{
byte[] array3 = this.keySchedule;
int num7 = num6 + k / 6;
array3[num7] |= (byte)(128 >> k % 6 + 2);
}
k++;
}
}
}
// Token: 0x06002F02 RID: 12034 RVA: 0x00097560 File Offset: 0x00095760
public void ProcessBlock(byte[] input, byte[] output)
{
Buffer.BlockCopy(input, 0, this.dwordBuff, 0, DESTransform.BLOCK_BYTE_SIZE);
if (this.encrypt)
{
uint num = this.dwordBuff[0];
uint num2 = this.dwordBuff[1];
num ^= this.CipherFunct(num2, 0);
num2 ^= this.CipherFunct(num, 1);
num ^= this.CipherFunct(num2, 2);
num2 ^= this.CipherFunct(num, 3);
num ^= this.CipherFunct(num2, 4);
num2 ^= this.CipherFunct(num, 5);
num ^= this.CipherFunct(num2, 6);
num2 ^= this.CipherFunct(num, 7);
num ^= this.CipherFunct(num2, 8);
num2 ^= this.CipherFunct(num, 9);
num ^= this.CipherFunct(num2, 10);
num2 ^= this.CipherFunct(num, 11);
num ^= this.CipherFunct(num2, 12);
num2 ^= this.CipherFunct(num, 13);
num ^= this.CipherFunct(num2, 14);
num2 ^= this.CipherFunct(num, 15);
this.dwordBuff[0] = num2;
this.dwordBuff[1] = num;
}
else
{
uint num3 = this.dwordBuff[0];
uint num4 = this.dwordBuff[1];
num3 ^= this.CipherFunct(num4, 15);
num4 ^= this.CipherFunct(num3, 14);
num3 ^= this.CipherFunct(num4, 13);
num4 ^= this.CipherFunct(num3, 12);
num3 ^= this.CipherFunct(num4, 11);
num4 ^= this.CipherFunct(num3, 10);
num3 ^= this.CipherFunct(num4, 9);
num4 ^= this.CipherFunct(num3, 8);
num3 ^= this.CipherFunct(num4, 7);
num4 ^= this.CipherFunct(num3, 6);
num3 ^= this.CipherFunct(num4, 5);
num4 ^= this.CipherFunct(num3, 4);
num3 ^= this.CipherFunct(num4, 3);
num4 ^= this.CipherFunct(num3, 2);
num3 ^= this.CipherFunct(num4, 1);
num4 ^= this.CipherFunct(num3, 0);
this.dwordBuff[0] = num4;
this.dwordBuff[1] = num3;
}
Buffer.BlockCopy(this.dwordBuff, 0, output, 0, DESTransform.BLOCK_BYTE_SIZE);
}
// Token: 0x06002F03 RID: 12035 RVA: 0x0009775C File Offset: 0x0009595C
protected override void ECB(byte[] input, byte[] output)
{
DESTransform.Permutation(input, output, DESTransform.ipTab, false);
this.ProcessBlock(output, this.byteBuff);
DESTransform.Permutation(this.byteBuff, output, DESTransform.fpTab, true);
}
// Token: 0x06002F04 RID: 12036 RVA: 0x00097798 File Offset: 0x00095998
internal static byte[] GetStrongKey()
{
byte[] array = KeyBuilder.Key(DESTransform.KEY_BYTE_SIZE);
while (DES.IsWeakKey(array) || DES.IsSemiWeakKey(array))
{
array = KeyBuilder.Key(DESTransform.KEY_BYTE_SIZE);
}
return array;
}
// Token: 0x04001329 RID: 4905
internal static readonly int KEY_BIT_SIZE = 64;
// Token: 0x0400132A RID: 4906
internal static readonly int KEY_BYTE_SIZE = DESTransform.KEY_BIT_SIZE / 8;
// Token: 0x0400132B RID: 4907
internal static readonly int BLOCK_BIT_SIZE = 64;
// Token: 0x0400132C RID: 4908
internal static readonly int BLOCK_BYTE_SIZE = DESTransform.BLOCK_BIT_SIZE / 8;
// Token: 0x0400132D RID: 4909
private byte[] keySchedule;
// Token: 0x0400132E RID: 4910
private byte[] byteBuff;
// Token: 0x0400132F RID: 4911
private uint[] dwordBuff;
// Token: 0x04001330 RID: 4912
private static readonly uint[] spBoxes = new uint[]
{
8421888U, 0U, 32768U, 8421890U, 8421378U, 33282U, 2U, 32768U, 512U, 8421888U,
8421890U, 512U, 8389122U, 8421378U, 8388608U, 2U, 514U, 8389120U, 8389120U, 33280U,
33280U, 8421376U, 8421376U, 8389122U, 32770U, 8388610U, 8388610U, 32770U, 0U, 514U,
33282U, 8388608U, 32768U, 8421890U, 2U, 8421376U, 8421888U, 8388608U, 8388608U, 512U,
8421378U, 32768U, 33280U, 8388610U, 512U, 2U, 8389122U, 33282U, 8421890U, 32770U,
8421376U, 8389122U, 8388610U, 514U, 33282U, 8421888U, 514U, 8389120U, 8389120U, 0U,
32770U, 33280U, 0U, 8421378U, 1074282512U, 1073758208U, 16384U, 540688U, 524288U, 16U,
1074266128U, 1073758224U, 1073741840U, 1074282512U, 1074282496U, 1073741824U, 1073758208U, 524288U, 16U, 1074266128U,
540672U, 524304U, 1073758224U, 0U, 1073741824U, 16384U, 540688U, 1074266112U, 524304U, 1073741840U,
0U, 540672U, 16400U, 1074282496U, 1074266112U, 16400U, 0U, 540688U, 1074266128U, 524288U,
1073758224U, 1074266112U, 1074282496U, 16384U, 1074266112U, 1073758208U, 16U, 1074282512U, 540688U, 16U,
16384U, 1073741824U, 16400U, 1074282496U, 524288U, 1073741840U, 524304U, 1073758224U, 1073741840U, 524304U,
540672U, 0U, 1073758208U, 16400U, 1073741824U, 1074266128U, 1074282512U, 540672U, 260U, 67174656U,
0U, 67174404U, 67109120U, 0U, 65796U, 67109120U, 65540U, 67108868U, 67108868U, 65536U,
67174660U, 65540U, 67174400U, 260U, 67108864U, 4U, 67174656U, 256U, 65792U, 67174400U,
67174404U, 65796U, 67109124U, 65792U, 65536U, 67109124U, 4U, 67174660U, 256U, 67108864U,
67174656U, 67108864U, 65540U, 260U, 65536U, 67174656U, 67109120U, 0U, 256U, 65540U,
67174660U, 67109120U, 67108868U, 256U, 0U, 67174404U, 67109124U, 65536U, 67108864U, 67174660U,
4U, 65796U, 65792U, 67108868U, 67174400U, 67109124U, 260U, 67174400U, 65796U, 4U,
67174404U, 65792U, 2151682048U, 2147487808U, 2147487808U, 64U, 4198464U, 2151678016U, 2151677952U, 2147487744U,
0U, 4198400U, 4198400U, 2151682112U, 2147483712U, 0U, 4194368U, 2151677952U, 2147483648U, 4096U,
4194304U, 2151682048U, 64U, 4194304U, 2147487744U, 4160U, 2151678016U, 2147483648U, 4160U, 4194368U,
4096U, 4198464U, 2151682112U, 2147483712U, 4194368U, 2151677952U, 4198400U, 2151682112U, 2147483712U, 0U,
0U, 4198400U, 4160U, 4194368U, 2151678016U, 2147483648U, 2151682048U, 2147487808U, 2147487808U, 64U,
2151682112U, 2147483712U, 2147483648U, 4096U, 2151677952U, 2147487744U, 4198464U, 2151678016U, 2147487744U, 4160U,
4194304U, 2151682048U, 64U, 4194304U, 4096U, 4198464U, 128U, 17039488U, 17039360U, 553648256U,
262144U, 128U, 536870912U, 17039360U, 537133184U, 262144U, 16777344U, 537133184U, 553648256U, 553910272U,
262272U, 536870912U, 16777216U, 537133056U, 537133056U, 0U, 536871040U, 553910400U, 553910400U, 16777344U,
553910272U, 536871040U, 0U, 553648128U, 17039488U, 16777216U, 553648128U, 262272U, 262144U, 553648256U,
128U, 16777216U, 536870912U, 17039360U, 553648256U, 537133184U, 16777344U, 536870912U, 553910272U, 17039488U,
537133184U, 128U, 16777216U, 553910272U, 553910400U, 262272U, 553648128U, 553910400U, 17039360U, 0U,
537133056U, 553648128U, 262272U, 16777344U, 536871040U, 262144U, 0U, 537133056U, 17039488U, 536871040U,
268435464U, 270532608U, 8192U, 270540808U, 270532608U, 8U, 270540808U, 2097152U, 268443648U, 2105352U,
2097152U, 268435464U, 2097160U, 268443648U, 268435456U, 8200U, 0U, 2097160U, 268443656U, 8192U,
2105344U, 268443656U, 8U, 270532616U, 270532616U, 0U, 2105352U, 270540800U, 8200U, 2105344U,
270540800U, 268435456U, 268443648U, 8U, 270532616U, 2105344U, 270540808U, 2097152U, 8200U, 268435464U,
2097152U, 268443648U, 268435456U, 8200U, 268435464U, 270540808U, 2105344U, 270532608U, 2105352U, 270540800U,
0U, 270532616U, 8U, 8192U, 270532608U, 2105352U, 8192U, 2097160U, 268443656U, 0U,
270540800U, 268435456U, 2097160U, 268443656U, 1048576U, 34603009U, 33555457U, 0U, 1024U, 33555457U,
1049601U, 34604032U, 34604033U, 1048576U, 0U, 33554433U, 1U, 33554432U, 34603009U, 1025U,
33555456U, 1049601U, 1048577U, 33555456U, 33554433U, 34603008U, 34604032U, 1048577U, 34603008U, 1024U,
1025U, 34604033U, 1049600U, 1U, 33554432U, 1049600U, 33554432U, 1049600U, 1048576U, 33555457U,
33555457U, 34603009U, 34603009U, 1U, 1048577U, 33554432U, 33555456U, 1048576U, 34604032U, 1025U,
1049601U, 34604032U, 1025U, 33554433U, 34604033U, 34603008U, 1049600U, 0U, 1U, 34604033U,
0U, 1049601U, 34603008U, 1024U, 33554433U, 33555456U, 1024U, 1048577U, 134219808U, 2048U,
131072U, 134350880U, 134217728U, 134219808U, 32U, 134217728U, 131104U, 134348800U, 134350880U, 133120U,
134350848U, 133152U, 2048U, 32U, 134348800U, 134217760U, 134219776U, 2080U, 133120U, 131104U,
134348832U, 134350848U, 2080U, 0U, 0U, 134348832U, 134217760U, 134219776U, 133152U, 131072U,
133152U, 131072U, 134350848U, 2048U, 32U, 134348832U, 2048U, 133152U, 134219776U, 32U,
134217760U, 134348800U, 134348832U, 134217728U, 131072U, 134219808U, 0U, 134350880U, 131104U, 134217760U,
134348800U, 134219776U, 134219808U, 0U, 134350880U, 133120U, 133120U, 2080U, 2080U, 131104U,
134217728U, 134350848U
};
// Token: 0x04001331 RID: 4913
private static readonly byte[] PC1 = new byte[]
{
56, 48, 40, 32, 24, 16, 8, 0, 57, 49,
41, 33, 25, 17, 9, 1, 58, 50, 42, 34,
26, 18, 10, 2, 59, 51, 43, 35, 62, 54,
46, 38, 30, 22, 14, 6, 61, 53, 45, 37,
29, 21, 13, 5, 60, 52, 44, 36, 28, 20,
12, 4, 27, 19, 11, 3
};
// Token: 0x04001332 RID: 4914
private static readonly byte[] leftRotTotal = new byte[]
{
1, 2, 4, 6, 8, 10, 12, 14, 15, 17,
19, 21, 23, 25, 27, 28
};
// Token: 0x04001333 RID: 4915
private static readonly byte[] PC2 = new byte[]
{
13, 16, 10, 23, 0, 4, 2, 27, 14, 5,
20, 9, 22, 18, 11, 3, 25, 7, 15, 6,
26, 19, 12, 1, 40, 51, 30, 36, 46, 54,
29, 39, 50, 44, 32, 47, 43, 48, 38, 55,
33, 52, 45, 41, 49, 35, 28, 31
};
// Token: 0x04001334 RID: 4916
internal static readonly uint[] ipTab = new uint[]
{
0U, 0U, 256U, 0U, 0U, 256U, 256U, 256U, 1U, 0U,
257U, 0U, 1U, 256U, 257U, 256U, 0U, 1U, 256U, 1U,
0U, 257U, 256U, 257U, 1U, 1U, 257U, 1U, 1U, 257U,
257U, 257U, 0U, 0U, 16777216U, 0U, 0U, 16777216U, 16777216U, 16777216U,
65536U, 0U, 16842752U, 0U, 65536U, 16777216U, 16842752U, 16777216U, 0U, 65536U,
16777216U, 65536U, 0U, 16842752U, 16777216U, 16842752U, 65536U, 65536U, 16842752U, 65536U,
65536U, 16842752U, 16842752U, 16842752U, 0U, 0U, 512U, 0U, 0U, 512U,
512U, 512U, 2U, 0U, 514U, 0U, 2U, 512U, 514U, 512U,
0U, 2U, 512U, 2U, 0U, 514U, 512U, 514U, 2U, 2U,
514U, 2U, 2U, 514U, 514U, 514U, 0U, 0U, 33554432U, 0U,
0U, 33554432U, 33554432U, 33554432U, 131072U, 0U, 33685504U, 0U, 131072U, 33554432U,
33685504U, 33554432U, 0U, 131072U, 33554432U, 131072U, 0U, 33685504U, 33554432U, 33685504U,
131072U, 131072U, 33685504U, 131072U, 131072U, 33685504U, 33685504U, 33685504U, 0U, 0U,
1024U, 0U, 0U, 1024U, 1024U, 1024U, 4U, 0U, 1028U, 0U,
4U, 1024U, 1028U, 1024U, 0U, 4U, 1024U, 4U, 0U, 1028U,
1024U, 1028U, 4U, 4U, 1028U, 4U, 4U, 1028U, 1028U, 1028U,
0U, 0U, 67108864U, 0U, 0U, 67108864U, 67108864U, 67108864U, 262144U, 0U,
67371008U, 0U, 262144U, 67108864U, 67371008U, 67108864U, 0U, 262144U, 67108864U, 262144U,
0U, 67371008U, 67108864U, 67371008U, 262144U, 262144U, 67371008U, 262144U, 262144U, 67371008U,
67371008U, 67371008U, 0U, 0U, 2048U, 0U, 0U, 2048U, 2048U, 2048U,
8U, 0U, 2056U, 0U, 8U, 2048U, 2056U, 2048U, 0U, 8U,
2048U, 8U, 0U, 2056U, 2048U, 2056U, 8U, 8U, 2056U, 8U,
8U, 2056U, 2056U, 2056U, 0U, 0U, 134217728U, 0U, 0U, 134217728U,
134217728U, 134217728U, 524288U, 0U, 134742016U, 0U, 524288U, 134217728U, 134742016U, 134217728U,
0U, 524288U, 134217728U, 524288U, 0U, 134742016U, 134217728U, 134742016U, 524288U, 524288U,
134742016U, 524288U, 524288U, 134742016U, 134742016U, 134742016U, 0U, 0U, 4096U, 0U,
0U, 4096U, 4096U, 4096U, 16U, 0U, 4112U, 0U, 16U, 4096U,
4112U, 4096U, 0U, 16U, 4096U, 16U, 0U, 4112U, 4096U, 4112U,
16U, 16U, 4112U, 16U, 16U, 4112U, 4112U, 4112U, 0U, 0U,
268435456U, 0U, 0U, 268435456U, 268435456U, 268435456U, 1048576U, 0U, 269484032U, 0U,
1048576U, 268435456U, 269484032U, 268435456U, 0U, 1048576U, 268435456U, 1048576U, 0U, 269484032U,
268435456U, 269484032U, 1048576U, 1048576U, 269484032U, 1048576U, 1048576U, 269484032U, 269484032U, 269484032U,
0U, 0U, 8192U, 0U, 0U, 8192U, 8192U, 8192U, 32U, 0U,
8224U, 0U, 32U, 8192U, 8224U, 8192U, 0U, 32U, 8192U, 32U,
0U, 8224U, 8192U, 8224U, 32U, 32U, 8224U, 32U, 32U, 8224U,
8224U, 8224U, 0U, 0U, 536870912U, 0U, 0U, 536870912U, 536870912U, 536870912U,
2097152U, 0U, 538968064U, 0U, 2097152U, 536870912U, 538968064U, 536870912U, 0U, 2097152U,
536870912U, 2097152U, 0U, 538968064U, 536870912U, 538968064U, 2097152U, 2097152U, 538968064U, 2097152U,
2097152U, 538968064U, 538968064U, 538968064U, 0U, 0U, 16384U, 0U, 0U, 16384U,
16384U, 16384U, 64U, 0U, 16448U, 0U, 64U, 16384U, 16448U, 16384U,
0U, 64U, 16384U, 64U, 0U, 16448U, 16384U, 16448U, 64U, 64U,
16448U, 64U, 64U, 16448U, 16448U, 16448U, 0U, 0U, 1073741824U, 0U,
0U, 1073741824U, 1073741824U, 1073741824U, 4194304U, 0U, 1077936128U, 0U, 4194304U, 1073741824U,
1077936128U, 1073741824U, 0U, 4194304U, 1073741824U, 4194304U, 0U, 1077936128U, 1073741824U, 1077936128U,
4194304U, 4194304U, 1077936128U, 4194304U, 4194304U, 1077936128U, 1077936128U, 1077936128U, 0U, 0U,
32768U, 0U, 0U, 32768U, 32768U, 32768U, 128U, 0U, 32896U, 0U,
128U, 32768U, 32896U, 32768U, 0U, 128U, 32768U, 128U, 0U, 32896U,
32768U, 32896U, 128U, 128U, 32896U, 128U, 128U, 32896U, 32896U, 32896U,
0U, 0U, 2147483648U, 0U, 0U, 2147483648U, 2147483648U, 2147483648U, 8388608U, 0U,
2155872256U, 0U, 8388608U, 2147483648U, 2155872256U, 2147483648U, 0U, 8388608U, 2147483648U, 8388608U,
0U, 2155872256U, 2147483648U, 2155872256U, 8388608U, 8388608U, 2155872256U, 8388608U, 8388608U, 2155872256U,
2155872256U, 2155872256U
};
// Token: 0x04001335 RID: 4917
internal static readonly uint[] fpTab = new uint[]
{
0U, 0U, 0U, 64U, 0U, 16384U, 0U, 16448U, 0U, 4194304U,
0U, 4194368U, 0U, 4210688U, 0U, 4210752U, 0U, 1073741824U, 0U, 1073741888U,
0U, 1073758208U, 0U, 1073758272U, 0U, 1077936128U, 0U, 1077936192U, 0U, 1077952512U,
0U, 1077952576U, 0U, 0U, 64U, 0U, 16384U, 0U, 16448U, 0U,
4194304U, 0U, 4194368U, 0U, 4210688U, 0U, 4210752U, 0U, 1073741824U, 0U,
1073741888U, 0U, 1073758208U, 0U, 1073758272U, 0U, 1077936128U, 0U, 1077936192U, 0U,
1077952512U, 0U, 1077952576U, 0U, 0U, 0U, 0U, 16U, 0U, 4096U,
0U, 4112U, 0U, 1048576U, 0U, 1048592U, 0U, 1052672U, 0U, 1052688U,
0U, 268435456U, 0U, 268435472U, 0U, 268439552U, 0U, 268439568U, 0U, 269484032U,
0U, 269484048U, 0U, 269488128U, 0U, 269488144U, 0U, 0U, 16U, 0U,
4096U, 0U, 4112U, 0U, 1048576U, 0U, 1048592U, 0U, 1052672U, 0U,
1052688U, 0U, 268435456U, 0U, 268435472U, 0U, 268439552U, 0U, 268439568U, 0U,
269484032U, 0U, 269484048U, 0U, 269488128U, 0U, 269488144U, 0U, 0U, 0U,
0U, 4U, 0U, 1024U, 0U, 1028U, 0U, 262144U, 0U, 262148U,
0U, 263168U, 0U, 263172U, 0U, 67108864U, 0U, 67108868U, 0U, 67109888U,
0U, 67109892U, 0U, 67371008U, 0U, 67371012U, 0U, 67372032U, 0U, 67372036U,
0U, 0U, 4U, 0U, 1024U, 0U, 1028U, 0U, 262144U, 0U,
262148U, 0U, 263168U, 0U, 263172U, 0U, 67108864U, 0U, 67108868U, 0U,
67109888U, 0U, 67109892U, 0U, 67371008U, 0U, 67371012U, 0U, 67372032U, 0U,
67372036U, 0U, 0U, 0U, 0U, 1U, 0U, 256U, 0U, 257U,
0U, 65536U, 0U, 65537U, 0U, 65792U, 0U, 65793U, 0U, 16777216U,
0U, 16777217U, 0U, 16777472U, 0U, 16777473U, 0U, 16842752U, 0U, 16842753U,
0U, 16843008U, 0U, 16843009U, 0U, 0U, 1U, 0U, 256U, 0U,
257U, 0U, 65536U, 0U, 65537U, 0U, 65792U, 0U, 65793U, 0U,
16777216U, 0U, 16777217U, 0U, 16777472U, 0U, 16777473U, 0U, 16842752U, 0U,
16842753U, 0U, 16843008U, 0U, 16843009U, 0U, 0U, 0U, 0U, 128U,
0U, 32768U, 0U, 32896U, 0U, 8388608U, 0U, 8388736U, 0U, 8421376U,
0U, 8421504U, 0U, 2147483648U, 0U, 2147483776U, 0U, 2147516416U, 0U, 2147516544U,
0U, 2155872256U, 0U, 2155872384U, 0U, 2155905024U, 0U, 2155905152U, 0U, 0U,
128U, 0U, 32768U, 0U, 32896U, 0U, 8388608U, 0U, 8388736U, 0U,
8421376U, 0U, 8421504U, 0U, 2147483648U, 0U, 2147483776U, 0U, 2147516416U, 0U,
2147516544U, 0U, 2155872256U, 0U, 2155872384U, 0U, 2155905024U, 0U, 2155905152U, 0U,
0U, 0U, 0U, 32U, 0U, 8192U, 0U, 8224U, 0U, 2097152U,
0U, 2097184U, 0U, 2105344U, 0U, 2105376U, 0U, 536870912U, 0U, 536870944U,
0U, 536879104U, 0U, 536879136U, 0U, 538968064U, 0U, 538968096U, 0U, 538976256U,
0U, 538976288U, 0U, 0U, 32U, 0U, 8192U, 0U, 8224U, 0U,
2097152U, 0U, 2097184U, 0U, 2105344U, 0U, 2105376U, 0U, 536870912U, 0U,
536870944U, 0U, 536879104U, 0U, 536879136U, 0U, 538968064U, 0U, 538968096U, 0U,
538976256U, 0U, 538976288U, 0U, 0U, 0U, 0U, 8U, 0U, 2048U,
0U, 2056U, 0U, 524288U, 0U, 524296U, 0U, 526336U, 0U, 526344U,
0U, 134217728U, 0U, 134217736U, 0U, 134219776U, 0U, 134219784U, 0U, 134742016U,
0U, 134742024U, 0U, 134744064U, 0U, 134744072U, 0U, 0U, 8U, 0U,
2048U, 0U, 2056U, 0U, 524288U, 0U, 524296U, 0U, 526336U, 0U,
526344U, 0U, 134217728U, 0U, 134217736U, 0U, 134219776U, 0U, 134219784U, 0U,
134742016U, 0U, 134742024U, 0U, 134744064U, 0U, 134744072U, 0U, 0U, 0U,
0U, 2U, 0U, 512U, 0U, 514U, 0U, 131072U, 0U, 131074U,
0U, 131584U, 0U, 131586U, 0U, 33554432U, 0U, 33554434U, 0U, 33554944U,
0U, 33554946U, 0U, 33685504U, 0U, 33685506U, 0U, 33686016U, 0U, 33686018U,
0U, 0U, 2U, 0U, 512U, 0U, 514U, 0U, 131072U, 0U,
131074U, 0U, 131584U, 0U, 131586U, 0U, 33554432U, 0U, 33554434U, 0U,
33554944U, 0U, 33554946U, 0U, 33685504U, 0U, 33685506U, 0U, 33686016U, 0U,
33686018U, 0U
};
}
}
@@ -0,0 +1,178 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
using Mono.Security;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract base class from which all implementations of the Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) must inherit.</summary>
// Token: 0x020004F9 RID: 1273
[ComVisible(true)]
public abstract class DSA : AsymmetricAlgorithm
{
/// <summary>Creates the default cryptographic object used to perform the asymmetric algorithm.</summary>
/// <returns>A cryptographic object used to perform the asymmetric algorithm.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002F0B RID: 12043 RVA: 0x00097824 File Offset: 0x00095A24
public new static DSA Create()
{
return DSA.Create("System.Security.Cryptography.DSA");
}
/// <summary>Creates the specified cryptographic object used to perform the asymmetric algorithm.</summary>
/// <returns>A cryptographic object used to perform the asymmetric algorithm.</returns>
/// <param name="algName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.DSA" /> to use. </param>
// Token: 0x06002F0C RID: 12044 RVA: 0x00097830 File Offset: 0x00095A30
public new static DSA Create(string algName)
{
return (DSA)CryptoConfig.CreateFromName(algName);
}
/// <summary>When overridden in a derived class, creates the <see cref="T:System.Security.Cryptography.DSA" /> signature for the specified data.</summary>
/// <returns>The digital signature for the specified data.</returns>
/// <param name="rgbHash">The data to be signed. </param>
// Token: 0x06002F0D RID: 12045
public abstract byte[] CreateSignature(byte[] rgbHash);
/// <summary>When overridden in a derived class, exports the <see cref="T:System.Security.Cryptography.DSAParameters" />.</summary>
/// <returns>The parameters for <see cref="T:System.Security.Cryptography.DSA" />.</returns>
/// <param name="includePrivateParameters">true to include private parameters; otherwise, false. </param>
// Token: 0x06002F0E RID: 12046
public abstract DSAParameters ExportParameters(bool includePrivateParameters);
// Token: 0x06002F0F RID: 12047 RVA: 0x00097840 File Offset: 0x00095A40
internal void ZeroizePrivateKey(DSAParameters parameters)
{
if (parameters.X != null)
{
Array.Clear(parameters.X, 0, parameters.X.Length);
}
}
/// <summary>Reconstructs a <see cref="T:System.Security.Cryptography.DSA" /> object from an XML string.</summary>
/// <param name="xmlString">The XML string to use to reconstruct the <see cref="T:System.Security.Cryptography.DSA" /> object. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="xmlString" /> parameter is null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The format of the <paramref name="xmlString" /> parameter is not valid. </exception>
// Token: 0x06002F10 RID: 12048 RVA: 0x00097870 File Offset: 0x00095A70
public override void FromXmlString(string xmlString)
{
if (xmlString == null)
{
throw new ArgumentNullException("xmlString");
}
DSAParameters dsaparameters = default(DSAParameters);
try
{
dsaparameters.P = AsymmetricAlgorithm.GetNamedParam(xmlString, "P");
dsaparameters.Q = AsymmetricAlgorithm.GetNamedParam(xmlString, "Q");
dsaparameters.G = AsymmetricAlgorithm.GetNamedParam(xmlString, "G");
dsaparameters.J = AsymmetricAlgorithm.GetNamedParam(xmlString, "J");
dsaparameters.Y = AsymmetricAlgorithm.GetNamedParam(xmlString, "Y");
dsaparameters.X = AsymmetricAlgorithm.GetNamedParam(xmlString, "X");
dsaparameters.Seed = AsymmetricAlgorithm.GetNamedParam(xmlString, "Seed");
byte[] namedParam = AsymmetricAlgorithm.GetNamedParam(xmlString, "PgenCounter");
if (namedParam != null)
{
byte[] array = new byte[4];
Buffer.BlockCopy(namedParam, 0, array, 0, namedParam.Length);
dsaparameters.Counter = BitConverterLE.ToInt32(array, 0);
}
this.ImportParameters(dsaparameters);
}
catch
{
this.ZeroizePrivateKey(dsaparameters);
throw;
}
finally
{
this.ZeroizePrivateKey(dsaparameters);
}
}
/// <summary>When overridden in a derived class, imports the specified <see cref="T:System.Security.Cryptography.DSAParameters" />.</summary>
/// <param name="parameters">The parameters for <see cref="T:System.Security.Cryptography.DSA" />. </param>
// Token: 0x06002F11 RID: 12049
public abstract void ImportParameters(DSAParameters parameters);
/// <summary>Creates and returns an XML string representation of the current <see cref="T:System.Security.Cryptography.DSA" /> object.</summary>
/// <returns>An XML string encoding of the current <see cref="T:System.Security.Cryptography.DSA" /> object.</returns>
/// <param name="includePrivateParameters">true to include private parameters; otherwise, false. </param>
// Token: 0x06002F12 RID: 12050 RVA: 0x000979A0 File Offset: 0x00095BA0
public override string ToXmlString(bool includePrivateParameters)
{
StringBuilder stringBuilder = new StringBuilder();
DSAParameters dsaparameters = this.ExportParameters(includePrivateParameters);
try
{
stringBuilder.Append("<DSAKeyValue>");
stringBuilder.Append("<P>");
stringBuilder.Append(Convert.ToBase64String(dsaparameters.P));
stringBuilder.Append("</P>");
stringBuilder.Append("<Q>");
stringBuilder.Append(Convert.ToBase64String(dsaparameters.Q));
stringBuilder.Append("</Q>");
stringBuilder.Append("<G>");
stringBuilder.Append(Convert.ToBase64String(dsaparameters.G));
stringBuilder.Append("</G>");
stringBuilder.Append("<Y>");
stringBuilder.Append(Convert.ToBase64String(dsaparameters.Y));
stringBuilder.Append("</Y>");
if (dsaparameters.J != null)
{
stringBuilder.Append("<J>");
stringBuilder.Append(Convert.ToBase64String(dsaparameters.J));
stringBuilder.Append("</J>");
}
if (dsaparameters.Seed != null)
{
stringBuilder.Append("<Seed>");
stringBuilder.Append(Convert.ToBase64String(dsaparameters.Seed));
stringBuilder.Append("</Seed>");
stringBuilder.Append("<PgenCounter>");
if (dsaparameters.Counter != 0)
{
byte[] bytes = BitConverterLE.GetBytes(dsaparameters.Counter);
int num = bytes.Length;
while (bytes[num - 1] == 0)
{
num--;
}
stringBuilder.Append(Convert.ToBase64String(bytes, 0, num));
}
else
{
stringBuilder.Append("AA==");
}
stringBuilder.Append("</PgenCounter>");
}
if (dsaparameters.X != null)
{
stringBuilder.Append("<X>");
stringBuilder.Append(Convert.ToBase64String(dsaparameters.X));
stringBuilder.Append("</X>");
}
else if (includePrivateParameters)
{
throw new ArgumentNullException("X");
}
stringBuilder.Append("</DSAKeyValue>");
}
catch
{
this.ZeroizePrivateKey(dsaparameters);
throw;
}
return stringBuilder.ToString();
}
/// <summary>When overridden in a derived class, verifies the <see cref="T:System.Security.Cryptography.DSA" /> signature for the specified data.</summary>
/// <returns>true if <paramref name="rgbSignature" /> matches the signature computed using the specified hash algorithm and key on <paramref name="rgbHash" />; otherwise, false.</returns>
/// <param name="rgbHash">The hash of the data signed with <paramref name="rgbSignature" />. </param>
/// <param name="rgbSignature">The signature to be verified for <paramref name="rgbData" />. </param>
// Token: 0x06002F13 RID: 12051
public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature);
}
}
@@ -0,0 +1,443 @@
using System;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the <see cref="T:System.Security.Cryptography.DSA" /> algorithm. This class cannot be inherited. </summary>
// Token: 0x020004FA RID: 1274
[ComVisible(true)]
public sealed class DSACryptoServiceProvider : DSA, ICspAsymmetricAlgorithm
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> class.</summary>
// Token: 0x06002F14 RID: 12052 RVA: 0x00097BD8 File Offset: 0x00095DD8
public DSACryptoServiceProvider()
: this(1024, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> class with the specified parameters for the cryptographic service provider (CSP).</summary>
/// <param name="parameters">The parameters for the CSP. </param>
// Token: 0x06002F15 RID: 12053 RVA: 0x00097BE8 File Offset: 0x00095DE8
public DSACryptoServiceProvider(CspParameters parameters)
: this(1024, parameters)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> class with the specified key size.</summary>
/// <param name="dwKeySize">The size of the key for the asymmetric algorithm in bits. </param>
// Token: 0x06002F16 RID: 12054 RVA: 0x00097BF8 File Offset: 0x00095DF8
public DSACryptoServiceProvider(int dwKeySize)
: this(dwKeySize, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> class with the specified key size and parameters for the cryptographic service provider (CSP).</summary>
/// <param name="dwKeySize">The size of the key for the cryptographic algorithm in bits. </param>
/// <param name="parameters">The parameters for the CSP. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The CSP cannot be acquired.-or- The key cannot be created. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="dwKeySize" /> is out of range.</exception>
// Token: 0x06002F17 RID: 12055 RVA: 0x00097C04 File Offset: 0x00095E04
public DSACryptoServiceProvider(int dwKeySize, CspParameters parameters)
{
this.LegalKeySizesValue = new KeySizes[1];
this.LegalKeySizesValue[0] = new KeySizes(512, 1024, 64);
this.KeySize = dwKeySize;
this.dsa = new DSAManaged(dwKeySize);
this.dsa.KeyGenerated += this.OnKeyGenerated;
this.persistKey = parameters != null;
if (parameters == null)
{
parameters = new CspParameters(13);
if (DSACryptoServiceProvider.useMachineKeyStore)
{
parameters.Flags |= CspProviderFlags.UseMachineKeyStore;
}
this.store = new KeyPairPersistence(parameters);
}
else
{
this.store = new KeyPairPersistence(parameters);
this.store.Load();
if (this.store.KeyValue != null)
{
this.persisted = true;
this.FromXmlString(this.store.KeyValue);
}
}
}
// Token: 0x06002F19 RID: 12057 RVA: 0x00097CF8 File Offset: 0x00095EF8
~DSACryptoServiceProvider()
{
this.Dispose(false);
}
/// <summary>Gets the name of the key exchange algorithm.</summary>
/// <returns>The name of the key exchange algorithm.</returns>
// Token: 0x1700094C RID: 2380
// (get) Token: 0x06002F1A RID: 12058 RVA: 0x00097D34 File Offset: 0x00095F34
public override string KeyExchangeAlgorithm
{
get
{
return null;
}
}
/// <summary>Gets the size of the key used by the asymmetric algorithm in bits.</summary>
/// <returns>The size of the key used by the asymmetric algorithm.</returns>
// Token: 0x1700094D RID: 2381
// (get) Token: 0x06002F1B RID: 12059 RVA: 0x00097D38 File Offset: 0x00095F38
public override int KeySize
{
get
{
return this.dsa.KeySize;
}
}
/// <summary>Gets or sets a value indicating whether the key should be persisted in the cryptographic service provider (CSP).</summary>
/// <returns>true if the key should be persisted in the CSP; otherwise, false.</returns>
// Token: 0x1700094E RID: 2382
// (get) Token: 0x06002F1C RID: 12060 RVA: 0x00097D48 File Offset: 0x00095F48
// (set) Token: 0x06002F1D RID: 12061 RVA: 0x00097D50 File Offset: 0x00095F50
public bool PersistKeyInCsp
{
get
{
return this.persistKey;
}
set
{
this.persistKey = value;
}
}
/// <summary>Gets a value that indicates whether the <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> object contains only a public key.</summary>
/// <returns>true if the <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> object contains only a public key; otherwise, false.</returns>
// Token: 0x1700094F RID: 2383
// (get) Token: 0x06002F1E RID: 12062 RVA: 0x00097D5C File Offset: 0x00095F5C
[ComVisible(false)]
public bool PublicOnly
{
get
{
return this.dsa.PublicOnly;
}
}
/// <summary>Gets the name of the signature algorithm.</summary>
/// <returns>The name of the signature algorithm.</returns>
// Token: 0x17000950 RID: 2384
// (get) Token: 0x06002F1F RID: 12063 RVA: 0x00097D6C File Offset: 0x00095F6C
public override string SignatureAlgorithm
{
get
{
return "http://www.w3.org/2000/09/xmldsig#dsa-sha1";
}
}
/// <summary>Gets or sets a value indicating whether the key should be persisted in the computer's key store instead of the user profile store.</summary>
/// <returns>true if the key should be persisted in the computer key store; otherwise, false.</returns>
// Token: 0x17000951 RID: 2385
// (get) Token: 0x06002F20 RID: 12064 RVA: 0x00097D74 File Offset: 0x00095F74
// (set) Token: 0x06002F21 RID: 12065 RVA: 0x00097D7C File Offset: 0x00095F7C
public static bool UseMachineKeyStore
{
get
{
return DSACryptoServiceProvider.useMachineKeyStore;
}
set
{
DSACryptoServiceProvider.useMachineKeyStore = value;
}
}
/// <summary>Exports the <see cref="T:System.Security.Cryptography.DSAParameters" />.</summary>
/// <returns>The parameters for <see cref="T:System.Security.Cryptography.DSA" />.</returns>
/// <param name="includePrivateParameters">true to include private parameters; otherwise, false. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key cannot be exported. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F22 RID: 12066 RVA: 0x00097D84 File Offset: 0x00095F84
public override DSAParameters ExportParameters(bool includePrivateParameters)
{
if (includePrivateParameters && !this.privateKeyExportable)
{
throw new CryptographicException(Locale.GetText("Cannot export private key"));
}
return this.dsa.ExportParameters(includePrivateParameters);
}
/// <summary>Imports the specified <see cref="T:System.Security.Cryptography.DSAParameters" />.</summary>
/// <param name="parameters">The parameters for <see cref="T:System.Security.Cryptography.DSA" />. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- The <paramref name="parameters" /> parameter has missing fields. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F23 RID: 12067 RVA: 0x00097DB4 File Offset: 0x00095FB4
public override void ImportParameters(DSAParameters parameters)
{
this.dsa.ImportParameters(parameters);
}
/// <summary>Creates the <see cref="T:System.Security.Cryptography.DSA" /> signature for the specified data.</summary>
/// <returns>The digital signature for the specified data.</returns>
/// <param name="rgbHash">The data to be signed. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F24 RID: 12068 RVA: 0x00097DC4 File Offset: 0x00095FC4
public override byte[] CreateSignature(byte[] rgbHash)
{
return this.dsa.CreateSignature(rgbHash);
}
/// <summary>Computes the hash value of the specified byte array and signs the resulting hash value.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.DSA" /> signature for the specified data.</returns>
/// <param name="buffer">The input data for which to compute the hash. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F25 RID: 12069 RVA: 0x00097DD4 File Offset: 0x00095FD4
public byte[] SignData(byte[] buffer)
{
HashAlgorithm hashAlgorithm = SHA1.Create();
byte[] array = hashAlgorithm.ComputeHash(buffer);
return this.dsa.CreateSignature(array);
}
/// <summary>Signs a byte array from the specified start point to the specified end point.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.DSA" /> signature for the specified data.</returns>
/// <param name="buffer">The input data to sign. </param>
/// <param name="offset">The offset into the array from which to begin using data. </param>
/// <param name="count">The number of bytes in the array to use as data. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F26 RID: 12070 RVA: 0x00097DFC File Offset: 0x00095FFC
public byte[] SignData(byte[] buffer, int offset, int count)
{
HashAlgorithm hashAlgorithm = SHA1.Create();
byte[] array = hashAlgorithm.ComputeHash(buffer, offset, count);
return this.dsa.CreateSignature(array);
}
/// <summary>Computes the hash value of the specified input stream and signs the resulting hash value.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.DSA" /> signature for the specified data.</returns>
/// <param name="inputStream">The input data for which to compute the hash. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F27 RID: 12071 RVA: 0x00097E28 File Offset: 0x00096028
public byte[] SignData(Stream inputStream)
{
HashAlgorithm hashAlgorithm = SHA1.Create();
byte[] array = hashAlgorithm.ComputeHash(inputStream);
return this.dsa.CreateSignature(array);
}
/// <summary>Computes the signature for the specified hash value by encrypting it with the private key.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.DSA" /> signature for the specified hash value.</returns>
/// <param name="rgbHash">The hash value of the data to be signed. </param>
/// <param name="str">The name of the hash algorithm used to create the hash value of the data. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbHash" /> parameter is null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- There is no private key. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F28 RID: 12072 RVA: 0x00097E50 File Offset: 0x00096050
public byte[] SignHash(byte[] rgbHash, string str)
{
if (string.Compare(str, "SHA1", true, CultureInfo.InvariantCulture) != 0)
{
throw new CryptographicException(Locale.GetText("Only SHA1 is supported."));
}
return this.dsa.CreateSignature(rgbHash);
}
/// <summary>Verifies the specified data using the specified signature.</summary>
/// <returns>true if the signature verifies the data; otherwise, false.</returns>
/// <param name="rgbData">The data that was signed. </param>
/// <param name="rgbSignature">The signature data to verify. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F29 RID: 12073 RVA: 0x00097E90 File Offset: 0x00096090
public bool VerifyData(byte[] rgbData, byte[] rgbSignature)
{
HashAlgorithm hashAlgorithm = SHA1.Create();
byte[] array = hashAlgorithm.ComputeHash(rgbData);
return this.dsa.VerifySignature(array, rgbSignature);
}
/// <summary>Verifies the specified hash data using the specified signature.</summary>
/// <returns>true if the signature verifies the hash; otherwise, false.</returns>
/// <param name="rgbHash">The hash value of the data to be signed. </param>
/// <param name="str">The name of the hash algorithm used to create the hash value of the data. </param>
/// <param name="rgbSignature">The signature data to verify. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbHash" /> parameter is null.-or- The <paramref name="rgbSignature" /> parameter is null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- The signature cannot be verified. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F2A RID: 12074 RVA: 0x00097EB8 File Offset: 0x000960B8
public bool VerifyHash(byte[] rgbHash, string str, byte[] rgbSignature)
{
if (str == null)
{
str = "SHA1";
}
if (string.Compare(str, "SHA1", true, CultureInfo.InvariantCulture) != 0)
{
throw new CryptographicException(Locale.GetText("Only SHA1 is supported."));
}
return this.dsa.VerifySignature(rgbHash, rgbSignature);
}
/// <summary>Verifies the <see cref="T:System.Security.Cryptography.DSA" /> signature for the specified data.</summary>
/// <returns>true if <paramref name="rgbSignature" /> matches the signature that is computed using the specified hash algorithm and key on <paramref name="rgbHash" />; otherwise, false.</returns>
/// <param name="rgbHash">The data signed with <paramref name="rgbSignature" />. </param>
/// <param name="rgbSignature">The signature to verify for <paramref name="rgbData" />. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F2B RID: 12075 RVA: 0x00097F08 File Offset: 0x00096108
public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
{
return this.dsa.VerifySignature(rgbHash, rgbSignature);
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002F2C RID: 12076 RVA: 0x00097F18 File Offset: 0x00096118
protected override void Dispose(bool disposing)
{
if (!this.m_disposed)
{
if (this.persisted && !this.persistKey)
{
this.store.Remove();
}
if (this.dsa != null)
{
this.dsa.Clear();
}
this.m_disposed = true;
}
}
// Token: 0x06002F2D RID: 12077 RVA: 0x00097F70 File Offset: 0x00096170
private void OnKeyGenerated(object sender, EventArgs e)
{
if (this.persistKey && !this.persisted)
{
this.store.KeyValue = this.ToXmlString(!this.dsa.PublicOnly);
this.store.Save();
this.persisted = true;
}
}
/// <summary>Gets a <see cref="T:System.Security.Cryptography.CspKeyContainerInfo" /> object that describes additional information about a cryptographic key pair. </summary>
/// <returns>A <see cref="T:System.Security.Cryptography.CspKeyContainerInfo" /> object that describes additional information about a cryptographic key pair.</returns>
// Token: 0x17000952 RID: 2386
// (get) Token: 0x06002F2E RID: 12078 RVA: 0x00097FC4 File Offset: 0x000961C4
[ComVisible(false)]
[MonoTODO("call into KeyPairPersistence to get details")]
public CspKeyContainerInfo CspKeyContainerInfo
{
get
{
return null;
}
}
/// <summary>Exports a blob containing the key information associated with a <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> object. </summary>
/// <returns>A byte array containing the key information associated with a <see cref="T:System.Security.Cryptography.DSACryptoServiceProvider" /> object.</returns>
/// <param name="includePrivateParameters">true to include the private key; otherwise, false.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F2F RID: 12079 RVA: 0x00097FC8 File Offset: 0x000961C8
[ComVisible(false)]
public byte[] ExportCspBlob(bool includePrivateParameters)
{
byte[] array;
if (includePrivateParameters)
{
array = CryptoConvert.ToCapiPrivateKeyBlob(this);
}
else
{
array = CryptoConvert.ToCapiPublicKeyBlob(this);
}
return array;
}
/// <summary>Imports a blob that represents DSA key information.</summary>
/// <param name="keyBlob">A byte array that represents a DSA key blob.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002F30 RID: 12080 RVA: 0x00097FF4 File Offset: 0x000961F4
[ComVisible(false)]
public void ImportCspBlob(byte[] keyBlob)
{
if (keyBlob == null)
{
throw new ArgumentNullException("keyBlob");
}
DSA dsa = CryptoConvert.FromCapiKeyBlobDSA(keyBlob);
if (dsa is DSACryptoServiceProvider)
{
DSAParameters dsaparameters = dsa.ExportParameters(!(dsa as DSACryptoServiceProvider).PublicOnly);
this.ImportParameters(dsaparameters);
}
else
{
try
{
DSAParameters dsaparameters2 = dsa.ExportParameters(true);
this.ImportParameters(dsaparameters2);
}
catch
{
DSAParameters dsaparameters3 = dsa.ExportParameters(false);
this.ImportParameters(dsaparameters3);
}
}
}
// Token: 0x04001336 RID: 4918
private const int PROV_DSS_DH = 13;
// Token: 0x04001337 RID: 4919
private KeyPairPersistence store;
// Token: 0x04001338 RID: 4920
private bool persistKey;
// Token: 0x04001339 RID: 4921
private bool persisted;
// Token: 0x0400133A RID: 4922
private bool privateKeyExportable = true;
// Token: 0x0400133B RID: 4923
private bool m_disposed;
// Token: 0x0400133C RID: 4924
private DSAManaged dsa;
// Token: 0x0400133D RID: 4925
private static bool useMachineKeyStore;
}
}
@@ -0,0 +1,45 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Contains the typical parameters for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x020004FB RID: 1275
[ComVisible(true)]
[Serializable]
public struct DSAParameters
{
/// <summary>Specifies the counter for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x0400133E RID: 4926
public int Counter;
/// <summary>Specifies the G parameter for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x0400133F RID: 4927
public byte[] G;
/// <summary>Specifies the J parameter for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x04001340 RID: 4928
public byte[] J;
/// <summary>Specifies the P parameter for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x04001341 RID: 4929
public byte[] P;
/// <summary>Specifies the Q parameter for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x04001342 RID: 4930
public byte[] Q;
/// <summary>Specifies the seed for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x04001343 RID: 4931
public byte[] Seed;
/// <summary>Specifies the X parameter for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x04001344 RID: 4932
[NonSerialized]
public byte[] X;
/// <summary>Specifies the Y parameter for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.</summary>
// Token: 0x04001345 RID: 4933
public byte[] Y;
}
}
@@ -0,0 +1,82 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Verifies a Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) PKCS#1 v1.5 signature.</summary>
// Token: 0x020004FC RID: 1276
[ComVisible(true)]
public class DSASignatureDeformatter : AsymmetricSignatureDeformatter
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DSASignatureDeformatter" /> class.</summary>
// Token: 0x06002F31 RID: 12081 RVA: 0x0009808C File Offset: 0x0009628C
public DSASignatureDeformatter()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DSASignatureDeformatter" /> class with the specified key.</summary>
/// <param name="key">The instance of Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) that holds the key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06002F32 RID: 12082 RVA: 0x00098094 File Offset: 0x00096294
public DSASignatureDeformatter(AsymmetricAlgorithm key)
{
this.SetKey(key);
}
/// <summary>Specifies the hash algorithm for the Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) signature deformatter.</summary>
/// <param name="strName">The name of the hash algorithm to use for the signature deformatter. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The <paramref name="strName" /> parameter does not map to the <see cref="T:System.Security.Cryptography.SHA1" /> hash algorithm. </exception>
// Token: 0x06002F33 RID: 12083 RVA: 0x000980A4 File Offset: 0x000962A4
public override void SetHashAlgorithm(string strName)
{
if (strName == null)
{
throw new ArgumentNullException("strName");
}
try
{
SHA1.Create(strName);
}
catch (InvalidCastException)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("DSA requires SHA1"));
}
}
/// <summary>Specifies the key to be used for the Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) signature deformatter.</summary>
/// <param name="key">The instance of <see cref="T:System.Security.Cryptography.DSA" /> that holds the key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06002F34 RID: 12084 RVA: 0x00098100 File Offset: 0x00096300
public override void SetKey(AsymmetricAlgorithm key)
{
if (key != null)
{
this.dsa = (DSA)key;
return;
}
throw new ArgumentNullException("key");
}
/// <summary>Verifies the Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) signature on the data.</summary>
/// <returns>true if the signature is valid for the data; otherwise, false.</returns>
/// <param name="rgbHash">The data signed with <paramref name="rgbSignature" />. </param>
/// <param name="rgbSignature">The signature to be verified for <paramref name="rgbHash" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="rgbHash" /> is null.-or-<paramref name="rgbSignature" /> is null.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The DSA key is missing.</exception>
// Token: 0x06002F35 RID: 12085 RVA: 0x00098130 File Offset: 0x00096330
public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
{
if (this.dsa == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("missing key"));
}
return this.dsa.VerifySignature(rgbHash, rgbSignature);
}
// Token: 0x04001346 RID: 4934
private DSA dsa;
}
}
@@ -0,0 +1,17 @@
using System;
namespace System.Security.Cryptography
{
// Token: 0x02000536 RID: 1334
internal class DSASignatureDescription : SignatureDescription
{
// Token: 0x060030DB RID: 12507 RVA: 0x000A803C File Offset: 0x000A623C
public DSASignatureDescription()
{
base.DeformatterAlgorithm = "System.Security.Cryptography.DSASignatureDeformatter";
base.DigestAlgorithm = "System.Security.Cryptography.SHA1CryptoServiceProvider";
base.FormatterAlgorithm = "System.Security.Cryptography.DSASignatureFormatter";
base.KeyAlgorithm = "System.Security.Cryptography.DSACryptoServiceProvider";
}
}
}
@@ -0,0 +1,81 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Creates a Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) signature.</summary>
// Token: 0x020004FD RID: 1277
[ComVisible(true)]
public class DSASignatureFormatter : AsymmetricSignatureFormatter
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DSASignatureFormatter" /> class.</summary>
// Token: 0x06002F36 RID: 12086 RVA: 0x00098168 File Offset: 0x00096368
public DSASignatureFormatter()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.DSASignatureFormatter" /> class with the specified key.</summary>
/// <param name="key">The instance of the Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) that holds the key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06002F37 RID: 12087 RVA: 0x00098170 File Offset: 0x00096370
public DSASignatureFormatter(AsymmetricAlgorithm key)
{
this.SetKey(key);
}
/// <summary>Creates the Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) PKCS #1 signature for the specified data.</summary>
/// <returns>The digital signature for the specified data.</returns>
/// <param name="rgbHash">The data to be signed. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="rgbHash" /> is null.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The OID is null.-or-The DSA key is null.</exception>
// Token: 0x06002F38 RID: 12088 RVA: 0x00098180 File Offset: 0x00096380
public override byte[] CreateSignature(byte[] rgbHash)
{
if (this.dsa == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("missing key"));
}
return this.dsa.CreateSignature(rgbHash);
}
/// <summary>Specifies the hash algorithm for the Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) signature formatter.</summary>
/// <param name="strName">The name of the hash algorithm to use for the signature formatter. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The <paramref name="strName" /> parameter does not map to the <see cref="T:System.Security.Cryptography.SHA1" /> hash algorithm. </exception>
// Token: 0x06002F39 RID: 12089 RVA: 0x000981AC File Offset: 0x000963AC
public override void SetHashAlgorithm(string strName)
{
if (strName == null)
{
throw new ArgumentNullException("strName");
}
try
{
SHA1.Create(strName);
}
catch (InvalidCastException)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("DSA requires SHA1"));
}
}
/// <summary>Specifies the key to be used for the Digital Signature Algorithm (<see cref="T:System.Security.Cryptography.DSA" />) signature formatter.</summary>
/// <param name="key">The instance of <see cref="T:System.Security.Cryptography.DSA" /> that holds the key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06002F3A RID: 12090 RVA: 0x00098208 File Offset: 0x00096408
public override void SetKey(AsymmetricAlgorithm key)
{
if (key != null)
{
this.dsa = (DSA)key;
return;
}
throw new ArgumentNullException("key");
}
// Token: 0x04001347 RID: 4935
private DSA dsa;
}
}
@@ -0,0 +1,21 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract base class from which all classes that derive byte sequences of a specified length inherit.</summary>
// Token: 0x020004FE RID: 1278
[ComVisible(true)]
public abstract class DeriveBytes
{
/// <summary>When overridden in a derived class, returns pseudo-random key bytes.</summary>
/// <returns>A byte array filled with pseudo-random key bytes.</returns>
/// <param name="cb">The number of pseudo-random key bytes to generate. </param>
// Token: 0x06002F3C RID: 12092
public abstract byte[] GetBytes(int cb);
/// <summary>When overridden in a derived class, resets the state of the operation.</summary>
// Token: 0x06002F3D RID: 12093
public abstract void Reset();
}
}
@@ -0,0 +1,362 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Converts a <see cref="T:System.Security.Cryptography.CryptoStream" /> from base 64.</summary>
// Token: 0x02000500 RID: 1280
[ComVisible(true)]
public class FromBase64Transform : IDisposable, ICryptoTransform
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.FromBase64Transform" /> class.</summary>
// Token: 0x06002F3E RID: 12094 RVA: 0x00098240 File Offset: 0x00096440
public FromBase64Transform()
: this(FromBase64TransformMode.IgnoreWhiteSpaces)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.FromBase64Transform" /> class with the specified transformation mode.</summary>
/// <param name="whitespaces">One of the <see cref="T:System.Security.Cryptography.FromBase64Transform" /> values. </param>
// Token: 0x06002F3F RID: 12095 RVA: 0x0009824C File Offset: 0x0009644C
public FromBase64Transform(FromBase64TransformMode whitespaces)
{
this.mode = whitespaces;
this.accumulator = new byte[4];
this.accPtr = 0;
this.m_disposed = false;
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.FromBase64Transform" /> and optionally releases the managed resources.</summary>
// Token: 0x06002F40 RID: 12096 RVA: 0x00098278 File Offset: 0x00096478
void IDisposable.Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.FromBase64Transform" />.</summary>
// Token: 0x06002F41 RID: 12097 RVA: 0x00098288 File Offset: 0x00096488
~FromBase64Transform()
{
this.Dispose(false);
}
/// <summary>Gets a value that indicates whether multiple blocks can be transformed.</summary>
/// <returns>Always false.</returns>
// Token: 0x17000953 RID: 2387
// (get) Token: 0x06002F42 RID: 12098 RVA: 0x000982C4 File Offset: 0x000964C4
public bool CanTransformMultipleBlocks
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the current transform can be reused.</summary>
/// <returns>Always true.</returns>
// Token: 0x17000954 RID: 2388
// (get) Token: 0x06002F43 RID: 12099 RVA: 0x000982C8 File Offset: 0x000964C8
public virtual bool CanReuseTransform
{
get
{
return true;
}
}
/// <summary>Gets the input block size.</summary>
/// <returns>The size of the input data blocks in bytes.</returns>
// Token: 0x17000955 RID: 2389
// (get) Token: 0x06002F44 RID: 12100 RVA: 0x000982CC File Offset: 0x000964CC
public int InputBlockSize
{
get
{
return 1;
}
}
/// <summary>Gets the output block size.</summary>
/// <returns>The size of the output data blocks in bytes.</returns>
// Token: 0x17000956 RID: 2390
// (get) Token: 0x06002F45 RID: 12101 RVA: 0x000982D0 File Offset: 0x000964D0
public int OutputBlockSize
{
get
{
return 3;
}
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.FromBase64Transform" />.</summary>
// Token: 0x06002F46 RID: 12102 RVA: 0x000982D4 File Offset: 0x000964D4
public void Clear()
{
this.Dispose(true);
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.FromBase64Transform" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002F47 RID: 12103 RVA: 0x000982E0 File Offset: 0x000964E0
protected virtual void Dispose(bool disposing)
{
if (!this.m_disposed)
{
if (this.accumulator != null)
{
Array.Clear(this.accumulator, 0, this.accumulator.Length);
}
if (disposing)
{
this.accumulator = null;
}
this.m_disposed = true;
}
}
// Token: 0x06002F48 RID: 12104 RVA: 0x0009832C File Offset: 0x0009652C
private byte lookup(byte input)
{
if ((int)input >= this.lookupTable.Length)
{
throw new FormatException(Locale.GetText("Invalid character in a Base-64 string."));
}
byte b = this.lookupTable[(int)input];
if (b == 255)
{
throw new FormatException(Locale.GetText("Invalid character in a Base-64 string."));
}
return b;
}
// Token: 0x06002F49 RID: 12105 RVA: 0x0009837C File Offset: 0x0009657C
private int ProcessBlock(byte[] output, int offset)
{
int num = 0;
if (this.accumulator[3] == 61)
{
num++;
}
if (this.accumulator[2] == 61)
{
num++;
}
this.lookupTable = Base64Constants.DecodeTable;
switch (num)
{
case 0:
{
int num2 = (int)this.lookup(this.accumulator[0]);
int num3 = (int)this.lookup(this.accumulator[1]);
int num4 = (int)this.lookup(this.accumulator[2]);
int num5 = (int)this.lookup(this.accumulator[3]);
output[offset++] = (byte)((num2 << 2) | (num3 >> 4));
output[offset++] = (byte)((num3 << 4) | (num4 >> 2));
output[offset] = (byte)((num4 << 6) | num5);
break;
}
case 1:
{
int num2 = (int)this.lookup(this.accumulator[0]);
int num3 = (int)this.lookup(this.accumulator[1]);
int num4 = (int)this.lookup(this.accumulator[2]);
output[offset++] = (byte)((num2 << 2) | (num3 >> 4));
output[offset] = (byte)((num3 << 4) | (num4 >> 2));
break;
}
case 2:
{
int num2 = (int)this.lookup(this.accumulator[0]);
int num3 = (int)this.lookup(this.accumulator[1]);
output[offset] = (byte)((num2 << 2) | (num3 >> 4));
break;
}
}
return 3 - num;
}
// Token: 0x06002F4A RID: 12106 RVA: 0x000984C4 File Offset: 0x000966C4
private void CheckInputParameters(byte[] inputBuffer, int inputOffset, int inputCount)
{
if (inputBuffer == null)
{
throw new ArgumentNullException("inputBuffer");
}
if (inputOffset < 0)
{
throw new ArgumentOutOfRangeException("inputOffset", "< 0");
}
if (inputCount > inputBuffer.Length)
{
throw new OutOfMemoryException("inputCount " + Locale.GetText("Overflow"));
}
if (inputOffset > inputBuffer.Length - inputCount)
{
throw new ArgumentException("inputOffset", Locale.GetText("Overflow"));
}
if (inputCount < 0)
{
throw new OverflowException("inputCount < 0");
}
}
/// <summary>Converts the specified region of the input byte array from base 64 and copies the result to the specified region of the output byte array.</summary>
/// <returns>The number of bytes written.</returns>
/// <param name="inputBuffer">The input to compute from base 64. </param>
/// <param name="inputOffset">The offset into the input byte array from which to begin using data. </param>
/// <param name="inputCount">The number of bytes in the input byte array to use as data. </param>
/// <param name="outputBuffer">The output to which to write the result. </param>
/// <param name="outputOffset">The offset into the output byte array from which to begin writing data. </param>
/// <exception cref="T:System.ObjectDisposedException">The current <see cref="T:System.Security.Cryptography.FromBase64Transform" /> object has already been disposed. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="inputCount" /> uses an invalid value.-or-<paramref name="inputBuffer" /> has an invalid offset length.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="inputOffset" /> is out of range. This parameter requires a non-negative number.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="inputBuffer" /> is null.</exception>
// Token: 0x06002F4B RID: 12107 RVA: 0x00098550 File Offset: 0x00096750
public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
if (this.m_disposed)
{
throw new ObjectDisposedException("FromBase64Transform");
}
this.CheckInputParameters(inputBuffer, inputOffset, inputCount);
if (outputBuffer == null || outputOffset < 0)
{
throw new FormatException("outputBuffer");
}
int num = 0;
while (inputCount > 0)
{
if (this.accPtr < 4)
{
byte b = inputBuffer[inputOffset++];
if (this.mode == FromBase64TransformMode.IgnoreWhiteSpaces)
{
if (!char.IsWhiteSpace((char)b))
{
this.accumulator[this.accPtr++] = b;
}
}
else
{
this.accumulator[this.accPtr++] = b;
}
}
if (this.accPtr == 4)
{
num += this.ProcessBlock(outputBuffer, outputOffset);
outputOffset += 3;
this.accPtr = 0;
}
inputCount--;
}
return num;
}
/// <summary>Converts the specified region of the specified byte array from base 64.</summary>
/// <returns>The computed conversion.</returns>
/// <param name="inputBuffer">The input to convert from base 64. </param>
/// <param name="inputOffset">The offset into the byte array from which to begin using data. </param>
/// <param name="inputCount">The number of bytes in the byte array to use as data. </param>
/// <exception cref="T:System.ObjectDisposedException">The current <see cref="T:System.Security.Cryptography.FromBase64Transform" /> object has already been disposed. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="inputBuffer" /> has an invalid offset length.-or-<paramref name="inputCount" /> has an invalid value.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="inputOffset" /> is out of range. This parameter requires a non-negative number.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="inputBuffer" /> is null.</exception>
// Token: 0x06002F4C RID: 12108 RVA: 0x00098634 File Offset: 0x00096834
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
if (this.m_disposed)
{
throw new ObjectDisposedException("FromBase64Transform");
}
this.CheckInputParameters(inputBuffer, inputOffset, inputCount);
int num = 0;
int num2 = 0;
if (this.mode == FromBase64TransformMode.IgnoreWhiteSpaces)
{
int num3 = inputOffset;
for (int i = 0; i < inputCount; i++)
{
if (char.IsWhiteSpace((char)inputBuffer[num3]))
{
num++;
}
num3++;
}
if (num == inputCount)
{
return new byte[0];
}
int num4 = inputOffset + inputCount - 1;
int j = Math.Min(2, inputCount);
while (j > 0)
{
char c = (char)inputBuffer[num4--];
if (c == '=')
{
num2++;
j--;
}
else if (!char.IsWhiteSpace(c))
{
break;
}
}
}
else
{
if (inputBuffer[inputOffset + inputCount - 1] == 61)
{
num2++;
}
if (inputBuffer[inputOffset + inputCount - 2] == 61)
{
num2++;
}
}
if (inputCount < 4 && num2 < 2)
{
if (this.accPtr > 2 && this.accumulator[3] == 61)
{
num2++;
}
if (this.accPtr > 1 && this.accumulator[2] == 61)
{
num2++;
}
}
int num5 = (this.accPtr + inputCount - num >> 2) * 3 - num2;
if (num5 <= 0)
{
return new byte[0];
}
byte[] array = new byte[num5];
this.TransformBlock(inputBuffer, inputOffset, inputCount, array, 0);
return array;
}
// Token: 0x0400134B RID: 4939
private const byte TerminatorByte = 61;
// Token: 0x0400134C RID: 4940
private FromBase64TransformMode mode;
// Token: 0x0400134D RID: 4941
private byte[] accumulator;
// Token: 0x0400134E RID: 4942
private int accPtr;
// Token: 0x0400134F RID: 4943
private bool m_disposed;
// Token: 0x04001350 RID: 4944
private byte[] lookupTable;
}
}
@@ -0,0 +1,19 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Specifies whether white space should be ignored in the base 64 transformation.</summary>
// Token: 0x020004FF RID: 1279
[ComVisible(true)]
[Serializable]
public enum FromBase64TransformMode
{
/// <summary>White space should be ignored.</summary>
// Token: 0x04001349 RID: 4937
IgnoreWhiteSpaces,
/// <summary>White space should not be ignored.</summary>
// Token: 0x0400134A RID: 4938
DoNotIgnoreWhiteSpaces
}
}
@@ -0,0 +1,214 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract class from which all implementations of Hash-based Message Authentication Code (HMAC) must derive.</summary>
// Token: 0x02000501 RID: 1281
[ComVisible(true)]
public abstract class HMAC : KeyedHashAlgorithm
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMAC" /> class. </summary>
// Token: 0x06002F4D RID: 12109 RVA: 0x000987AC File Offset: 0x000969AC
protected HMAC()
{
this._disposed = false;
this._blockSizeValue = 64;
}
/// <summary>Gets or sets the block size to use in the hash value.</summary>
/// <returns>The block size to use in the hash value.</returns>
// Token: 0x17000957 RID: 2391
// (get) Token: 0x06002F4E RID: 12110 RVA: 0x000987C4 File Offset: 0x000969C4
// (set) Token: 0x06002F4F RID: 12111 RVA: 0x000987CC File Offset: 0x000969CC
protected int BlockSizeValue
{
get
{
return this._blockSizeValue;
}
set
{
this._blockSizeValue = value;
}
}
/// <summary>Gets or sets the name of the hash algorithm to use for hashing.</summary>
/// <returns>The name of the hash algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The current hash algorithm cannot be changed.</exception>
// Token: 0x17000958 RID: 2392
// (get) Token: 0x06002F50 RID: 12112 RVA: 0x000987D8 File Offset: 0x000969D8
// (set) Token: 0x06002F51 RID: 12113 RVA: 0x000987E0 File Offset: 0x000969E0
public string HashName
{
get
{
return this._hashName;
}
set
{
this._hashName = value;
this._algo = HashAlgorithm.Create(this._hashName);
}
}
/// <summary>Gets or sets the key to use in the hash algorithm.</summary>
/// <returns>The key to use in the hash algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An attempt is made to change the <see cref="P:System.Security.Cryptography.HMAC.Key" /> property after hashing has begun. </exception>
// Token: 0x17000959 RID: 2393
// (get) Token: 0x06002F52 RID: 12114 RVA: 0x000987FC File Offset: 0x000969FC
// (set) Token: 0x06002F53 RID: 12115 RVA: 0x00098810 File Offset: 0x00096A10
public override byte[] Key
{
get
{
return (byte[])base.Key.Clone();
}
set
{
if (value != null && value.Length > 64)
{
base.Key = this._algo.ComputeHash(value);
}
else
{
base.Key = (byte[])value.Clone();
}
}
}
// Token: 0x1700095A RID: 2394
// (get) Token: 0x06002F54 RID: 12116 RVA: 0x00098858 File Offset: 0x00096A58
internal BlockProcessor Block
{
get
{
if (this._block == null)
{
this._block = new BlockProcessor(this._algo, this.BlockSizeValue >> 3);
}
return this._block;
}
}
// Token: 0x06002F55 RID: 12117 RVA: 0x00098890 File Offset: 0x00096A90
private byte[] KeySetup(byte[] key, byte padding)
{
byte[] array = new byte[this.BlockSizeValue];
for (int i = 0; i < key.Length; i++)
{
array[i] = key[i] ^ padding;
}
for (int j = key.Length; j < this.BlockSizeValue; j++)
{
array[j] = padding;
}
return array;
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.HMAC" /> class when a key change is legitimate and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002F56 RID: 12118 RVA: 0x000988E4 File Offset: 0x00096AE4
protected override void Dispose(bool disposing)
{
if (!this._disposed)
{
base.Dispose(disposing);
}
}
/// <summary>When overridden in a derived class, routes data written to the object into the default <see cref="T:System.Security.Cryptography.HMAC" /> hash algorithm for computing the hash value.</summary>
/// <param name="rgb">The input data. </param>
/// <param name="ib">The offset into the byte array from which to begin using data. </param>
/// <param name="cb">The number of bytes in the array to use as data. </param>
// Token: 0x06002F57 RID: 12119 RVA: 0x000988F8 File Offset: 0x00096AF8
protected override void HashCore(byte[] rgb, int ib, int cb)
{
if (this._disposed)
{
throw new ObjectDisposedException("HMACSHA1");
}
if (this.State == 0)
{
this.Initialize();
this.State = 1;
}
this.Block.Core(rgb, ib, cb);
}
/// <summary>When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object.</summary>
/// <returns>The computed hash code in a byte array.</returns>
// Token: 0x06002F58 RID: 12120 RVA: 0x00098944 File Offset: 0x00096B44
protected override byte[] HashFinal()
{
if (this._disposed)
{
throw new ObjectDisposedException("HMAC");
}
this.State = 0;
this.Block.Final();
byte[] hash = this._algo.Hash;
byte[] array = this.KeySetup(this.Key, 92);
this._algo.Initialize();
this._algo.TransformBlock(array, 0, array.Length, array, 0);
this._algo.TransformFinalBlock(hash, 0, hash.Length);
byte[] hash2 = this._algo.Hash;
this._algo.Initialize();
Array.Clear(array, 0, array.Length);
Array.Clear(hash, 0, hash.Length);
return hash2;
}
/// <summary>Initializes an instance of the default implementation of <see cref="T:System.Security.Cryptography.HMAC" />.</summary>
// Token: 0x06002F59 RID: 12121 RVA: 0x000989F0 File Offset: 0x00096BF0
public override void Initialize()
{
if (this._disposed)
{
throw new ObjectDisposedException("HMAC");
}
this.State = 0;
this.Block.Initialize();
byte[] array = this.KeySetup(this.Key, 54);
this._algo.Initialize();
this.Block.Core(array);
Array.Clear(array, 0, array.Length);
}
/// <summary>Creates an instance of the default implementation of a Hash-based Message Authentication Code (HMAC).</summary>
/// <returns>A new SHA-1 instance, unless the default settings have been changed by using the &lt;cryptoClass&gt; element.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002F5A RID: 12122 RVA: 0x00098A58 File Offset: 0x00096C58
public new static HMAC Create()
{
return HMAC.Create("System.Security.Cryptography.HMAC");
}
/// <summary>Creates an instance of the specified implementation of a Hash-based Message Authentication Code (HMAC).</summary>
/// <returns>A new instance of the specified HMAC implementation.</returns>
/// <param name="algorithmName">The HMAC implementation to use. The following table shows the valid values for the <paramref name="algorithmName" /> parameter and the algorithms they map to.Parameter valueImplements System.Security.Cryptography.HMAC<see cref="T:System.Security.Cryptography.HMACSHA1" />System.Security.Cryptography.KeyedHashAlgorithm<see cref="T:System.Security.Cryptography.HMACSHA1" />HMACMD5<see cref="T:System.Security.Cryptography.HMACMD5" />System.Security.Cryptography.HMACMD5<see cref="T:System.Security.Cryptography.HMACMD5" />HMACRIPEMD160<see cref="T:System.Security.Cryptography.HMACRIPEMD160" />System.Security.Cryptography.HMACRIPEMD160<see cref="T:System.Security.Cryptography. HMACRIPEMD160" />HMACSHA1<see cref="T:System.Security.Cryptography.HMACSHA1" />System.Security.Cryptography.HMACSHA1<see cref="T:System.Security.Cryptography. HMACSHA1" />HMACSHA256<see cref="T:System.Security.Cryptography.HMACSHA256" />System.Security.Cryptography.HMACSHA256<see cref="T:System.Security.Cryptography.HMACSHA256" />HMACSHA384<see cref="T:System.Security.Cryptography.HMACSHA384" />System.Security.Cryptography.HMACSHA384<see cref="T:System.Security.Cryptography.HMACSHA384" />HMACSHA512<see cref="T:System.Security.Cryptography.HMACSHA512" />System.Security.Cryptography.HMACSHA512<see cref="T:System.Security.Cryptography.HMACSHA512" />MACTripleDES<see cref="T:System.Security.Cryptography. MACTripleDES" />System.Security.Cryptography.MACTripleDES<see cref="T:System.Security.Cryptography.MACTripleDES" /></param>
// Token: 0x06002F5B RID: 12123 RVA: 0x00098A64 File Offset: 0x00096C64
public new static HMAC Create(string algorithmName)
{
return (HMAC)CryptoConfig.CreateFromName(algorithmName);
}
// Token: 0x04001351 RID: 4945
private bool _disposed;
// Token: 0x04001352 RID: 4946
private string _hashName;
// Token: 0x04001353 RID: 4947
private HashAlgorithm _algo;
// Token: 0x04001354 RID: 4948
private BlockProcessor _block;
// Token: 0x04001355 RID: 4949
private int _blockSizeValue;
}
}
@@ -0,0 +1,30 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.MD5" /> hash function.</summary>
// Token: 0x02000502 RID: 1282
[ComVisible(true)]
public class HMACMD5 : HMAC
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACMD5" /> class with a randomly generated key.</summary>
// Token: 0x06002F5C RID: 12124 RVA: 0x00098A74 File Offset: 0x00096C74
public HMACMD5()
: this(KeyBuilder.Key(8))
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACMD5" /> class using the supplied key.</summary>
/// <param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACMD5" /> encryption. The key can be any length, but if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is null. </exception>
// Token: 0x06002F5D RID: 12125 RVA: 0x00098A84 File Offset: 0x00096C84
public HMACMD5(byte[] key)
{
base.HashName = "MD5";
this.HashSizeValue = 128;
this.Key = key;
}
}
}
@@ -0,0 +1,30 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.RIPEMD160" /> hash function.</summary>
// Token: 0x02000503 RID: 1283
[ComVisible(true)]
public class HMACRIPEMD160 : HMAC
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACRIPEMD160" /> class with a randomly generated 64-byte key.</summary>
// Token: 0x06002F5E RID: 12126 RVA: 0x00098AAC File Offset: 0x00096CAC
public HMACRIPEMD160()
: this(KeyBuilder.Key(8))
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACRIPEMD160" /> class with the specified key data.</summary>
/// <param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACRIPEMD160" /> encryption. The key can be any length, but if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is null. </exception>
// Token: 0x06002F5F RID: 12127 RVA: 0x00098ABC File Offset: 0x00096CBC
public HMACRIPEMD160(byte[] key)
{
base.HashName = "RIPEMD160";
this.HashSizeValue = 160;
this.Key = key;
}
}
}
@@ -0,0 +1,41 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.SHA1" /> hash function.</summary>
// Token: 0x02000504 RID: 1284
[ComVisible(true)]
public class HMACSHA1 : HMAC
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA1" /> class with a randomly generated key.</summary>
// Token: 0x06002F60 RID: 12128 RVA: 0x00098AE4 File Offset: 0x00096CE4
public HMACSHA1()
: this(KeyBuilder.Key(8))
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA1" /> class with the specified key data.</summary>
/// <param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA1" /> encryption. The key can be any length, but if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is null. </exception>
// Token: 0x06002F61 RID: 12129 RVA: 0x00098AF4 File Offset: 0x00096CF4
public HMACSHA1(byte[] key)
{
base.HashName = "SHA1";
this.HashSizeValue = 160;
this.Key = key;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA1" /> class with the specified key data and a value that specifies whether to use the managed version of the SHA-1 algorithm.</summary>
/// <param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA1" /> encryption. The key can be any length but if it is more than 64 bytes long, it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes.</param>
/// <param name="useManagedSha1">true to use the managed implementation of the SHA-1 algorithm (the <see cref="T:System.Security.Cryptography.SHA1Managed" /> class); false to use the unmanaged implementation (the <see cref="T:System.Security.Cryptography.SHA1CryptoServiceProvider" /> class). </param>
// Token: 0x06002F62 RID: 12130 RVA: 0x00098B1C File Offset: 0x00096D1C
public HMACSHA1(byte[] key, bool useManagedSha1)
{
base.HashName = "System.Security.Cryptography.SHA1" + ((!useManagedSha1) ? "CryptoServiceProvider" : "Managed");
this.HashSizeValue = 160;
this.Key = key;
}
}
}
@@ -0,0 +1,30 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.SHA256" /> hash function.</summary>
// Token: 0x02000505 RID: 1285
[ComVisible(true)]
public class HMACSHA256 : HMAC
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA256" /> class with a randomly generated key.</summary>
// Token: 0x06002F63 RID: 12131 RVA: 0x00098B68 File Offset: 0x00096D68
public HMACSHA256()
: this(KeyBuilder.Key(8))
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA256" /> class with the specified key data.</summary>
/// <param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA256" /> encryption. The key can be any length, but if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is null. </exception>
// Token: 0x06002F64 RID: 12132 RVA: 0x00098B78 File Offset: 0x00096D78
public HMACSHA256(byte[] key)
{
base.HashName = "SHA256";
this.HashSizeValue = 256;
this.Key = key;
}
}
}
@@ -0,0 +1,56 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.SHA384" /> hash function.</summary>
// Token: 0x02000506 RID: 1286
[ComVisible(true)]
public class HMACSHA384 : HMAC
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA384" /> class by using a randomly generated key.</summary>
// Token: 0x06002F65 RID: 12133 RVA: 0x00098BA0 File Offset: 0x00096DA0
public HMACSHA384()
: this(KeyBuilder.Key(8))
{
this.ProduceLegacyHmacValues = HMACSHA384.legacy_mode;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA384" /> class by using the specified key data.</summary>
/// <param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA384" /> encryption. The key can be any length. However, if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is null. </exception>
// Token: 0x06002F66 RID: 12134 RVA: 0x00098BBC File Offset: 0x00096DBC
public HMACSHA384(byte[] key)
{
this.ProduceLegacyHmacValues = HMACSHA384.legacy_mode;
base.HashName = "SHA384";
this.HashSizeValue = 384;
this.Key = key;
}
/// <summary>Provides a workaround for the .NET Framework version 2.0 implementation of the <see cref="T:System.Security.Cryptography.HMACSHA384" /> algorithm, which is inconsistent with the .NET Framework version 2.0 Service Pack 1 implementation of the algorithm.</summary>
/// <returns>true to enable .NET Framework version 2.0 Service Pack 1 applications to interact with .NET Framework 2.0 applications; otherwise, false.</returns>
// Token: 0x1700095B RID: 2395
// (get) Token: 0x06002F68 RID: 12136 RVA: 0x00098C14 File Offset: 0x00096E14
// (set) Token: 0x06002F69 RID: 12137 RVA: 0x00098C1C File Offset: 0x00096E1C
public bool ProduceLegacyHmacValues
{
get
{
return this.legacy;
}
set
{
this.legacy = value;
base.BlockSizeValue = ((!this.legacy) ? 128 : 64);
}
}
// Token: 0x04001356 RID: 4950
private static bool legacy_mode = Environment.GetEnvironmentVariable("legacyHMACMode") == "1";
// Token: 0x04001357 RID: 4951
private bool legacy;
}
}
@@ -0,0 +1,56 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.SHA512" /> hash function.</summary>
// Token: 0x02000507 RID: 1287
[ComVisible(true)]
public class HMACSHA512 : HMAC
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA512" /> class with a randomly generated key.</summary>
// Token: 0x06002F6A RID: 12138 RVA: 0x00098C50 File Offset: 0x00096E50
public HMACSHA512()
: this(KeyBuilder.Key(8))
{
this.ProduceLegacyHmacValues = HMACSHA512.legacy_mode;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA512" /> class with the specified key data.</summary>
/// <param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA512" /> encryption. The key can be any length. However, if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is null. </exception>
// Token: 0x06002F6B RID: 12139 RVA: 0x00098C6C File Offset: 0x00096E6C
public HMACSHA512(byte[] key)
{
this.ProduceLegacyHmacValues = HMACSHA512.legacy_mode;
base.HashName = "SHA512";
this.HashSizeValue = 512;
this.Key = key;
}
/// <summary>Provides a workaround for the .NET Framework version 2.0 implementation of the <see cref="T:System.Security.Cryptography.HMACSHA512" /> algorithm, which is inconsistent with the .NET Framework version 2.0 Service Pack 1 implementation.</summary>
/// <returns>true to enable .NET Framework version 2.0 Service Pack 1 applications to interact with .NET Framework 2.0 applications; otherwise, false.</returns>
// Token: 0x1700095C RID: 2396
// (get) Token: 0x06002F6D RID: 12141 RVA: 0x00098CC4 File Offset: 0x00096EC4
// (set) Token: 0x06002F6E RID: 12142 RVA: 0x00098CCC File Offset: 0x00096ECC
public bool ProduceLegacyHmacValues
{
get
{
return this.legacy;
}
set
{
this.legacy = value;
base.BlockSizeValue = ((!this.legacy) ? 128 : 64);
}
}
// Token: 0x04001358 RID: 4952
private static bool legacy_mode = Environment.GetEnvironmentVariable("legacyHMACMode") == "1";
// Token: 0x04001359 RID: 4953
private bool legacy;
}
}
@@ -0,0 +1,337 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class from which all implementations of cryptographic hash algorithms must derive.</summary>
// Token: 0x02000508 RID: 1288
[ComVisible(true)]
public abstract class HashAlgorithm : IDisposable, ICryptoTransform
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HashAlgorithm" /> class.</summary>
// Token: 0x06002F6F RID: 12143 RVA: 0x00098D00 File Offset: 0x00096F00
protected HashAlgorithm()
{
this.disposed = false;
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.HashAlgorithm" /> and optionally releases the managed resources.</summary>
// Token: 0x06002F70 RID: 12144 RVA: 0x00098D10 File Offset: 0x00096F10
void IDisposable.Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>When overridden in a derived class, gets a value indicating whether multiple blocks can be transformed.</summary>
/// <returns>true if multiple blocks can be transformed; otherwise, false.</returns>
// Token: 0x1700095D RID: 2397
// (get) Token: 0x06002F71 RID: 12145 RVA: 0x00098D20 File Offset: 0x00096F20
public virtual bool CanTransformMultipleBlocks
{
get
{
return true;
}
}
/// <summary>Gets a value indicating whether the current transform can be reused.</summary>
/// <returns>Always true.</returns>
// Token: 0x1700095E RID: 2398
// (get) Token: 0x06002F72 RID: 12146 RVA: 0x00098D24 File Offset: 0x00096F24
public virtual bool CanReuseTransform
{
get
{
return true;
}
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.HashAlgorithm" /> class.</summary>
// Token: 0x06002F73 RID: 12147 RVA: 0x00098D28 File Offset: 0x00096F28
public void Clear()
{
this.Dispose(true);
}
/// <summary>Computes the hash value for the specified byte array.</summary>
/// <returns>The computed hash code.</returns>
/// <param name="buffer">The input to compute the hash code for. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="buffer" /> is null.</exception>
/// <exception cref="T:System.ObjectDisposedException">The object has already been disposed.</exception>
// Token: 0x06002F74 RID: 12148 RVA: 0x00098D34 File Offset: 0x00096F34
public byte[] ComputeHash(byte[] buffer)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
return this.ComputeHash(buffer, 0, buffer.Length);
}
/// <summary>Computes the hash value for the specified region of the specified byte array.</summary>
/// <returns>The computed hash code.</returns>
/// <param name="buffer">The input to compute the hash code for. </param>
/// <param name="offset">The offset into the byte array from which to begin using data. </param>
/// <param name="count">The number of bytes in the array to use as data. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="count" /> is an invalid value.-or-<paramref name="buffer" /> length is invalid.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="buffer" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="offset" /> is out of range. This parameter requires a non-negative number.</exception>
/// <exception cref="T:System.ObjectDisposedException">The object has already been disposed.</exception>
// Token: 0x06002F75 RID: 12149 RVA: 0x00098D54 File Offset: 0x00096F54
public byte[] ComputeHash(byte[] buffer, int offset, int count)
{
if (this.disposed)
{
throw new ObjectDisposedException("HashAlgorithm");
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", "< 0");
}
if (count < 0)
{
throw new ArgumentException("count", "< 0");
}
if (offset > buffer.Length - count)
{
throw new ArgumentException("offset + count", Locale.GetText("Overflow"));
}
this.HashCore(buffer, offset, count);
this.HashValue = this.HashFinal();
this.Initialize();
return this.HashValue;
}
/// <summary>Computes the hash value for the specified <see cref="T:System.IO.Stream" /> object.</summary>
/// <returns>The computed hash code.</returns>
/// <param name="inputStream">The input to compute the hash code for. </param>
/// <exception cref="T:System.ObjectDisposedException">The object has already been disposed.</exception>
// Token: 0x06002F76 RID: 12150 RVA: 0x00098DF8 File Offset: 0x00096FF8
public byte[] ComputeHash(Stream inputStream)
{
if (this.disposed)
{
throw new ObjectDisposedException("HashAlgorithm");
}
byte[] array = new byte[4096];
for (int i = inputStream.Read(array, 0, 4096); i > 0; i = inputStream.Read(array, 0, 4096))
{
this.HashCore(array, 0, i);
}
this.HashValue = this.HashFinal();
this.Initialize();
return this.HashValue;
}
/// <summary>Creates an instance of the default implementation of a hash algorithm.</summary>
/// <returns>A new <see cref="T:System.Security.Cryptography.SHA1CryptoServiceProvider" /> instance, unless the default settings have been changed using the &lt;cryptoClass&gt; element.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002F77 RID: 12151 RVA: 0x00098E70 File Offset: 0x00097070
public static HashAlgorithm Create()
{
return HashAlgorithm.Create("System.Security.Cryptography.HashAlgorithm");
}
/// <summary>Creates an instance of the specified implementation of a hash algorithm.</summary>
/// <returns>A new instance of the specified hash algorithm, or null if <paramref name="hashName" /> is not a valid hash algorithm.</returns>
/// <param name="hashName">The hash algorithm implementation to use. The following table shows the valid values for the <paramref name="hashName" /> parameter and the algorithms they map to. Parameter value Implements SHA <see cref="T:System.Security.Cryptography.SHA1CryptoServiceProvider" />SHA1 <see cref="T:System.Security.Cryptography.SHA1CryptoServiceProvider" />System.Security.Cryptography.SHA1 <see cref="T:System.Security.Cryptography.SHA1CryptoServiceProvider" />System.Security.Cryptography.HashAlgorithm <see cref="T:System.Security.Cryptography.SHA1CryptoServiceProvider" />MD5 <see cref="T:System.Security.Cryptography.MD5CryptoServiceProvider" />System.Security.Cryptography.MD5 <see cref="T:System.Security.Cryptography.MD5CryptoServiceProvider" />SHA256 <see cref="T:System.Security.Cryptography.SHA256Managed" />SHA-256 <see cref="T:System.Security.Cryptography.SHA256Managed" />System.Security.Cryptography.SHA256 <see cref="T:System.Security.Cryptography.SHA256Managed" />SHA384 <see cref="T:System.Security.Cryptography.SHA384Managed" />SHA-384 <see cref="T:System.Security.Cryptography.SHA384Managed" />System.Security.Cryptography.SHA384 <see cref="T:System.Security.Cryptography.SHA384Managed" />SHA512 <see cref="T:System.Security.Cryptography.SHA512Managed" />SHA-512 <see cref="T:System.Security.Cryptography.SHA512Managed" />System.Security.Cryptography.SHA512 <see cref="T:System.Security.Cryptography.SHA512Managed" /></param>
// Token: 0x06002F78 RID: 12152 RVA: 0x00098E7C File Offset: 0x0009707C
public static HashAlgorithm Create(string hashName)
{
return (HashAlgorithm)CryptoConfig.CreateFromName(hashName);
}
/// <summary>Gets the value of the computed hash code.</summary>
/// <returns>The current value of the computed hash code.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">
/// <see cref="F:System.Security.Cryptography.HashAlgorithm.HashValue" /> is null. </exception>
/// <exception cref="T:System.ObjectDisposedException">The object has already been disposed.</exception>
// Token: 0x1700095F RID: 2399
// (get) Token: 0x06002F79 RID: 12153 RVA: 0x00098E8C File Offset: 0x0009708C
public virtual byte[] Hash
{
get
{
if (this.HashValue == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("No hash value computed."));
}
return this.HashValue;
}
}
/// <summary>When overridden in a derived class, routes data written to the object into the hash algorithm for computing the hash.</summary>
/// <param name="array">The input to compute the hash code for. </param>
/// <param name="ibStart">The offset into the byte array from which to begin using data. </param>
/// <param name="cbSize">The number of bytes in the byte array to use as data. </param>
// Token: 0x06002F7A RID: 12154
protected abstract void HashCore(byte[] array, int ibStart, int cbSize);
/// <summary>When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object.</summary>
/// <returns>The computed hash code.</returns>
// Token: 0x06002F7B RID: 12155
protected abstract byte[] HashFinal();
/// <summary>Gets the size, in bits, of the computed hash code.</summary>
/// <returns>The size, in bits, of the computed hash code.</returns>
// Token: 0x17000960 RID: 2400
// (get) Token: 0x06002F7C RID: 12156 RVA: 0x00098EB0 File Offset: 0x000970B0
public virtual int HashSize
{
get
{
return this.HashSizeValue;
}
}
/// <summary>Initializes an implementation of the <see cref="T:System.Security.Cryptography.HashAlgorithm" /> class.</summary>
// Token: 0x06002F7D RID: 12157
public abstract void Initialize();
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.HashAlgorithm" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002F7E RID: 12158 RVA: 0x00098EB8 File Offset: 0x000970B8
protected virtual void Dispose(bool disposing)
{
this.disposed = true;
}
/// <summary>When overridden in a derived class, gets the input block size.</summary>
/// <returns>The input block size.</returns>
// Token: 0x17000961 RID: 2401
// (get) Token: 0x06002F7F RID: 12159 RVA: 0x00098EC4 File Offset: 0x000970C4
public virtual int InputBlockSize
{
get
{
return 1;
}
}
/// <summary>When overridden in a derived class, gets the output block size.</summary>
/// <returns>The output block size.</returns>
// Token: 0x17000962 RID: 2402
// (get) Token: 0x06002F80 RID: 12160 RVA: 0x00098EC8 File Offset: 0x000970C8
public virtual int OutputBlockSize
{
get
{
return 1;
}
}
/// <summary>Computes the hash value for the specified region of the input byte array and copies the specified region of the input byte array to the specified region of the output byte array.</summary>
/// <returns>The number of bytes written.</returns>
/// <param name="inputBuffer">The input to compute the hash code for. </param>
/// <param name="inputOffset">The offset into the input byte array from which to begin using data. </param>
/// <param name="inputCount">The number of bytes in the input byte array to use as data. </param>
/// <param name="outputBuffer">A copy of the part of the input array used to compute the hash code. </param>
/// <param name="outputOffset">The offset into the output byte array from which to begin writing data. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="inputCount" /> uses an invalid value.-or-<paramref name="inputBuffer" /> has an invalid length.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="inputBuffer" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="inputOffset" /> is out of range. This parameter requires a non-negative number.</exception>
/// <exception cref="T:System.ObjectDisposedException">The object has already been disposed.</exception>
// Token: 0x06002F81 RID: 12161 RVA: 0x00098ECC File Offset: 0x000970CC
public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
if (inputBuffer == null)
{
throw new ArgumentNullException("inputBuffer");
}
if (inputOffset < 0)
{
throw new ArgumentOutOfRangeException("inputOffset", "< 0");
}
if (inputCount < 0)
{
throw new ArgumentException("inputCount");
}
if (inputOffset < 0 || inputOffset > inputBuffer.Length - inputCount)
{
throw new ArgumentException("inputBuffer");
}
if (outputBuffer != null)
{
if (outputOffset < 0)
{
throw new ArgumentOutOfRangeException("outputOffset", "< 0");
}
if (outputOffset > outputBuffer.Length - inputCount)
{
throw new ArgumentException("outputOffset + inputCount", Locale.GetText("Overflow"));
}
}
this.HashCore(inputBuffer, inputOffset, inputCount);
if (outputBuffer != null)
{
Buffer.BlockCopy(inputBuffer, inputOffset, outputBuffer, outputOffset, inputCount);
}
return inputCount;
}
/// <summary>Computes the hash value for the specified region of the specified byte array.</summary>
/// <returns>An array that is a copy of the part of the input that is hashed.</returns>
/// <param name="inputBuffer">The input to compute the hash code for. </param>
/// <param name="inputOffset">The offset into the byte array from which to begin using data. </param>
/// <param name="inputCount">The number of bytes in the byte array to use as data. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="inputCount" /> uses an invalid value.-or-<paramref name="inputBuffer" /> has an invalid offset length.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="inputBuffer" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="inputOffset" /> is out of range. This parameter requires a non-negative number.</exception>
/// <exception cref="T:System.ObjectDisposedException">The object has already been disposed.</exception>
// Token: 0x06002F82 RID: 12162 RVA: 0x00098F90 File Offset: 0x00097190
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
if (inputBuffer == null)
{
throw new ArgumentNullException("inputBuffer");
}
if (inputCount < 0)
{
throw new ArgumentException("inputCount");
}
if (inputOffset > inputBuffer.Length - inputCount)
{
throw new ArgumentException("inputOffset + inputCount", Locale.GetText("Overflow"));
}
byte[] array = new byte[inputCount];
Buffer.BlockCopy(inputBuffer, inputOffset, array, 0, inputCount);
this.HashCore(inputBuffer, inputOffset, inputCount);
this.HashValue = this.HashFinal();
this.Initialize();
return array;
}
/// <summary>Represents the value of the computed hash code.</summary>
// Token: 0x0400135A RID: 4954
protected internal byte[] HashValue;
/// <summary>Represents the size, in bits, of the computed hash code.</summary>
// Token: 0x0400135B RID: 4955
protected int HashSizeValue;
/// <summary>Represents the state of the hash computation.</summary>
// Token: 0x0400135C RID: 4956
protected int State;
// Token: 0x0400135D RID: 4957
private bool disposed;
}
}
@@ -0,0 +1,53 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Defines the basic operations of cryptographic transformations.</summary>
// Token: 0x02000509 RID: 1289
[ComVisible(true)]
public interface ICryptoTransform : IDisposable
{
/// <summary>Gets a value indicating whether the current transform can be reused.</summary>
/// <returns>true if the current transform can be reused; otherwise, false.</returns>
// Token: 0x17000963 RID: 2403
// (get) Token: 0x06002F83 RID: 12163
bool CanReuseTransform { get; }
/// <summary>Gets a value indicating whether multiple blocks can be transformed.</summary>
/// <returns>true if multiple blocks can be transformed; otherwise, false.</returns>
// Token: 0x17000964 RID: 2404
// (get) Token: 0x06002F84 RID: 12164
bool CanTransformMultipleBlocks { get; }
/// <summary>Gets the input block size.</summary>
/// <returns>The size of the input data blocks in bytes.</returns>
// Token: 0x17000965 RID: 2405
// (get) Token: 0x06002F85 RID: 12165
int InputBlockSize { get; }
/// <summary>Gets the output block size.</summary>
/// <returns>The size of the output data blocks in bytes.</returns>
// Token: 0x17000966 RID: 2406
// (get) Token: 0x06002F86 RID: 12166
int OutputBlockSize { get; }
/// <summary>Transforms the specified region of the input byte array and copies the resulting transform to the specified region of the output byte array.</summary>
/// <returns>The number of bytes written.</returns>
/// <param name="inputBuffer">The input for which to compute the transform. </param>
/// <param name="inputOffset">The offset into the input byte array from which to begin using data. </param>
/// <param name="inputCount">The number of bytes in the input byte array to use as data. </param>
/// <param name="outputBuffer">The output to which to write the transform. </param>
/// <param name="outputOffset">The offset into the output byte array from which to begin writing data. </param>
// Token: 0x06002F87 RID: 12167
int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
/// <summary>Transforms the specified region of the specified byte array.</summary>
/// <returns>The computed transform.</returns>
/// <param name="inputBuffer">The input for which to compute the transform. </param>
/// <param name="inputOffset">The offset into the byte array from which to begin using data. </param>
/// <param name="inputCount">The number of bytes in the byte array to use as data. </param>
// Token: 0x06002F88 RID: 12168
byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount);
}
}
@@ -0,0 +1,28 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Defines methods that allow an <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> class to enumerate key container information, and import and export Microsoft Cryptographic API (CAPI)–compatible key blobs.</summary>
// Token: 0x0200050A RID: 1290
[ComVisible(true)]
public interface ICspAsymmetricAlgorithm
{
/// <summary>Exports a blob that contains the key information associated with an <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> object. </summary>
/// <returns>A byte array that contains the key information associated with an <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> object.</returns>
/// <param name="includePrivateParameters">true to include the private key; otherwise, false.</param>
// Token: 0x06002F89 RID: 12169
byte[] ExportCspBlob(bool includePrivateParameters);
/// <summary>Imports a blob that represents asymmetric key information. </summary>
/// <param name="rawData">A byte array that represents an asymmetric key blob.</param>
// Token: 0x06002F8A RID: 12170
void ImportCspBlob(byte[] rawData);
/// <summary>Gets a <see cref="T:System.Security.Cryptography.CspKeyContainerInfo" /> object that describes additional information about a cryptographic key pair.</summary>
/// <returns>A <see cref="T:System.Security.Cryptography.CspKeyContainerInfo" /> object that describes additional information about a cryptographic key pair.</returns>
// Token: 0x17000967 RID: 2407
// (get) Token: 0x06002F8B RID: 12171
CspKeyContainerInfo CspKeyContainerInfo { get; }
}
}
@@ -0,0 +1,19 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Specifies whether to create an asymmetric signature key or an asymmetric exchange key. </summary>
// Token: 0x0200050B RID: 1291
[ComVisible(true)]
[Serializable]
public enum KeyNumber
{
/// <summary>An exchange key pair used to encrypt session keys so that they can be safely stored and exchanged with other users. </summary>
// Token: 0x0400135F RID: 4959
Exchange = 1,
/// <summary>A signature key pair used for authenticating digitally signed messages or files.</summary>
// Token: 0x04001360 RID: 4960
Signature
}
}
@@ -0,0 +1,87 @@
using System;
namespace System.Security.Cryptography
{
/// <summary>Determines the set of valid key sizes for the symmetric cryptographic algorithms.</summary>
// Token: 0x0200050C RID: 1292
public sealed class KeySizes
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.KeySizes" /> class with the specified key values.</summary>
/// <param name="minSize">The minimum valid key size. </param>
/// <param name="maxSize">The maximum valid key size. </param>
/// <param name="skipSize">The interval between valid key sizes. </param>
// Token: 0x06002F8C RID: 12172 RVA: 0x00099010 File Offset: 0x00097210
public KeySizes(int minSize, int maxSize, int skipSize)
{
this._maxSize = maxSize;
this._minSize = minSize;
this._skipSize = skipSize;
}
/// <summary>Specifies the maximum key size in bits.</summary>
/// <returns>The maximum key size in bits.</returns>
// Token: 0x17000968 RID: 2408
// (get) Token: 0x06002F8D RID: 12173 RVA: 0x00099030 File Offset: 0x00097230
public int MaxSize
{
get
{
return this._maxSize;
}
}
/// <summary>Specifies the minimum key size in bits.</summary>
/// <returns>The minimum key size in bits.</returns>
// Token: 0x17000969 RID: 2409
// (get) Token: 0x06002F8E RID: 12174 RVA: 0x00099038 File Offset: 0x00097238
public int MinSize
{
get
{
return this._minSize;
}
}
/// <summary>Specifies the interval between valid key sizes in bits.</summary>
/// <returns>The interval between valid key sizes in bits.</returns>
// Token: 0x1700096A RID: 2410
// (get) Token: 0x06002F8F RID: 12175 RVA: 0x00099040 File Offset: 0x00097240
public int SkipSize
{
get
{
return this._skipSize;
}
}
// Token: 0x06002F90 RID: 12176 RVA: 0x00099048 File Offset: 0x00097248
internal bool IsLegal(int keySize)
{
int num = keySize - this.MinSize;
bool flag = num >= 0 && keySize <= this.MaxSize;
return (this.SkipSize != 0) ? (flag && num % this.SkipSize == 0) : flag;
}
// Token: 0x06002F91 RID: 12177 RVA: 0x0009909C File Offset: 0x0009729C
internal static bool IsLegalKeySize(KeySizes[] legalKeys, int size)
{
foreach (KeySizes keySizes in legalKeys)
{
if (keySizes.IsLegal(size))
{
return true;
}
}
return false;
}
// Token: 0x04001361 RID: 4961
private int _maxSize;
// Token: 0x04001362 RID: 4962
private int _minSize;
// Token: 0x04001363 RID: 4963
private int _skipSize;
}
}
@@ -0,0 +1,82 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract class from which all implementations of keyed hash algorithms must derive. </summary>
// Token: 0x0200050D RID: 1293
[ComVisible(true)]
public abstract class KeyedHashAlgorithm : HashAlgorithm
{
// Token: 0x06002F93 RID: 12179 RVA: 0x000990DC File Offset: 0x000972DC
~KeyedHashAlgorithm()
{
this.Dispose(false);
}
/// <summary>Gets or sets the key to use in the hash algorithm.</summary>
/// <returns>The key to use in the hash algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An attempt was made to change the <see cref="P:System.Security.Cryptography.KeyedHashAlgorithm.Key" /> property after hashing has begun. </exception>
// Token: 0x1700096B RID: 2411
// (get) Token: 0x06002F94 RID: 12180 RVA: 0x00099118 File Offset: 0x00097318
// (set) Token: 0x06002F95 RID: 12181 RVA: 0x0009912C File Offset: 0x0009732C
public virtual byte[] Key
{
get
{
return (byte[])this.KeyValue.Clone();
}
set
{
if (this.State != 0)
{
throw new CryptographicException(Locale.GetText("Key can't be changed at this state."));
}
this.ZeroizeKey();
this.KeyValue = (byte[])value.Clone();
}
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.KeyedHashAlgorithm" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002F96 RID: 12182 RVA: 0x0009916C File Offset: 0x0009736C
protected override void Dispose(bool disposing)
{
this.ZeroizeKey();
base.Dispose(disposing);
}
// Token: 0x06002F97 RID: 12183 RVA: 0x0009917C File Offset: 0x0009737C
private void ZeroizeKey()
{
if (this.KeyValue != null)
{
Array.Clear(this.KeyValue, 0, this.KeyValue.Length);
}
}
/// <summary>Creates an instance of the default implementation of a keyed hash algorithm.</summary>
/// <returns>A new <see cref="T:System.Security.Cryptography.HMACSHA1" /> instance, unless the default settings have been changed.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002F98 RID: 12184 RVA: 0x000991A0 File Offset: 0x000973A0
public new static KeyedHashAlgorithm Create()
{
return KeyedHashAlgorithm.Create("System.Security.Cryptography.KeyedHashAlgorithm");
}
/// <summary>Creates an instance of the specified implementation of a keyed hash algorithm.</summary>
/// <returns>A new instance of the specified keyed hash algorithm.</returns>
/// <param name="algName">The keyed hash algorithm implementation to use. The following table shows the valid values for the <paramref name="algName" /> parameter and the algorithms they map to.Parameter valueImplements System.Security.Cryptography.HMAC<see cref="T:System.Security.Cryptography.HMACSHA1" />System.Security.Cryptography.KeyedHashAlgorithm<see cref="T:System.Security.Cryptography.HMACSHA1" />HMACMD5<see cref="T:System.Security.Cryptography.HMACMD5" />System.Security.Cryptography.HMACMD5<see cref="T:System.Security.Cryptography.HMACMD5" />HMACRIPEMD160<see cref="T:System.Security.Cryptography.HMACRIPEMD160" />System.Security.Cryptography.HMACRIPEMD160<see cref="T:System.Security.Cryptography. HMACRIPEMD160" />HMACSHA1<see cref="T:System.Security.Cryptography.HMACSHA1" />System.Security.Cryptography.HMACSHA1<see cref="T:System.Security.Cryptography. HMACSHA1" />HMACSHA256<see cref="T:System.Security.Cryptography.HMACSHA256" />System.Security.Cryptography.HMACSHA256<see cref="T:System.Security.Cryptography.HMACSHA256" />HMACSHA384<see cref="T:System.Security.Cryptography.HMACSHA384" />System.Security.Cryptography.HMACSHA384<see cref="T:System.Security.Cryptography.HMACSHA384" />HMACSHA512<see cref="T:System.Security.Cryptography.HMACSHA512" />System.Security.Cryptography.HMACSHA512<see cref="T:System.Security.Cryptography.HMACSHA512" />MACTripleDES<see cref="T:System.Security.Cryptography. MACTripleDES" />System.Security.Cryptography.MACTripleDES<see cref="T:System.Security.Cryptography.MACTripleDES" /></param>
// Token: 0x06002F99 RID: 12185 RVA: 0x000991AC File Offset: 0x000973AC
public new static KeyedHashAlgorithm Create(string algName)
{
return (KeyedHashAlgorithm)CryptoConfig.CreateFromName(algName);
}
/// <summary>The key to use in the hash algorithm.</summary>
// Token: 0x04001364 RID: 4964
protected byte[] KeyValue;
}
}
@@ -0,0 +1,173 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes a Message Authentication Code (MAC) using <see cref="T:System.Security.Cryptography.TripleDES" /> for the input data <see cref="T:System.Security.Cryptography.CryptoStream" />.</summary>
// Token: 0x0200050E RID: 1294
[ComVisible(true)]
public class MACTripleDES : KeyedHashAlgorithm
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.MACTripleDES" /> class.</summary>
// Token: 0x06002F9A RID: 12186 RVA: 0x000991BC File Offset: 0x000973BC
public MACTripleDES()
{
this.Setup("TripleDES", null);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.MACTripleDES" /> class with the specified key data.</summary>
/// <param name="rgbKey">The secret key for <see cref="T:System.Security.Cryptography.MACTripleDES" /> encryption. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbKey" /> parameter is null. </exception>
// Token: 0x06002F9B RID: 12187 RVA: 0x000991D0 File Offset: 0x000973D0
public MACTripleDES(byte[] rgbKey)
{
if (rgbKey == null)
{
throw new ArgumentNullException("rgbKey");
}
this.Setup("TripleDES", rgbKey);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.MACTripleDES" /> class with the specified key data using the specified implementation of <see cref="T:System.Security.Cryptography.TripleDES" />.</summary>
/// <param name="strTripleDES">The name of the <see cref="T:System.Security.Cryptography.TripleDES" /> implementation to use. </param>
/// <param name="rgbKey">The secret key for <see cref="T:System.Security.Cryptography.MACTripleDES" /> encryption. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbKey" /> parameter is null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The <paramref name="strTripleDES" /> parameter is not a valid name of a <see cref="T:System.Security.Cryptography.TripleDES" /> implementation. </exception>
// Token: 0x06002F9C RID: 12188 RVA: 0x000991F8 File Offset: 0x000973F8
public MACTripleDES(string strTripleDES, byte[] rgbKey)
{
if (rgbKey == null)
{
throw new ArgumentNullException("rgbKey");
}
if (strTripleDES == null)
{
this.Setup("TripleDES", rgbKey);
}
else
{
this.Setup(strTripleDES, rgbKey);
}
}
// Token: 0x06002F9D RID: 12189 RVA: 0x0009923C File Offset: 0x0009743C
private void Setup(string strTripleDES, byte[] rgbKey)
{
this.tdes = TripleDES.Create(strTripleDES);
this.tdes.Padding = PaddingMode.Zeros;
if (rgbKey != null)
{
this.tdes.Key = rgbKey;
}
this.HashSizeValue = this.tdes.BlockSize;
this.Key = this.tdes.Key;
this.mac = new MACAlgorithm(this.tdes);
this.m_disposed = false;
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.MACTripleDES" />.</summary>
// Token: 0x06002F9E RID: 12190 RVA: 0x000992B0 File Offset: 0x000974B0
~MACTripleDES()
{
this.Dispose(false);
}
/// <summary>Gets or sets the padding mode used in the hashing algorithm.</summary>
/// <returns>The padding mode used in the hashing algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The property cannot be set because the padding mode is invalid.</exception>
// Token: 0x1700096C RID: 2412
// (get) Token: 0x06002F9F RID: 12191 RVA: 0x000992EC File Offset: 0x000974EC
// (set) Token: 0x06002FA0 RID: 12192 RVA: 0x000992FC File Offset: 0x000974FC
[ComVisible(false)]
public PaddingMode Padding
{
get
{
return this.tdes.Padding;
}
set
{
this.tdes.Padding = value;
}
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.MACTripleDES" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002FA1 RID: 12193 RVA: 0x0009930C File Offset: 0x0009750C
protected override void Dispose(bool disposing)
{
if (!this.m_disposed)
{
if (this.KeyValue != null)
{
Array.Clear(this.KeyValue, 0, this.KeyValue.Length);
}
if (this.tdes != null)
{
this.tdes.Clear();
}
if (disposing)
{
this.KeyValue = null;
this.tdes = null;
}
base.Dispose(disposing);
this.m_disposed = true;
}
}
/// <summary>Initializes an instance of <see cref="T:System.Security.Cryptography.MACTripleDES" />.</summary>
// Token: 0x06002FA2 RID: 12194 RVA: 0x0009937C File Offset: 0x0009757C
public override void Initialize()
{
if (this.m_disposed)
{
throw new ObjectDisposedException("MACTripleDES");
}
this.State = 0;
this.mac.Initialize(this.KeyValue);
}
/// <summary>Routes data written to the object into the <see cref="T:System.Security.Cryptography.TripleDES" /> encryptor for computing the Message Authentication Code (MAC).</summary>
/// <param name="rgbData">The input data. </param>
/// <param name="ibStart">The offset into the byte array from which to begin using data. </param>
/// <param name="cbSize">The number of bytes in the array to use as data. </param>
// Token: 0x06002FA3 RID: 12195 RVA: 0x000993B8 File Offset: 0x000975B8
protected override void HashCore(byte[] rgbData, int ibStart, int cbSize)
{
if (this.m_disposed)
{
throw new ObjectDisposedException("MACTripleDES");
}
if (this.State == 0)
{
this.Initialize();
this.State = 1;
}
this.mac.Core(rgbData, ibStart, cbSize);
}
/// <summary>Returns the computed Message Authentication Code (MAC) after all data is written to the object.</summary>
/// <returns>The computed MAC.</returns>
// Token: 0x06002FA4 RID: 12196 RVA: 0x00099404 File Offset: 0x00097604
protected override byte[] HashFinal()
{
if (this.m_disposed)
{
throw new ObjectDisposedException("MACTripleDES");
}
this.State = 0;
return this.mac.Final();
}
// Token: 0x04001365 RID: 4965
private TripleDES tdes;
// Token: 0x04001366 RID: 4966
private MACAlgorithm mac;
// Token: 0x04001367 RID: 4967
private bool m_disposed;
}
}
@@ -0,0 +1,40 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract class from which all implementations of the <see cref="T:System.Security.Cryptography.MD5" /> hash algorithm inherit. </summary>
// Token: 0x0200050F RID: 1295
[ComVisible(true)]
public abstract class MD5 : HashAlgorithm
{
/// <summary>Initializes a new instance of <see cref="T:System.Security.Cryptography.MD5" />.</summary>
// Token: 0x06002FA5 RID: 12197 RVA: 0x0009943C File Offset: 0x0009763C
protected MD5()
{
this.HashSizeValue = 128;
}
/// <summary>Creates an instance of the default implementation of the <see cref="T:System.Security.Cryptography.MD5" /> hash algorithm.</summary>
/// <returns>A new instance of the <see cref="T:System.Security.Cryptography.MD5" /> hash algorithm.</returns>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002FA6 RID: 12198 RVA: 0x00099450 File Offset: 0x00097650
public new static MD5 Create()
{
return MD5.Create("System.Security.Cryptography.MD5");
}
/// <summary>Creates an instance of the specified implementation of the <see cref="T:System.Security.Cryptography.MD5" /> hash algorithm.</summary>
/// <returns>A new instance of the specified implementation of <see cref="T:System.Security.Cryptography.MD5" />.</returns>
/// <param name="algName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.MD5" /> to use. </param>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="algName" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
// Token: 0x06002FA7 RID: 12199 RVA: 0x0009945C File Offset: 0x0009765C
public new static MD5 Create(string algName)
{
return (MD5)CryptoConfig.CreateFromName(algName);
}
}
}
@@ -0,0 +1,406 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.MD5" /> hash value for the input data using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited. </summary>
// Token: 0x02000510 RID: 1296
[ComVisible(true)]
public sealed class MD5CryptoServiceProvider : MD5
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.MD5CryptoServiceProvider" /> class.</summary>
/// <exception cref="T:System.InvalidOperationException">A FIPS-compliant algorithm policy is not being used.</exception>
// Token: 0x06002FA8 RID: 12200 RVA: 0x0009946C File Offset: 0x0009766C
public MD5CryptoServiceProvider()
{
this._H = new uint[4];
this.buff = new uint[16];
this._ProcessingBuffer = new byte[64];
this.Initialize();
}
// Token: 0x06002FAA RID: 12202 RVA: 0x000994C8 File Offset: 0x000976C8
~MD5CryptoServiceProvider()
{
this.Dispose(false);
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.MD5CryptoServiceProvider" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06002FAB RID: 12203 RVA: 0x00099504 File Offset: 0x00097704
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (this._ProcessingBuffer != null)
{
Array.Clear(this._ProcessingBuffer, 0, this._ProcessingBuffer.Length);
this._ProcessingBuffer = null;
}
if (this._H != null)
{
Array.Clear(this._H, 0, this._H.Length);
this._H = null;
}
if (this.buff != null)
{
Array.Clear(this.buff, 0, this.buff.Length);
this.buff = null;
}
}
base.Dispose(disposing);
}
/// <summary>Routes data written to the object into the <see cref="T:System.Security.Cryptography.MD5" /> hash algorithm for computing the hash value.</summary>
/// <param name="rgb">The array of data bytes. </param>
/// <param name="ibStart">The offset into the byte array from which to begin using data. </param>
/// <param name="cbSize">The number of bytes in the array to use as data. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- The hash cannot be created. </exception>
// Token: 0x06002FAC RID: 12204 RVA: 0x00099590 File Offset: 0x00097790
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
this.State = 1;
if (this._ProcessingBufferCount != 0)
{
if (cbSize < 64 - this._ProcessingBufferCount)
{
Buffer.BlockCopy(rgb, ibStart, this._ProcessingBuffer, this._ProcessingBufferCount, cbSize);
this._ProcessingBufferCount += cbSize;
return;
}
int i = 64 - this._ProcessingBufferCount;
Buffer.BlockCopy(rgb, ibStart, this._ProcessingBuffer, this._ProcessingBufferCount, i);
this.ProcessBlock(this._ProcessingBuffer, 0);
this._ProcessingBufferCount = 0;
ibStart += i;
cbSize -= i;
}
for (int i = 0; i < cbSize - cbSize % 64; i += 64)
{
this.ProcessBlock(rgb, ibStart + i);
}
if (cbSize % 64 != 0)
{
Buffer.BlockCopy(rgb, cbSize - cbSize % 64 + ibStart, this._ProcessingBuffer, 0, cbSize % 64);
this._ProcessingBufferCount = cbSize % 64;
}
}
/// <summary>Returns the computed <see cref="T:System.Security.Cryptography.MD5CryptoServiceProvider" /> hash value as an array of bytes after all data has been written to the object.</summary>
/// <returns>The computed hash value.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- The hash cannot be created. </exception>
// Token: 0x06002FAD RID: 12205 RVA: 0x0009966C File Offset: 0x0009786C
protected override byte[] HashFinal()
{
byte[] array = new byte[16];
this.ProcessFinalBlock(this._ProcessingBuffer, 0, this._ProcessingBufferCount);
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 4; j++)
{
array[i * 4 + j] = (byte)(this._H[i] >> j * 8);
}
}
return array;
}
/// <summary>Re-instantiates this instance of the <see cref="T:System.Security.Cryptography.MD5CryptoServiceProvider" />.</summary>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002FAE RID: 12206 RVA: 0x000996D0 File Offset: 0x000978D0
public override void Initialize()
{
this.count = 0UL;
this._ProcessingBufferCount = 0;
this._H[0] = 1732584193U;
this._H[1] = 4023233417U;
this._H[2] = 2562383102U;
this._H[3] = 271733878U;
}
// Token: 0x06002FAF RID: 12207 RVA: 0x00099720 File Offset: 0x00097920
private void ProcessBlock(byte[] inputBuffer, int inputOffset)
{
this.count += 64UL;
for (int i = 0; i < 16; i++)
{
this.buff[i] = (uint)((int)inputBuffer[inputOffset + 4 * i] | ((int)inputBuffer[inputOffset + 4 * i + 1] << 8) | ((int)inputBuffer[inputOffset + 4 * i + 2] << 16) | ((int)inputBuffer[inputOffset + 4 * i + 3] << 24));
}
uint num = this._H[0];
uint num2 = this._H[1];
uint num3 = this._H[2];
uint num4 = this._H[3];
num += (((num3 ^ num4) & num2) ^ num4) + MD5CryptoServiceProvider.K[0] + this.buff[0];
num = (num << 7) | (num >> 25);
num += num2;
num4 += (((num2 ^ num3) & num) ^ num3) + MD5CryptoServiceProvider.K[1] + this.buff[1];
num4 = (num4 << 12) | (num4 >> 20);
num4 += num;
num3 += (((num ^ num2) & num4) ^ num2) + MD5CryptoServiceProvider.K[2] + this.buff[2];
num3 = (num3 << 17) | (num3 >> 15);
num3 += num4;
num2 += (((num4 ^ num) & num3) ^ num) + MD5CryptoServiceProvider.K[3] + this.buff[3];
num2 = (num2 << 22) | (num2 >> 10);
num2 += num3;
num += (((num3 ^ num4) & num2) ^ num4) + MD5CryptoServiceProvider.K[4] + this.buff[4];
num = (num << 7) | (num >> 25);
num += num2;
num4 += (((num2 ^ num3) & num) ^ num3) + MD5CryptoServiceProvider.K[5] + this.buff[5];
num4 = (num4 << 12) | (num4 >> 20);
num4 += num;
num3 += (((num ^ num2) & num4) ^ num2) + MD5CryptoServiceProvider.K[6] + this.buff[6];
num3 = (num3 << 17) | (num3 >> 15);
num3 += num4;
num2 += (((num4 ^ num) & num3) ^ num) + MD5CryptoServiceProvider.K[7] + this.buff[7];
num2 = (num2 << 22) | (num2 >> 10);
num2 += num3;
num += (((num3 ^ num4) & num2) ^ num4) + MD5CryptoServiceProvider.K[8] + this.buff[8];
num = (num << 7) | (num >> 25);
num += num2;
num4 += (((num2 ^ num3) & num) ^ num3) + MD5CryptoServiceProvider.K[9] + this.buff[9];
num4 = (num4 << 12) | (num4 >> 20);
num4 += num;
num3 += (((num ^ num2) & num4) ^ num2) + MD5CryptoServiceProvider.K[10] + this.buff[10];
num3 = (num3 << 17) | (num3 >> 15);
num3 += num4;
num2 += (((num4 ^ num) & num3) ^ num) + MD5CryptoServiceProvider.K[11] + this.buff[11];
num2 = (num2 << 22) | (num2 >> 10);
num2 += num3;
num += (((num3 ^ num4) & num2) ^ num4) + MD5CryptoServiceProvider.K[12] + this.buff[12];
num = (num << 7) | (num >> 25);
num += num2;
num4 += (((num2 ^ num3) & num) ^ num3) + MD5CryptoServiceProvider.K[13] + this.buff[13];
num4 = (num4 << 12) | (num4 >> 20);
num4 += num;
num3 += (((num ^ num2) & num4) ^ num2) + MD5CryptoServiceProvider.K[14] + this.buff[14];
num3 = (num3 << 17) | (num3 >> 15);
num3 += num4;
num2 += (((num4 ^ num) & num3) ^ num) + MD5CryptoServiceProvider.K[15] + this.buff[15];
num2 = (num2 << 22) | (num2 >> 10);
num2 += num3;
num += (((num2 ^ num3) & num4) ^ num3) + MD5CryptoServiceProvider.K[16] + this.buff[1];
num = (num << 5) | (num >> 27);
num += num2;
num4 += (((num ^ num2) & num3) ^ num2) + MD5CryptoServiceProvider.K[17] + this.buff[6];
num4 = (num4 << 9) | (num4 >> 23);
num4 += num;
num3 += (((num4 ^ num) & num2) ^ num) + MD5CryptoServiceProvider.K[18] + this.buff[11];
num3 = (num3 << 14) | (num3 >> 18);
num3 += num4;
num2 += (((num3 ^ num4) & num) ^ num4) + MD5CryptoServiceProvider.K[19] + this.buff[0];
num2 = (num2 << 20) | (num2 >> 12);
num2 += num3;
num += (((num2 ^ num3) & num4) ^ num3) + MD5CryptoServiceProvider.K[20] + this.buff[5];
num = (num << 5) | (num >> 27);
num += num2;
num4 += (((num ^ num2) & num3) ^ num2) + MD5CryptoServiceProvider.K[21] + this.buff[10];
num4 = (num4 << 9) | (num4 >> 23);
num4 += num;
num3 += (((num4 ^ num) & num2) ^ num) + MD5CryptoServiceProvider.K[22] + this.buff[15];
num3 = (num3 << 14) | (num3 >> 18);
num3 += num4;
num2 += (((num3 ^ num4) & num) ^ num4) + MD5CryptoServiceProvider.K[23] + this.buff[4];
num2 = (num2 << 20) | (num2 >> 12);
num2 += num3;
num += (((num2 ^ num3) & num4) ^ num3) + MD5CryptoServiceProvider.K[24] + this.buff[9];
num = (num << 5) | (num >> 27);
num += num2;
num4 += (((num ^ num2) & num3) ^ num2) + MD5CryptoServiceProvider.K[25] + this.buff[14];
num4 = (num4 << 9) | (num4 >> 23);
num4 += num;
num3 += (((num4 ^ num) & num2) ^ num) + MD5CryptoServiceProvider.K[26] + this.buff[3];
num3 = (num3 << 14) | (num3 >> 18);
num3 += num4;
num2 += (((num3 ^ num4) & num) ^ num4) + MD5CryptoServiceProvider.K[27] + this.buff[8];
num2 = (num2 << 20) | (num2 >> 12);
num2 += num3;
num += (((num2 ^ num3) & num4) ^ num3) + MD5CryptoServiceProvider.K[28] + this.buff[13];
num = (num << 5) | (num >> 27);
num += num2;
num4 += (((num ^ num2) & num3) ^ num2) + MD5CryptoServiceProvider.K[29] + this.buff[2];
num4 = (num4 << 9) | (num4 >> 23);
num4 += num;
num3 += (((num4 ^ num) & num2) ^ num) + MD5CryptoServiceProvider.K[30] + this.buff[7];
num3 = (num3 << 14) | (num3 >> 18);
num3 += num4;
num2 += (((num3 ^ num4) & num) ^ num4) + MD5CryptoServiceProvider.K[31] + this.buff[12];
num2 = (num2 << 20) | (num2 >> 12);
num2 += num3;
num += (num2 ^ num3 ^ num4) + MD5CryptoServiceProvider.K[32] + this.buff[5];
num = (num << 4) | (num >> 28);
num += num2;
num4 += (num ^ num2 ^ num3) + MD5CryptoServiceProvider.K[33] + this.buff[8];
num4 = (num4 << 11) | (num4 >> 21);
num4 += num;
num3 += (num4 ^ num ^ num2) + MD5CryptoServiceProvider.K[34] + this.buff[11];
num3 = (num3 << 16) | (num3 >> 16);
num3 += num4;
num2 += (num3 ^ num4 ^ num) + MD5CryptoServiceProvider.K[35] + this.buff[14];
num2 = (num2 << 23) | (num2 >> 9);
num2 += num3;
num += (num2 ^ num3 ^ num4) + MD5CryptoServiceProvider.K[36] + this.buff[1];
num = (num << 4) | (num >> 28);
num += num2;
num4 += (num ^ num2 ^ num3) + MD5CryptoServiceProvider.K[37] + this.buff[4];
num4 = (num4 << 11) | (num4 >> 21);
num4 += num;
num3 += (num4 ^ num ^ num2) + MD5CryptoServiceProvider.K[38] + this.buff[7];
num3 = (num3 << 16) | (num3 >> 16);
num3 += num4;
num2 += (num3 ^ num4 ^ num) + MD5CryptoServiceProvider.K[39] + this.buff[10];
num2 = (num2 << 23) | (num2 >> 9);
num2 += num3;
num += (num2 ^ num3 ^ num4) + MD5CryptoServiceProvider.K[40] + this.buff[13];
num = (num << 4) | (num >> 28);
num += num2;
num4 += (num ^ num2 ^ num3) + MD5CryptoServiceProvider.K[41] + this.buff[0];
num4 = (num4 << 11) | (num4 >> 21);
num4 += num;
num3 += (num4 ^ num ^ num2) + MD5CryptoServiceProvider.K[42] + this.buff[3];
num3 = (num3 << 16) | (num3 >> 16);
num3 += num4;
num2 += (num3 ^ num4 ^ num) + MD5CryptoServiceProvider.K[43] + this.buff[6];
num2 = (num2 << 23) | (num2 >> 9);
num2 += num3;
num += (num2 ^ num3 ^ num4) + MD5CryptoServiceProvider.K[44] + this.buff[9];
num = (num << 4) | (num >> 28);
num += num2;
num4 += (num ^ num2 ^ num3) + MD5CryptoServiceProvider.K[45] + this.buff[12];
num4 = (num4 << 11) | (num4 >> 21);
num4 += num;
num3 += (num4 ^ num ^ num2) + MD5CryptoServiceProvider.K[46] + this.buff[15];
num3 = (num3 << 16) | (num3 >> 16);
num3 += num4;
num2 += (num3 ^ num4 ^ num) + MD5CryptoServiceProvider.K[47] + this.buff[2];
num2 = (num2 << 23) | (num2 >> 9);
num2 += num3;
num += ((~num4 | num2) ^ num3) + MD5CryptoServiceProvider.K[48] + this.buff[0];
num = (num << 6) | (num >> 26);
num += num2;
num4 += ((~num3 | num) ^ num2) + MD5CryptoServiceProvider.K[49] + this.buff[7];
num4 = (num4 << 10) | (num4 >> 22);
num4 += num;
num3 += ((~num2 | num4) ^ num) + MD5CryptoServiceProvider.K[50] + this.buff[14];
num3 = (num3 << 15) | (num3 >> 17);
num3 += num4;
num2 += ((~num | num3) ^ num4) + MD5CryptoServiceProvider.K[51] + this.buff[5];
num2 = (num2 << 21) | (num2 >> 11);
num2 += num3;
num += ((~num4 | num2) ^ num3) + MD5CryptoServiceProvider.K[52] + this.buff[12];
num = (num << 6) | (num >> 26);
num += num2;
num4 += ((~num3 | num) ^ num2) + MD5CryptoServiceProvider.K[53] + this.buff[3];
num4 = (num4 << 10) | (num4 >> 22);
num4 += num;
num3 += ((~num2 | num4) ^ num) + MD5CryptoServiceProvider.K[54] + this.buff[10];
num3 = (num3 << 15) | (num3 >> 17);
num3 += num4;
num2 += ((~num | num3) ^ num4) + MD5CryptoServiceProvider.K[55] + this.buff[1];
num2 = (num2 << 21) | (num2 >> 11);
num2 += num3;
num += ((~num4 | num2) ^ num3) + MD5CryptoServiceProvider.K[56] + this.buff[8];
num = (num << 6) | (num >> 26);
num += num2;
num4 += ((~num3 | num) ^ num2) + MD5CryptoServiceProvider.K[57] + this.buff[15];
num4 = (num4 << 10) | (num4 >> 22);
num4 += num;
num3 += ((~num2 | num4) ^ num) + MD5CryptoServiceProvider.K[58] + this.buff[6];
num3 = (num3 << 15) | (num3 >> 17);
num3 += num4;
num2 += ((~num | num3) ^ num4) + MD5CryptoServiceProvider.K[59] + this.buff[13];
num2 = (num2 << 21) | (num2 >> 11);
num2 += num3;
num += ((~num4 | num2) ^ num3) + MD5CryptoServiceProvider.K[60] + this.buff[4];
num = (num << 6) | (num >> 26);
num += num2;
num4 += ((~num3 | num) ^ num2) + MD5CryptoServiceProvider.K[61] + this.buff[11];
num4 = (num4 << 10) | (num4 >> 22);
num4 += num;
num3 += ((~num2 | num4) ^ num) + MD5CryptoServiceProvider.K[62] + this.buff[2];
num3 = (num3 << 15) | (num3 >> 17);
num3 += num4;
num2 += ((~num | num3) ^ num4) + MD5CryptoServiceProvider.K[63] + this.buff[9];
num2 = (num2 << 21) | (num2 >> 11);
num2 += num3;
this._H[0] += num;
this._H[1] += num2;
this._H[2] += num3;
this._H[3] += num4;
}
// Token: 0x06002FB0 RID: 12208 RVA: 0x0009A24C File Offset: 0x0009844C
private void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
ulong num = this.count + (ulong)((long)inputCount);
int num2 = (int)(56UL - num % 64UL);
if (num2 < 1)
{
num2 += 64;
}
byte[] array = new byte[inputCount + num2 + 8];
for (int i = 0; i < inputCount; i++)
{
array[i] = inputBuffer[i + inputOffset];
}
array[inputCount] = 128;
for (int j = inputCount + 1; j < inputCount + num2; j++)
{
array[j] = 0;
}
ulong num3 = num << 3;
this.AddLength(num3, array, inputCount + num2);
this.ProcessBlock(array, 0);
if (inputCount + num2 + 8 == 128)
{
this.ProcessBlock(array, 64);
}
}
// Token: 0x06002FB1 RID: 12209 RVA: 0x0009A2F8 File Offset: 0x000984F8
internal void AddLength(ulong length, byte[] buffer, int position)
{
buffer[position++] = (byte)length;
buffer[position++] = (byte)(length >> 8);
buffer[position++] = (byte)(length >> 16);
buffer[position++] = (byte)(length >> 24);
buffer[position++] = (byte)(length >> 32);
buffer[position++] = (byte)(length >> 40);
buffer[position++] = (byte)(length >> 48);
buffer[position] = (byte)(length >> 56);
}
// Token: 0x04001368 RID: 4968
private const int BLOCK_SIZE_BYTES = 64;
// Token: 0x04001369 RID: 4969
private const int HASH_SIZE_BYTES = 16;
// Token: 0x0400136A RID: 4970
private uint[] _H;
// Token: 0x0400136B RID: 4971
private uint[] buff;
// Token: 0x0400136C RID: 4972
private ulong count;
// Token: 0x0400136D RID: 4973
private byte[] _ProcessingBuffer;
// Token: 0x0400136E RID: 4974
private int _ProcessingBufferCount;
// Token: 0x0400136F RID: 4975
private static readonly uint[] K = new uint[]
{
3614090360U, 3905402710U, 606105819U, 3250441966U, 4118548399U, 1200080426U, 2821735955U, 4249261313U, 1770035416U, 2336552879U,
4294925233U, 2304563134U, 1804603682U, 4254626195U, 2792965006U, 1236535329U, 4129170786U, 3225465664U, 643717713U, 3921069994U,
3593408605U, 38016083U, 3634488961U, 3889429448U, 568446438U, 3275163606U, 4107603335U, 1163531501U, 2850285829U, 4243563512U,
1735328473U, 2368359562U, 4294588738U, 2272392833U, 1839030562U, 4259657740U, 2763975236U, 1272893353U, 4139469664U, 3200236656U,
681279174U, 3936430074U, 3572445317U, 76029189U, 3654602809U, 3873151461U, 530742520U, 3299628645U, 4096336452U, 1126891415U,
2878612391U, 4237533241U, 1700485571U, 2399980690U, 4293915773U, 2240044497U, 1873313359U, 4264355552U, 2734768916U, 1309151649U,
4149444226U, 3174756917U, 718787259U, 3951481745U
};
}
}
@@ -0,0 +1,19 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract class from which all mask generator algorithms must derive.</summary>
// Token: 0x02000511 RID: 1297
[ComVisible(true)]
public abstract class MaskGenerationMethod
{
/// <summary>When overridden in a derived class, generates a mask with the specified length using the specified random seed.</summary>
/// <returns>A randomly generated mask whose length is equal to the <paramref name="cbReturn" /> parameter.</returns>
/// <param name="rgbSeed">The random seed to use to compute the mask. </param>
/// <param name="cbReturn">The length of the generated mask in bytes. </param>
// Token: 0x06002FB3 RID: 12211
[ComVisible(true)]
public abstract byte[] GenerateMask(byte[] rgbSeed, int cbReturn);
}
}
@@ -0,0 +1,50 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes masks according to PKCS #1 for use by key exchange algorithms.</summary>
// Token: 0x02000512 RID: 1298
[ComVisible(true)]
public class PKCS1MaskGenerationMethod : MaskGenerationMethod
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PKCS1MaskGenerationMethod" /> class.</summary>
// Token: 0x06002FB4 RID: 12212 RVA: 0x0009A36C File Offset: 0x0009856C
public PKCS1MaskGenerationMethod()
{
this.hashName = "SHA1";
}
/// <summary>Gets or sets the name of the hash algorithm type to use for generating the mask.</summary>
/// <returns>The name of the type that implements the hash algorithm to use for computing the mask.</returns>
// Token: 0x1700096D RID: 2413
// (get) Token: 0x06002FB5 RID: 12213 RVA: 0x0009A380 File Offset: 0x00098580
// (set) Token: 0x06002FB6 RID: 12214 RVA: 0x0009A388 File Offset: 0x00098588
public string HashName
{
get
{
return this.hashName;
}
set
{
this.hashName = ((value != null) ? value : "SHA1");
}
}
/// <summary>Generates and returns a mask from the specified random seed of the specified length.</summary>
/// <returns>A randomly generated mask whose length is equal to the <paramref name="cbReturn" /> parameter.</returns>
/// <param name="rgbSeed">The random seed to use for computing the mask. </param>
/// <param name="cbReturn">The length of the generated mask in bytes. </param>
// Token: 0x06002FB7 RID: 12215 RVA: 0x0009A3A4 File Offset: 0x000985A4
public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn)
{
HashAlgorithm hashAlgorithm = HashAlgorithm.Create(this.hashName);
return PKCS1.MGF1(hashAlgorithm, rgbSeed, cbReturn);
}
// Token: 0x04001370 RID: 4976
private string hashName;
}
}
@@ -0,0 +1,28 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Specifies the type of padding to apply when the message data block is shorter than the full number of bytes needed for a cryptographic operation.</summary>
// Token: 0x02000513 RID: 1299
[ComVisible(true)]
[Serializable]
public enum PaddingMode
{
/// <summary>No padding is done.</summary>
// Token: 0x04001372 RID: 4978
None = 1,
/// <summary>The PKCS #7 padding string consists of a sequence of bytes, each of which is equal to the total number of padding bytes added. </summary>
// Token: 0x04001373 RID: 4979
PKCS7,
/// <summary>The padding string consists of bytes set to zero.</summary>
// Token: 0x04001374 RID: 4980
Zeros,
/// <summary>The ANSIX923 padding string consists of a sequence of bytes filled with zeros before the length.</summary>
// Token: 0x04001375 RID: 4981
ANSIX923,
/// <summary>The ISO10126 padding string consists of random data before the length.</summary>
// Token: 0x04001376 RID: 4982
ISO10126
}
}
@@ -0,0 +1,368 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace System.Security.Cryptography
{
/// <summary>Derives a key from a password using an extension of the PBKDF1 algorithm.</summary>
// Token: 0x02000514 RID: 1300
[ComVisible(true)]
public class PasswordDeriveBytes : DeriveBytes
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> class with the password and key salt to use to derive the key.</summary>
/// <param name="strPassword">The password for which to derive the key. </param>
/// <param name="rgbSalt">The key salt to use to derive the key. </param>
// Token: 0x06002FB8 RID: 12216 RVA: 0x0009A3C8 File Offset: 0x000985C8
public PasswordDeriveBytes(string strPassword, byte[] rgbSalt)
{
this.Prepare(strPassword, rgbSalt, "SHA1", 100);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> class with the password, key salt, and cryptographic service provider (CSP) parameters to use to derive the key.</summary>
/// <param name="strPassword">The password for which to derive the key. </param>
/// <param name="rgbSalt">The key salt to use to derive the key. </param>
/// <param name="cspParams">The CSP parameters for the operation. </param>
// Token: 0x06002FB9 RID: 12217 RVA: 0x0009A3E0 File Offset: 0x000985E0
public PasswordDeriveBytes(string strPassword, byte[] rgbSalt, CspParameters cspParams)
{
this.Prepare(strPassword, rgbSalt, "SHA1", 100);
if (cspParams != null)
{
throw new NotSupportedException(Locale.GetText("CspParameters not supported by Mono for PasswordDeriveBytes."));
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> class with the password, key salt, hash name, and number of iterations to use to derive the key.</summary>
/// <param name="strPassword">The password for which to derive the key. </param>
/// <param name="rgbSalt">The key salt to use to derive the key. </param>
/// <param name="strHashName">The name of the hash algorithm for the operation. </param>
/// <param name="iterations">The number of iterations for the operation. </param>
// Token: 0x06002FBA RID: 12218 RVA: 0x0009A410 File Offset: 0x00098610
public PasswordDeriveBytes(string strPassword, byte[] rgbSalt, string strHashName, int iterations)
{
this.Prepare(strPassword, rgbSalt, strHashName, iterations);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> class with the password, key salt, hash name, number of iterations, and cryptographic service provider (CSP) parameters to use to derive the key.</summary>
/// <param name="strPassword">The password for which to derive the key. </param>
/// <param name="rgbSalt">The key salt to use to derive the key. </param>
/// <param name="strHashName">The name of the hash algorithm for the operation. </param>
/// <param name="iterations">The number of iterations for the operation. </param>
/// <param name="cspParams">The CSP parameters for the operation. </param>
// Token: 0x06002FBB RID: 12219 RVA: 0x0009A424 File Offset: 0x00098624
public PasswordDeriveBytes(string strPassword, byte[] rgbSalt, string strHashName, int iterations, CspParameters cspParams)
{
this.Prepare(strPassword, rgbSalt, strHashName, iterations);
if (cspParams != null)
{
throw new NotSupportedException(Locale.GetText("CspParameters not supported by Mono for PasswordDeriveBytes."));
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> class specifying the password and key salt to use to derive the key.</summary>
/// <param name="password">The password to derive the key for.</param>
/// <param name="salt">The key salt to use to derive the key.</param>
// Token: 0x06002FBC RID: 12220 RVA: 0x0009A45C File Offset: 0x0009865C
public PasswordDeriveBytes(byte[] password, byte[] salt)
{
this.Prepare(password, salt, "SHA1", 100);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> class specifying the password, key salt, and cryptographic service provider (CSP) to use to derive the key.</summary>
/// <param name="password">The password to derive the key for.</param>
/// <param name="salt">The key salt to use to derive the key.</param>
/// <param name="cspParams">The cryptographic service provider (CSP) parameters for the operation.</param>
// Token: 0x06002FBD RID: 12221 RVA: 0x0009A474 File Offset: 0x00098674
public PasswordDeriveBytes(byte[] password, byte[] salt, CspParameters cspParams)
{
this.Prepare(password, salt, "SHA1", 100);
if (cspParams != null)
{
throw new NotSupportedException(Locale.GetText("CspParameters not supported by Mono for PasswordDeriveBytes."));
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> class specifying the password, key salt, hash name, and iterations to use to derive the key.</summary>
/// <param name="password">The password to derive the key for.</param>
/// <param name="salt">The key salt to use to derive the key.</param>
/// <param name="hashName">The hash algorithm to use to derive the key.</param>
/// <param name="iterations">The iteration count to use to derive the key.</param>
// Token: 0x06002FBE RID: 12222 RVA: 0x0009A4A4 File Offset: 0x000986A4
public PasswordDeriveBytes(byte[] password, byte[] salt, string hashName, int iterations)
{
this.Prepare(password, salt, hashName, iterations);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> class specifying the password, key salt, hash name, iterations, and cryptographic service provider (CSP) to use to derive the key.</summary>
/// <param name="password">The password to derive the key for.</param>
/// <param name="salt">The key salt to use to derive the key.</param>
/// <param name="hashName">The hash algorithm to use to derive the key.</param>
/// <param name="iterations">The iteration count to use to derive the key.</param>
/// <param name="cspParams">The cryptographic service provider (CSP) parameters for the operation.</param>
// Token: 0x06002FBF RID: 12223 RVA: 0x0009A4B8 File Offset: 0x000986B8
public PasswordDeriveBytes(byte[] password, byte[] salt, string hashName, int iterations, CspParameters cspParams)
{
this.Prepare(password, salt, hashName, iterations);
if (cspParams != null)
{
throw new NotSupportedException(Locale.GetText("CspParameters not supported by Mono for PasswordDeriveBytes."));
}
}
// Token: 0x06002FC0 RID: 12224 RVA: 0x0009A4F0 File Offset: 0x000986F0
~PasswordDeriveBytes()
{
if (this.initial != null)
{
Array.Clear(this.initial, 0, this.initial.Length);
this.initial = null;
}
Array.Clear(this.password, 0, this.password.Length);
}
// Token: 0x06002FC1 RID: 12225 RVA: 0x0009A560 File Offset: 0x00098760
private void Prepare(string strPassword, byte[] rgbSalt, string strHashName, int iterations)
{
if (strPassword == null)
{
throw new ArgumentNullException("strPassword");
}
byte[] bytes = Encoding.UTF8.GetBytes(strPassword);
this.Prepare(bytes, rgbSalt, strHashName, iterations);
Array.Clear(bytes, 0, bytes.Length);
}
// Token: 0x06002FC2 RID: 12226 RVA: 0x0009A5A0 File Offset: 0x000987A0
private void Prepare(byte[] password, byte[] rgbSalt, string strHashName, int iterations)
{
if (password == null)
{
throw new ArgumentNullException("password");
}
this.password = (byte[])password.Clone();
this.Salt = rgbSalt;
this.HashName = strHashName;
this.IterationCount = iterations;
this.state = 0;
}
/// <summary>Gets or sets the name of the hash algorithm for the operation.</summary>
/// <returns>The name of the hash algorithm for the operation.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The name of the hash value is fixed and an attempt is made to change this value. </exception>
// Token: 0x1700096E RID: 2414
// (get) Token: 0x06002FC3 RID: 12227 RVA: 0x0009A5EC File Offset: 0x000987EC
// (set) Token: 0x06002FC4 RID: 12228 RVA: 0x0009A5F4 File Offset: 0x000987F4
public string HashName
{
get
{
return this.HashNameValue;
}
set
{
if (value == null)
{
throw new ArgumentNullException("HashName");
}
if (this.state != 0)
{
throw new CryptographicException(Locale.GetText("Can't change this property at this stage"));
}
this.HashNameValue = value;
}
}
/// <summary>Gets or sets the number of iterations for the operation.</summary>
/// <returns>The number of iterations for the operation.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The number of iterations is fixed and an attempt is made to change this value. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property cannot be set because its value is out of range. This property requires a non-negative number.</exception>
// Token: 0x1700096F RID: 2415
// (get) Token: 0x06002FC5 RID: 12229 RVA: 0x0009A62C File Offset: 0x0009882C
// (set) Token: 0x06002FC6 RID: 12230 RVA: 0x0009A634 File Offset: 0x00098834
public int IterationCount
{
get
{
return this.IterationsValue;
}
set
{
if (value < 1)
{
throw new ArgumentOutOfRangeException("> 0", "IterationCount");
}
if (this.state != 0)
{
throw new CryptographicException(Locale.GetText("Can't change this property at this stage"));
}
this.IterationsValue = value;
}
}
/// <summary>Gets or sets the key salt value for the operation.</summary>
/// <returns>The key salt value for the operation.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key salt value is fixed and an attempt is made to change this value. </exception>
// Token: 0x17000970 RID: 2416
// (get) Token: 0x06002FC7 RID: 12231 RVA: 0x0009A670 File Offset: 0x00098870
// (set) Token: 0x06002FC8 RID: 12232 RVA: 0x0009A690 File Offset: 0x00098890
public byte[] Salt
{
get
{
if (this.SaltValue == null)
{
return null;
}
return (byte[])this.SaltValue.Clone();
}
set
{
if (this.state != 0)
{
throw new CryptographicException(Locale.GetText("Can't change this property at this stage"));
}
if (value != null)
{
this.SaltValue = (byte[])value.Clone();
}
else
{
this.SaltValue = null;
}
}
}
/// <summary>Derives a cryptographic key from the <see cref="T:System.Security.Cryptography.PasswordDeriveBytes" /> object.</summary>
/// <returns>The derived key.</returns>
/// <param name="algname">The algorithm name for which to derive the key. </param>
/// <param name="alghashname">The hash algorithm name to use to derive the key. </param>
/// <param name="keySize">The size of the key, in bits, to derive. </param>
/// <param name="rgbIV">The initialization vector (IV) to use to derive the key. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="keySize" /> parameter is incorrect.-or- The cryptographic service provider (CSP) cannot be acquired.-or- The <paramref name="algname" /> parameter is not a valid algorithm name.-or- The <paramref name="alghashname" /> parameter is not a valid hash algorithm name. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002FC9 RID: 12233 RVA: 0x0009A6DC File Offset: 0x000988DC
public byte[] CryptDeriveKey(string algname, string alghashname, int keySize, byte[] rgbIV)
{
if (keySize > 128)
{
throw new CryptographicException(Locale.GetText("Key Size can't be greater than 128 bits"));
}
throw new NotSupportedException(Locale.GetText("CspParameters not supported by Mono"));
}
/// <summary>Returns pseudo-random key bytes.</summary>
/// <returns>A byte array filled with pseudo-random key bytes.</returns>
/// <param name="cb">The number of pseudo-random key bytes to generate. </param>
// Token: 0x06002FCA RID: 12234 RVA: 0x0009A714 File Offset: 0x00098914
[Obsolete("see Rfc2898DeriveBytes for PKCS#5 v2 support")]
public override byte[] GetBytes(int cb)
{
if (cb < 1)
{
throw new IndexOutOfRangeException("cb");
}
if (this.state == 0)
{
this.Reset();
this.state = 1;
}
byte[] array = new byte[cb];
int i = 0;
int num = Math.Max(1, this.IterationsValue - 1);
if (this.output == null)
{
this.output = this.initial;
for (int j = 0; j < num - 1; j++)
{
this.output = this.hash.ComputeHash(this.output);
}
}
while (i < cb)
{
byte[] array2;
if (this.hashnumber == 0)
{
array2 = this.hash.ComputeHash(this.output);
}
else
{
if (this.hashnumber >= 1000)
{
throw new CryptographicException(Locale.GetText("too long"));
}
string text = Convert.ToString(this.hashnumber);
array2 = new byte[this.output.Length + text.Length];
for (int k = 0; k < text.Length; k++)
{
array2[k] = (byte)text[k];
}
Buffer.BlockCopy(this.output, 0, array2, text.Length, this.output.Length);
array2 = this.hash.ComputeHash(array2);
}
int num2 = array2.Length - this.position;
int num3 = Math.Min(cb - i, num2);
Buffer.BlockCopy(array2, this.position, array, i, num3);
i += num3;
this.position += num3;
while (this.position >= array2.Length)
{
this.position -= array2.Length;
this.hashnumber++;
}
}
return array;
}
/// <summary>Resets the state of the operation.</summary>
// Token: 0x06002FCB RID: 12235 RVA: 0x0009A8EC File Offset: 0x00098AEC
public override void Reset()
{
this.state = 0;
this.position = 0;
this.hashnumber = 0;
this.hash = HashAlgorithm.Create(this.HashNameValue);
if (this.SaltValue != null)
{
this.hash.TransformBlock(this.password, 0, this.password.Length, this.password, 0);
this.hash.TransformFinalBlock(this.SaltValue, 0, this.SaltValue.Length);
this.initial = this.hash.Hash;
}
else
{
this.initial = this.hash.ComputeHash(this.password);
}
}
// Token: 0x04001377 RID: 4983
private string HashNameValue;
// Token: 0x04001378 RID: 4984
private byte[] SaltValue;
// Token: 0x04001379 RID: 4985
private int IterationsValue;
// Token: 0x0400137A RID: 4986
private HashAlgorithm hash;
// Token: 0x0400137B RID: 4987
private int state;
// Token: 0x0400137C RID: 4988
private byte[] password;
// Token: 0x0400137D RID: 4989
private byte[] initial;
// Token: 0x0400137E RID: 4990
private byte[] output;
// Token: 0x0400137F RID: 4991
private int position;
// Token: 0x04001380 RID: 4992
private int hashnumber;
}
}
@@ -0,0 +1,91 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class from which all implementations of the <see cref="T:System.Security.Cryptography.RC2" /> algorithm must derive.</summary>
// Token: 0x02000515 RID: 1301
[ComVisible(true)]
public abstract class RC2 : SymmetricAlgorithm
{
/// <summary>Initializes a new instance of <see cref="T:System.Security.Cryptography.RC2" />.</summary>
// Token: 0x06002FCC RID: 12236 RVA: 0x0009A994 File Offset: 0x00098B94
protected RC2()
{
this.KeySizeValue = 128;
this.BlockSizeValue = 64;
this.FeedbackSizeValue = 8;
this.LegalKeySizesValue = new KeySizes[1];
this.LegalKeySizesValue[0] = new KeySizes(40, 128, 8);
this.LegalBlockSizesValue = new KeySizes[1];
this.LegalBlockSizesValue[0] = new KeySizes(64, 64, 0);
}
/// <summary>Creates an instance of a cryptographic object to perform the <see cref="T:System.Security.Cryptography.RC2" /> algorithm.</summary>
/// <returns>An instance of a cryptographic object.</returns>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002FCD RID: 12237 RVA: 0x0009AA00 File Offset: 0x00098C00
public new static RC2 Create()
{
return RC2.Create("System.Security.Cryptography.RC2");
}
/// <summary>Creates an instance of a cryptographic object to perform the specified implementation of the <see cref="T:System.Security.Cryptography.RC2" /> algorithm.</summary>
/// <returns>An instance of a cryptographic object.</returns>
/// <param name="AlgName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.RC2" /> to use. </param>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="algName" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
// Token: 0x06002FCE RID: 12238 RVA: 0x0009AA0C File Offset: 0x00098C0C
public new static RC2 Create(string AlgName)
{
return (RC2)CryptoConfig.CreateFromName(AlgName);
}
/// <summary>Gets or sets the effective size of the secret key used by the <see cref="T:System.Security.Cryptography.RC2" /> algorithm in bits.</summary>
/// <returns>The effective key size used by the <see cref="T:System.Security.Cryptography.RC2" /> algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The effective key size is invalid. </exception>
// Token: 0x17000971 RID: 2417
// (get) Token: 0x06002FCF RID: 12239 RVA: 0x0009AA1C File Offset: 0x00098C1C
// (set) Token: 0x06002FD0 RID: 12240 RVA: 0x0009AA38 File Offset: 0x00098C38
public virtual int EffectiveKeySize
{
get
{
if (this.EffectiveKeySizeValue == 0)
{
return this.KeySizeValue;
}
return this.EffectiveKeySizeValue;
}
set
{
this.EffectiveKeySizeValue = value;
}
}
/// <summary>Gets or sets the size of the secret key used by the <see cref="T:System.Security.Cryptography.RC2" /> algorithm in bits.</summary>
/// <returns>The size of the secret key used by the <see cref="T:System.Security.Cryptography.RC2" /> algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The value for the RC2 key size is less than the effective key size value.</exception>
// Token: 0x17000972 RID: 2418
// (get) Token: 0x06002FD1 RID: 12241 RVA: 0x0009AA44 File Offset: 0x00098C44
// (set) Token: 0x06002FD2 RID: 12242 RVA: 0x0009AA4C File Offset: 0x00098C4C
public override int KeySize
{
get
{
return base.KeySize;
}
set
{
base.KeySize = value;
this.EffectiveKeySizeValue = value;
}
}
/// <summary>Represents the effective size of the secret key used by the <see cref="T:System.Security.Cryptography.RC2" /> algorithm in bits.</summary>
// Token: 0x04001381 RID: 4993
protected int EffectiveKeySizeValue;
}
}
@@ -0,0 +1,98 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the <see cref="T:System.Security.Cryptography.RC2" /> algorithm. This class cannot be inherited.</summary>
// Token: 0x02000516 RID: 1302
[ComVisible(true)]
public sealed class RC2CryptoServiceProvider : RC2
{
/// <summary>Gets or sets the effective size, in bits, of the secret key used by the <see cref="T:System.Security.Cryptography.RC2" /> algorithm.</summary>
/// <returns>The effective key size, in bits, used by the <see cref="T:System.Security.Cryptography.RC2" /> algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The <see cref="P:System.Security.Cryptography.RC2CryptoServiceProvider.EffectiveKeySize" /> property was set to a value other than the <see cref="F:System.Security.Cryptography.SymmetricAlgorithm.KeySizeValue" /> property. </exception>
// Token: 0x17000973 RID: 2419
// (get) Token: 0x06002FD4 RID: 12244 RVA: 0x0009AA64 File Offset: 0x00098C64
// (set) Token: 0x06002FD5 RID: 12245 RVA: 0x0009AA6C File Offset: 0x00098C6C
public override int EffectiveKeySize
{
get
{
return base.EffectiveKeySize;
}
set
{
if (value != this.KeySizeValue)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("Effective key size must match key size for compatibility"));
}
base.EffectiveKeySize = value;
}
}
/// <summary>Creates a symmetric <see cref="T:System.Security.Cryptography.RC2" /> decryptor object with the specified key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />)and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric <see cref="T:System.Security.Cryptography.RC2" /> decryptor object.</returns>
/// <param name="rgbKey">The secret key to use for the symmetric algorithm. </param>
/// <param name="rgbIV">The initialization vector to use for the symmetric algorithm. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An <see cref="F:System.Security.Cryptography.CipherMode.OFB" /> cipher mode was used.-or-A <see cref="F:System.Security.Cryptography.CipherMode.CFB" /> cipher mode with a feedback size other than 8 bits was used.-or-An invalid key size was used.-or-The algorithm key size was not available.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002FD6 RID: 12246 RVA: 0x0009AA94 File Offset: 0x00098C94
public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
{
return new RC2Transform(this, false, rgbKey, rgbIV);
}
/// <summary>Creates a symmetric <see cref="T:System.Security.Cryptography.RC2" /> encryptor object with the specified key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />) and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric <see cref="T:System.Security.Cryptography.RC2" /> encryptor object.</returns>
/// <param name="rgbKey">The secret key to use for the symmetric algorithm. </param>
/// <param name="rgbIV">The initialization vector to use for the symmetric algorithm. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An <see cref="F:System.Security.Cryptography.CipherMode.OFB" /> cipher mode was used.-or-A <see cref="F:System.Security.Cryptography.CipherMode.CFB" /> cipher mode with a feedback size other than 8 bits was used.-or-An invalid key size was used.-or-The algorithm key size was not available.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06002FD7 RID: 12247 RVA: 0x0009AAA0 File Offset: 0x00098CA0
public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
{
return new RC2Transform(this, true, rgbKey, rgbIV);
}
/// <summary>Generates a random initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />) to use for the algorithm.</summary>
// Token: 0x06002FD8 RID: 12248 RVA: 0x0009AAAC File Offset: 0x00098CAC
public override void GenerateIV()
{
this.IVValue = KeyBuilder.IV(this.BlockSizeValue >> 3);
}
/// <summary>Generates a random key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />) to be used for the algorithm.</summary>
// Token: 0x06002FD9 RID: 12249 RVA: 0x0009AAC4 File Offset: 0x00098CC4
public override void GenerateKey()
{
this.KeyValue = KeyBuilder.Key(this.KeySizeValue >> 3);
}
/// <summary>Gets or sets a value that determines whether to create a key with an 11-byte-long, zero-value salt. </summary>
/// <returns>true if the key should be created with an 11-byte-long, zero-value salt; otherwise, false. The default is false.</returns>
// Token: 0x17000974 RID: 2420
// (get) Token: 0x06002FDA RID: 12250 RVA: 0x0009AADC File Offset: 0x00098CDC
// (set) Token: 0x06002FDB RID: 12251 RVA: 0x0009AAE4 File Offset: 0x00098CE4
[ComVisible(false)]
[MonoTODO("Use salt in algorithm")]
public bool UseSalt
{
get
{
return this._useSalt;
}
set
{
this._useSalt = value;
}
}
// Token: 0x04001382 RID: 4994
private bool _useSalt;
}
}
@@ -0,0 +1,209 @@
using System;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
// Token: 0x02000517 RID: 1303
internal class RC2Transform : SymmetricTransform
{
// Token: 0x06002FDC RID: 12252 RVA: 0x0009AAF0 File Offset: 0x00098CF0
public RC2Transform(RC2 rc2Algo, bool encryption, byte[] key, byte[] iv)
: base(rc2Algo, encryption, iv)
{
int num = rc2Algo.EffectiveKeySize;
if (key == null)
{
key = KeyBuilder.Key(rc2Algo.KeySize >> 3);
}
else
{
key = (byte[])key.Clone();
num = Math.Min(num, key.Length << 3);
}
int num2 = key.Length;
if (!KeySizes.IsLegalKeySize(rc2Algo.LegalKeySizes, num2 << 3))
{
string text = Locale.GetText("Key is too small ({0} bytes), it should be between {1} and {2} bytes long.", new object[] { num2, 5, 16 });
throw new CryptographicException(text);
}
byte[] array = new byte[128];
int num3 = num + 7 >> 3;
int num4 = 255 % (2 << 8 + num - (num3 << 3) - 1);
for (int i = 0; i < num2; i++)
{
array[i] = key[i];
}
for (int j = num2; j < 128; j++)
{
array[j] = RC2Transform.pitable[(int)((array[j - 1] + array[j - num2]) & byte.MaxValue)];
}
array[128 - num3] = RC2Transform.pitable[(int)array[128 - num3] & num4];
for (int k = 127 - num3; k >= 0; k--)
{
array[k] = RC2Transform.pitable[(int)(array[k + 1] ^ array[k + num3])];
}
this.K = new ushort[64];
int num5 = 0;
for (int l = 0; l < 64; l++)
{
this.K[l] = (ushort)((int)array[num5++] + ((int)array[num5++] << 8));
}
}
// Token: 0x06002FDE RID: 12254 RVA: 0x0009ACBC File Offset: 0x00098EBC
protected override void ECB(byte[] input, byte[] output)
{
this.R0 = (ushort)((int)input[0] | ((int)input[1] << 8));
this.R1 = (ushort)((int)input[2] | ((int)input[3] << 8));
this.R2 = (ushort)((int)input[4] | ((int)input[5] << 8));
this.R3 = (ushort)((int)input[6] | ((int)input[7] << 8));
if (this.encrypt)
{
this.j = 0;
while (this.j <= 16)
{
this.R0 += this.K[this.j++] + (this.R3 & this.R2) + (~this.R3 & this.R1);
this.R0 = (ushort)(((int)this.R0 << 1) | (this.R0 >> 15));
this.R1 += this.K[this.j++] + (this.R0 & this.R3) + (~this.R0 & this.R2);
this.R1 = (ushort)(((int)this.R1 << 2) | (this.R1 >> 14));
this.R2 += this.K[this.j++] + (this.R1 & this.R0) + (~this.R1 & this.R3);
this.R2 = (ushort)(((int)this.R2 << 3) | (this.R2 >> 13));
this.R3 += this.K[this.j++] + (this.R2 & this.R1) + (~this.R2 & this.R0);
this.R3 = (ushort)(((int)this.R3 << 5) | (this.R3 >> 11));
}
this.R0 += this.K[(int)(this.R3 & 63)];
this.R1 += this.K[(int)(this.R0 & 63)];
this.R2 += this.K[(int)(this.R1 & 63)];
this.R3 += this.K[(int)(this.R2 & 63)];
while (this.j <= 40)
{
this.R0 += this.K[this.j++] + (this.R3 & this.R2) + (~this.R3 & this.R1);
this.R0 = (ushort)(((int)this.R0 << 1) | (this.R0 >> 15));
this.R1 += this.K[this.j++] + (this.R0 & this.R3) + (~this.R0 & this.R2);
this.R1 = (ushort)(((int)this.R1 << 2) | (this.R1 >> 14));
this.R2 += this.K[this.j++] + (this.R1 & this.R0) + (~this.R1 & this.R3);
this.R2 = (ushort)(((int)this.R2 << 3) | (this.R2 >> 13));
this.R3 += this.K[this.j++] + (this.R2 & this.R1) + (~this.R2 & this.R0);
this.R3 = (ushort)(((int)this.R3 << 5) | (this.R3 >> 11));
}
this.R0 += this.K[(int)(this.R3 & 63)];
this.R1 += this.K[(int)(this.R0 & 63)];
this.R2 += this.K[(int)(this.R1 & 63)];
this.R3 += this.K[(int)(this.R2 & 63)];
while (this.j < 64)
{
this.R0 += this.K[this.j++] + (this.R3 & this.R2) + (~this.R3 & this.R1);
this.R0 = (ushort)(((int)this.R0 << 1) | (this.R0 >> 15));
this.R1 += this.K[this.j++] + (this.R0 & this.R3) + (~this.R0 & this.R2);
this.R1 = (ushort)(((int)this.R1 << 2) | (this.R1 >> 14));
this.R2 += this.K[this.j++] + (this.R1 & this.R0) + (~this.R1 & this.R3);
this.R2 = (ushort)(((int)this.R2 << 3) | (this.R2 >> 13));
this.R3 += this.K[this.j++] + (this.R2 & this.R1) + (~this.R2 & this.R0);
this.R3 = (ushort)(((int)this.R3 << 5) | (this.R3 >> 11));
}
}
else
{
this.j = 63;
while (this.j >= 44)
{
this.R3 = (ushort)((this.R3 >> 5) | ((int)this.R3 << 11));
this.R3 -= this.K[this.j--] + (this.R2 & this.R1) + (~this.R2 & this.R0);
this.R2 = (ushort)((this.R2 >> 3) | ((int)this.R2 << 13));
this.R2 -= this.K[this.j--] + (this.R1 & this.R0) + (~this.R1 & this.R3);
this.R1 = (ushort)((this.R1 >> 2) | ((int)this.R1 << 14));
this.R1 -= this.K[this.j--] + (this.R0 & this.R3) + (~this.R0 & this.R2);
this.R0 = (ushort)((this.R0 >> 1) | ((int)this.R0 << 15));
this.R0 -= this.K[this.j--] + (this.R3 & this.R2) + (~this.R3 & this.R1);
}
this.R3 -= this.K[(int)(this.R2 & 63)];
this.R2 -= this.K[(int)(this.R1 & 63)];
this.R1 -= this.K[(int)(this.R0 & 63)];
this.R0 -= this.K[(int)(this.R3 & 63)];
while (this.j >= 20)
{
this.R3 = (ushort)((this.R3 >> 5) | ((int)this.R3 << 11));
this.R3 -= this.K[this.j--] + (this.R2 & this.R1) + (~this.R2 & this.R0);
this.R2 = (ushort)((this.R2 >> 3) | ((int)this.R2 << 13));
this.R2 -= this.K[this.j--] + (this.R1 & this.R0) + (~this.R1 & this.R3);
this.R1 = (ushort)((this.R1 >> 2) | ((int)this.R1 << 14));
this.R1 -= this.K[this.j--] + (this.R0 & this.R3) + (~this.R0 & this.R2);
this.R0 = (ushort)((this.R0 >> 1) | ((int)this.R0 << 15));
this.R0 -= this.K[this.j--] + (this.R3 & this.R2) + (~this.R3 & this.R1);
}
this.R3 -= this.K[(int)(this.R2 & 63)];
this.R2 -= this.K[(int)(this.R1 & 63)];
this.R1 -= this.K[(int)(this.R0 & 63)];
this.R0 -= this.K[(int)(this.R3 & 63)];
while (this.j >= 0)
{
this.R3 = (ushort)((this.R3 >> 5) | ((int)this.R3 << 11));
this.R3 -= this.K[this.j--] + (this.R2 & this.R1) + (~this.R2 & this.R0);
this.R2 = (ushort)((this.R2 >> 3) | ((int)this.R2 << 13));
this.R2 -= this.K[this.j--] + (this.R1 & this.R0) + (~this.R1 & this.R3);
this.R1 = (ushort)((this.R1 >> 2) | ((int)this.R1 << 14));
this.R1 -= this.K[this.j--] + (this.R0 & this.R3) + (~this.R0 & this.R2);
this.R0 = (ushort)((this.R0 >> 1) | ((int)this.R0 << 15));
this.R0 -= this.K[this.j--] + (this.R3 & this.R2) + (~this.R3 & this.R1);
}
}
output[0] = (byte)this.R0;
output[1] = (byte)(this.R0 >> 8);
output[2] = (byte)this.R1;
output[3] = (byte)(this.R1 >> 8);
output[4] = (byte)this.R2;
output[5] = (byte)(this.R2 >> 8);
output[6] = (byte)this.R3;
output[7] = (byte)(this.R3 >> 8);
}
// Token: 0x04001383 RID: 4995
private ushort R0;
// Token: 0x04001384 RID: 4996
private ushort R1;
// Token: 0x04001385 RID: 4997
private ushort R2;
// Token: 0x04001386 RID: 4998
private ushort R3;
// Token: 0x04001387 RID: 4999
private ushort[] K;
// Token: 0x04001388 RID: 5000
private int j;
// Token: 0x04001389 RID: 5001
private static readonly byte[] pitable = new byte[]
{
217, 120, 249, 196, 25, 221, 181, 237, 40, 233,
253, 121, 74, 160, 216, 157, 198, 126, 55, 131,
43, 118, 83, 142, 98, 76, 100, 136, 68, 139,
251, 162, 23, 154, 89, 245, 135, 179, 79, 19,
97, 69, 109, 141, 9, 129, 125, 50, 189, 143,
64, 235, 134, 183, 123, 11, 240, 149, 33, 34,
92, 107, 78, 130, 84, 214, 101, 147, 206, 96,
178, 28, 115, 86, 192, 20, 167, 140, 241, 220,
18, 117, 202, 31, 59, 190, 228, 209, 66, 61,
212, 48, 163, 60, 182, 38, 111, 191, 14, 218,
70, 105, 7, 87, 39, 242, 29, 155, 188, 148,
67, 3, 248, 17, 199, 246, 144, 239, 62, 231,
6, 195, 213, 47, 200, 102, 30, 215, 8, 232,
234, 222, 128, 82, 238, 247, 132, 170, 114, 172,
53, 77, 106, 42, 150, 26, 210, 113, 90, 21,
73, 116, 75, 159, 208, 94, 4, 24, 164, 236,
194, 224, 65, 110, 15, 81, 203, 204, 36, 145,
175, 80, 161, 244, 112, 57, 153, 124, 58, 133,
35, 184, 180, 122, 252, 2, 54, 91, 37, 85,
151, 49, 45, 93, 250, 152, 227, 138, 146, 174,
5, 223, 41, 16, 103, 108, 186, 201, 211, 0,
230, 207, 225, 158, 168, 44, 99, 22, 1, 63,
88, 226, 137, 169, 13, 56, 52, 27, 171, 51,
byte.MaxValue, 176, 187, 72, 12, 95, 185, 177, 205, 46,
197, 243, 219, 71, 229, 165, 156, 119, 10, 166,
32, 104, 254, 127, 193, 173
};
}
}
@@ -0,0 +1,40 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract class from which all implementations of the MD160 hash algorithm inherit.</summary>
// Token: 0x02000518 RID: 1304
[ComVisible(true)]
public abstract class RIPEMD160 : HashAlgorithm
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RIPEMD160" /> class.</summary>
// Token: 0x06002FDF RID: 12255 RVA: 0x0009B884 File Offset: 0x00099A84
protected RIPEMD160()
{
this.HashSizeValue = 160;
}
/// <summary>Creates an instance of the default implementation of the <see cref="T:System.Security.Cryptography.RIPEMD160" /> hash algorithm.</summary>
/// <returns>A new instance of the <see cref="T:System.Security.Cryptography.RIPEMD160" /> hash algorithm.</returns>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but it is not FIPS-compatible.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06002FE0 RID: 12256 RVA: 0x0009B898 File Offset: 0x00099A98
public new static RIPEMD160 Create()
{
return RIPEMD160.Create("System.Security.Cryptography.RIPEMD160");
}
/// <summary>Creates an instance of the specified implementation of the <see cref="T:System.Security.Cryptography.RIPEMD160" /> hash algorithm.</summary>
/// <returns>A new instance of the specified implementation of <see cref="T:System.Security.Cryptography.RIPEMD160" />.</returns>
/// <param name="hashName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.RIPEMD160" /> to use. </param>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="hashName" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but it is not FIPS-compatible.</exception>
// Token: 0x06002FE1 RID: 12257 RVA: 0x0009B8A4 File Offset: 0x00099AA4
public new static RIPEMD160 Create(string hashName)
{
return (RIPEMD160)CryptoConfig.CreateFromName(hashName);
}
}
}
@@ -0,0 +1,457 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.RIPEMD160" /> hash for the input data using the managed library. </summary>
// Token: 0x02000519 RID: 1305
[ComVisible(true)]
public class RIPEMD160Managed : RIPEMD160
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RIPEMD160" /> class.</summary>
/// <exception cref="T:System.InvalidOperationException">The policy is not compliant with the FIPS algorithm.</exception>
// Token: 0x06002FE2 RID: 12258 RVA: 0x0009B8B4 File Offset: 0x00099AB4
public RIPEMD160Managed()
{
this._X = new uint[16];
this._HashValue = new uint[5];
this._ProcessingBuffer = new byte[64];
this.Initialize();
}
/// <summary>Initializes an instance of the <see cref="T:System.Security.Cryptography.RIPEMD160Managed" /> class using the managed library.</summary>
// Token: 0x06002FE3 RID: 12259 RVA: 0x0009B8F4 File Offset: 0x00099AF4
public override void Initialize()
{
this._HashValue[0] = 1732584193U;
this._HashValue[1] = 4023233417U;
this._HashValue[2] = 2562383102U;
this._HashValue[3] = 271733878U;
this._HashValue[4] = 3285377520U;
this._Length = 0UL;
this._ProcessingBufferCount = 0;
Array.Clear(this._X, 0, this._X.Length);
Array.Clear(this._ProcessingBuffer, 0, this._ProcessingBuffer.Length);
}
/// <summary>When overridden in a derived class, routes data written to the object into the <see cref="T:System.Security.Cryptography.RIPEMD160" /> hash algorithm for computing the hash.</summary>
/// <param name="rgb">The input data. </param>
/// <param name="ibStart">The offset into the byte array from which to begin using data. </param>
/// <param name="cbSize">The number of bytes in the array to use as data. </param>
// Token: 0x06002FE4 RID: 12260 RVA: 0x0009B97C File Offset: 0x00099B7C
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
this.State = 1;
this._Length += (ulong)cbSize;
if (this._ProcessingBufferCount != 0)
{
if (cbSize < 64 - this._ProcessingBufferCount)
{
Buffer.BlockCopy(rgb, ibStart, this._ProcessingBuffer, this._ProcessingBufferCount, cbSize);
this._ProcessingBufferCount += cbSize;
return;
}
int i = 64 - this._ProcessingBufferCount;
Buffer.BlockCopy(rgb, ibStart, this._ProcessingBuffer, this._ProcessingBufferCount, i);
this.ProcessBlock(this._ProcessingBuffer, 0);
this._ProcessingBufferCount = 0;
ibStart += i;
cbSize -= i;
}
for (int i = 0; i < cbSize - cbSize % 64; i += 64)
{
this.ProcessBlock(rgb, ibStart + i);
}
if (cbSize % 64 != 0)
{
Buffer.BlockCopy(rgb, cbSize - cbSize % 64 + ibStart, this._ProcessingBuffer, 0, cbSize % 64);
this._ProcessingBufferCount = cbSize % 64;
}
}
/// <summary>When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object.</summary>
/// <returns>The computed hash code in a byte array.</returns>
// Token: 0x06002FE5 RID: 12261 RVA: 0x0009BA68 File Offset: 0x00099C68
protected override byte[] HashFinal()
{
this.CompressFinal(this._Length);
byte[] array = new byte[20];
if (!BitConverter.IsLittleEndian)
{
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 4; j++)
{
array[i * 4 + j] = (byte)(this._HashValue[i] >> j * 8);
}
}
}
else
{
Buffer.BlockCopy(this._HashValue, 0, array, 0, 20);
}
return array;
}
// Token: 0x06002FE6 RID: 12262 RVA: 0x0009BAE4 File Offset: 0x00099CE4
~RIPEMD160Managed()
{
this.Dispose(false);
}
// Token: 0x06002FE7 RID: 12263 RVA: 0x0009BB20 File Offset: 0x00099D20
private void ProcessBlock(byte[] buffer, int offset)
{
if (!BitConverter.IsLittleEndian)
{
for (int i = 0; i < this._X.Length; i++)
{
this._X[i] = (uint)((int)buffer[offset] | ((int)buffer[offset + 1] << 8) | ((int)buffer[offset + 2] << 16) | ((int)buffer[offset + 3] << 24));
offset += 4;
}
}
else
{
Buffer.BlockCopy(buffer, offset, this._X, 0, 64);
}
this.Compress();
}
// Token: 0x06002FE8 RID: 12264 RVA: 0x0009BB98 File Offset: 0x00099D98
private void Compress()
{
uint num = this._HashValue[0];
uint num2 = this._HashValue[1];
uint num3 = this._HashValue[2];
uint num4 = this._HashValue[3];
uint num5 = this._HashValue[4];
uint num6 = this._HashValue[0];
uint num7 = this._HashValue[1];
uint num8 = this._HashValue[2];
uint num9 = this._HashValue[3];
uint num10 = this._HashValue[4];
this.FF(ref num, num2, ref num3, num4, num5, this._X[0], 11);
this.FF(ref num5, num, ref num2, num3, num4, this._X[1], 14);
this.FF(ref num4, num5, ref num, num2, num3, this._X[2], 15);
this.FF(ref num3, num4, ref num5, num, num2, this._X[3], 12);
this.FF(ref num2, num3, ref num4, num5, num, this._X[4], 5);
this.FF(ref num, num2, ref num3, num4, num5, this._X[5], 8);
this.FF(ref num5, num, ref num2, num3, num4, this._X[6], 7);
this.FF(ref num4, num5, ref num, num2, num3, this._X[7], 9);
this.FF(ref num3, num4, ref num5, num, num2, this._X[8], 11);
this.FF(ref num2, num3, ref num4, num5, num, this._X[9], 13);
this.FF(ref num, num2, ref num3, num4, num5, this._X[10], 14);
this.FF(ref num5, num, ref num2, num3, num4, this._X[11], 15);
this.FF(ref num4, num5, ref num, num2, num3, this._X[12], 6);
this.FF(ref num3, num4, ref num5, num, num2, this._X[13], 7);
this.FF(ref num2, num3, ref num4, num5, num, this._X[14], 9);
this.FF(ref num, num2, ref num3, num4, num5, this._X[15], 8);
this.GG(ref num5, num, ref num2, num3, num4, this._X[7], 7);
this.GG(ref num4, num5, ref num, num2, num3, this._X[4], 6);
this.GG(ref num3, num4, ref num5, num, num2, this._X[13], 8);
this.GG(ref num2, num3, ref num4, num5, num, this._X[1], 13);
this.GG(ref num, num2, ref num3, num4, num5, this._X[10], 11);
this.GG(ref num5, num, ref num2, num3, num4, this._X[6], 9);
this.GG(ref num4, num5, ref num, num2, num3, this._X[15], 7);
this.GG(ref num3, num4, ref num5, num, num2, this._X[3], 15);
this.GG(ref num2, num3, ref num4, num5, num, this._X[12], 7);
this.GG(ref num, num2, ref num3, num4, num5, this._X[0], 12);
this.GG(ref num5, num, ref num2, num3, num4, this._X[9], 15);
this.GG(ref num4, num5, ref num, num2, num3, this._X[5], 9);
this.GG(ref num3, num4, ref num5, num, num2, this._X[2], 11);
this.GG(ref num2, num3, ref num4, num5, num, this._X[14], 7);
this.GG(ref num, num2, ref num3, num4, num5, this._X[11], 13);
this.GG(ref num5, num, ref num2, num3, num4, this._X[8], 12);
this.HH(ref num4, num5, ref num, num2, num3, this._X[3], 11);
this.HH(ref num3, num4, ref num5, num, num2, this._X[10], 13);
this.HH(ref num2, num3, ref num4, num5, num, this._X[14], 6);
this.HH(ref num, num2, ref num3, num4, num5, this._X[4], 7);
this.HH(ref num5, num, ref num2, num3, num4, this._X[9], 14);
this.HH(ref num4, num5, ref num, num2, num3, this._X[15], 9);
this.HH(ref num3, num4, ref num5, num, num2, this._X[8], 13);
this.HH(ref num2, num3, ref num4, num5, num, this._X[1], 15);
this.HH(ref num, num2, ref num3, num4, num5, this._X[2], 14);
this.HH(ref num5, num, ref num2, num3, num4, this._X[7], 8);
this.HH(ref num4, num5, ref num, num2, num3, this._X[0], 13);
this.HH(ref num3, num4, ref num5, num, num2, this._X[6], 6);
this.HH(ref num2, num3, ref num4, num5, num, this._X[13], 5);
this.HH(ref num, num2, ref num3, num4, num5, this._X[11], 12);
this.HH(ref num5, num, ref num2, num3, num4, this._X[5], 7);
this.HH(ref num4, num5, ref num, num2, num3, this._X[12], 5);
this.II(ref num3, num4, ref num5, num, num2, this._X[1], 11);
this.II(ref num2, num3, ref num4, num5, num, this._X[9], 12);
this.II(ref num, num2, ref num3, num4, num5, this._X[11], 14);
this.II(ref num5, num, ref num2, num3, num4, this._X[10], 15);
this.II(ref num4, num5, ref num, num2, num3, this._X[0], 14);
this.II(ref num3, num4, ref num5, num, num2, this._X[8], 15);
this.II(ref num2, num3, ref num4, num5, num, this._X[12], 9);
this.II(ref num, num2, ref num3, num4, num5, this._X[4], 8);
this.II(ref num5, num, ref num2, num3, num4, this._X[13], 9);
this.II(ref num4, num5, ref num, num2, num3, this._X[3], 14);
this.II(ref num3, num4, ref num5, num, num2, this._X[7], 5);
this.II(ref num2, num3, ref num4, num5, num, this._X[15], 6);
this.II(ref num, num2, ref num3, num4, num5, this._X[14], 8);
this.II(ref num5, num, ref num2, num3, num4, this._X[5], 6);
this.II(ref num4, num5, ref num, num2, num3, this._X[6], 5);
this.II(ref num3, num4, ref num5, num, num2, this._X[2], 12);
this.JJ(ref num2, num3, ref num4, num5, num, this._X[4], 9);
this.JJ(ref num, num2, ref num3, num4, num5, this._X[0], 15);
this.JJ(ref num5, num, ref num2, num3, num4, this._X[5], 5);
this.JJ(ref num4, num5, ref num, num2, num3, this._X[9], 11);
this.JJ(ref num3, num4, ref num5, num, num2, this._X[7], 6);
this.JJ(ref num2, num3, ref num4, num5, num, this._X[12], 8);
this.JJ(ref num, num2, ref num3, num4, num5, this._X[2], 13);
this.JJ(ref num5, num, ref num2, num3, num4, this._X[10], 12);
this.JJ(ref num4, num5, ref num, num2, num3, this._X[14], 5);
this.JJ(ref num3, num4, ref num5, num, num2, this._X[1], 12);
this.JJ(ref num2, num3, ref num4, num5, num, this._X[3], 13);
this.JJ(ref num, num2, ref num3, num4, num5, this._X[8], 14);
this.JJ(ref num5, num, ref num2, num3, num4, this._X[11], 11);
this.JJ(ref num4, num5, ref num, num2, num3, this._X[6], 8);
this.JJ(ref num3, num4, ref num5, num, num2, this._X[15], 5);
this.JJ(ref num2, num3, ref num4, num5, num, this._X[13], 6);
this.JJJ(ref num6, num7, ref num8, num9, num10, this._X[5], 8);
this.JJJ(ref num10, num6, ref num7, num8, num9, this._X[14], 9);
this.JJJ(ref num9, num10, ref num6, num7, num8, this._X[7], 9);
this.JJJ(ref num8, num9, ref num10, num6, num7, this._X[0], 11);
this.JJJ(ref num7, num8, ref num9, num10, num6, this._X[9], 13);
this.JJJ(ref num6, num7, ref num8, num9, num10, this._X[2], 15);
this.JJJ(ref num10, num6, ref num7, num8, num9, this._X[11], 15);
this.JJJ(ref num9, num10, ref num6, num7, num8, this._X[4], 5);
this.JJJ(ref num8, num9, ref num10, num6, num7, this._X[13], 7);
this.JJJ(ref num7, num8, ref num9, num10, num6, this._X[6], 7);
this.JJJ(ref num6, num7, ref num8, num9, num10, this._X[15], 8);
this.JJJ(ref num10, num6, ref num7, num8, num9, this._X[8], 11);
this.JJJ(ref num9, num10, ref num6, num7, num8, this._X[1], 14);
this.JJJ(ref num8, num9, ref num10, num6, num7, this._X[10], 14);
this.JJJ(ref num7, num8, ref num9, num10, num6, this._X[3], 12);
this.JJJ(ref num6, num7, ref num8, num9, num10, this._X[12], 6);
this.III(ref num10, num6, ref num7, num8, num9, this._X[6], 9);
this.III(ref num9, num10, ref num6, num7, num8, this._X[11], 13);
this.III(ref num8, num9, ref num10, num6, num7, this._X[3], 15);
this.III(ref num7, num8, ref num9, num10, num6, this._X[7], 7);
this.III(ref num6, num7, ref num8, num9, num10, this._X[0], 12);
this.III(ref num10, num6, ref num7, num8, num9, this._X[13], 8);
this.III(ref num9, num10, ref num6, num7, num8, this._X[5], 9);
this.III(ref num8, num9, ref num10, num6, num7, this._X[10], 11);
this.III(ref num7, num8, ref num9, num10, num6, this._X[14], 7);
this.III(ref num6, num7, ref num8, num9, num10, this._X[15], 7);
this.III(ref num10, num6, ref num7, num8, num9, this._X[8], 12);
this.III(ref num9, num10, ref num6, num7, num8, this._X[12], 7);
this.III(ref num8, num9, ref num10, num6, num7, this._X[4], 6);
this.III(ref num7, num8, ref num9, num10, num6, this._X[9], 15);
this.III(ref num6, num7, ref num8, num9, num10, this._X[1], 13);
this.III(ref num10, num6, ref num7, num8, num9, this._X[2], 11);
this.HHH(ref num9, num10, ref num6, num7, num8, this._X[15], 9);
this.HHH(ref num8, num9, ref num10, num6, num7, this._X[5], 7);
this.HHH(ref num7, num8, ref num9, num10, num6, this._X[1], 15);
this.HHH(ref num6, num7, ref num8, num9, num10, this._X[3], 11);
this.HHH(ref num10, num6, ref num7, num8, num9, this._X[7], 8);
this.HHH(ref num9, num10, ref num6, num7, num8, this._X[14], 6);
this.HHH(ref num8, num9, ref num10, num6, num7, this._X[6], 6);
this.HHH(ref num7, num8, ref num9, num10, num6, this._X[9], 14);
this.HHH(ref num6, num7, ref num8, num9, num10, this._X[11], 12);
this.HHH(ref num10, num6, ref num7, num8, num9, this._X[8], 13);
this.HHH(ref num9, num10, ref num6, num7, num8, this._X[12], 5);
this.HHH(ref num8, num9, ref num10, num6, num7, this._X[2], 14);
this.HHH(ref num7, num8, ref num9, num10, num6, this._X[10], 13);
this.HHH(ref num6, num7, ref num8, num9, num10, this._X[0], 13);
this.HHH(ref num10, num6, ref num7, num8, num9, this._X[4], 7);
this.HHH(ref num9, num10, ref num6, num7, num8, this._X[13], 5);
this.GGG(ref num8, num9, ref num10, num6, num7, this._X[8], 15);
this.GGG(ref num7, num8, ref num9, num10, num6, this._X[6], 5);
this.GGG(ref num6, num7, ref num8, num9, num10, this._X[4], 8);
this.GGG(ref num10, num6, ref num7, num8, num9, this._X[1], 11);
this.GGG(ref num9, num10, ref num6, num7, num8, this._X[3], 14);
this.GGG(ref num8, num9, ref num10, num6, num7, this._X[11], 14);
this.GGG(ref num7, num8, ref num9, num10, num6, this._X[15], 6);
this.GGG(ref num6, num7, ref num8, num9, num10, this._X[0], 14);
this.GGG(ref num10, num6, ref num7, num8, num9, this._X[5], 6);
this.GGG(ref num9, num10, ref num6, num7, num8, this._X[12], 9);
this.GGG(ref num8, num9, ref num10, num6, num7, this._X[2], 12);
this.GGG(ref num7, num8, ref num9, num10, num6, this._X[13], 9);
this.GGG(ref num6, num7, ref num8, num9, num10, this._X[9], 12);
this.GGG(ref num10, num6, ref num7, num8, num9, this._X[7], 5);
this.GGG(ref num9, num10, ref num6, num7, num8, this._X[10], 15);
this.GGG(ref num8, num9, ref num10, num6, num7, this._X[14], 8);
this.FFF(ref num7, num8, ref num9, num10, num6, this._X[12], 8);
this.FFF(ref num6, num7, ref num8, num9, num10, this._X[15], 5);
this.FFF(ref num10, num6, ref num7, num8, num9, this._X[10], 12);
this.FFF(ref num9, num10, ref num6, num7, num8, this._X[4], 9);
this.FFF(ref num8, num9, ref num10, num6, num7, this._X[1], 12);
this.FFF(ref num7, num8, ref num9, num10, num6, this._X[5], 5);
this.FFF(ref num6, num7, ref num8, num9, num10, this._X[8], 14);
this.FFF(ref num10, num6, ref num7, num8, num9, this._X[7], 6);
this.FFF(ref num9, num10, ref num6, num7, num8, this._X[6], 8);
this.FFF(ref num8, num9, ref num10, num6, num7, this._X[2], 13);
this.FFF(ref num7, num8, ref num9, num10, num6, this._X[13], 6);
this.FFF(ref num6, num7, ref num8, num9, num10, this._X[14], 5);
this.FFF(ref num10, num6, ref num7, num8, num9, this._X[0], 15);
this.FFF(ref num9, num10, ref num6, num7, num8, this._X[3], 13);
this.FFF(ref num8, num9, ref num10, num6, num7, this._X[9], 11);
this.FFF(ref num7, num8, ref num9, num10, num6, this._X[11], 11);
num9 += num3 + this._HashValue[1];
this._HashValue[1] = this._HashValue[2] + num4 + num10;
this._HashValue[2] = this._HashValue[3] + num5 + num6;
this._HashValue[3] = this._HashValue[4] + num + num7;
this._HashValue[4] = this._HashValue[0] + num2 + num8;
this._HashValue[0] = num9;
}
// Token: 0x06002FE9 RID: 12265 RVA: 0x0009CBFC File Offset: 0x0009ADFC
private void CompressFinal(ulong length)
{
uint num = (uint)(length & (ulong)(-1));
uint num2 = (uint)(length >> 32);
Array.Clear(this._X, 0, this._X.Length);
int num3 = 0;
for (uint num4 = 0U; num4 < (num & 63U); num4 += 1U)
{
this._X[(int)((UIntPtr)(num4 >> 2))] ^= (uint)((uint)this._ProcessingBuffer[num3++] << (int)((8U * (num4 & 3U)) & 31U & 31U));
}
this._X[(int)((UIntPtr)((num >> 2) & 15U))] ^= 1U << (int)(8U * (num & 3U) + 7U);
if ((num & 63U) > 55U)
{
this.Compress();
Array.Clear(this._X, 0, this._X.Length);
}
this._X[14] = num << 3;
this._X[15] = (num >> 29) | (num2 << 3);
this.Compress();
}
// Token: 0x06002FEA RID: 12266 RVA: 0x0009CCD8 File Offset: 0x0009AED8
private uint ROL(uint x, int n)
{
return (x << n) | (x >> 32 - n);
}
// Token: 0x06002FEB RID: 12267 RVA: 0x0009CCEC File Offset: 0x0009AEEC
private uint F(uint x, uint y, uint z)
{
return x ^ y ^ z;
}
// Token: 0x06002FEC RID: 12268 RVA: 0x0009CCF4 File Offset: 0x0009AEF4
private uint G(uint x, uint y, uint z)
{
return (x & y) | (~x & z);
}
// Token: 0x06002FED RID: 12269 RVA: 0x0009CD00 File Offset: 0x0009AF00
private uint H(uint x, uint y, uint z)
{
return (x | ~y) ^ z;
}
// Token: 0x06002FEE RID: 12270 RVA: 0x0009CD08 File Offset: 0x0009AF08
private uint I(uint x, uint y, uint z)
{
return (x & z) | (y & ~z);
}
// Token: 0x06002FEF RID: 12271 RVA: 0x0009CD14 File Offset: 0x0009AF14
private uint J(uint x, uint y, uint z)
{
return x ^ (y | ~z);
}
// Token: 0x06002FF0 RID: 12272 RVA: 0x0009CD1C File Offset: 0x0009AF1C
private void FF(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.F(b, c, d) + x;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF1 RID: 12273 RVA: 0x0009CD58 File Offset: 0x0009AF58
private void GG(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.G(b, c, d) + x + 1518500249U;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF2 RID: 12274 RVA: 0x0009CD9C File Offset: 0x0009AF9C
private void HH(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.H(b, c, d) + x + 1859775393U;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF3 RID: 12275 RVA: 0x0009CDE0 File Offset: 0x0009AFE0
private void II(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.I(b, c, d) + x + 2400959708U;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF4 RID: 12276 RVA: 0x0009CE24 File Offset: 0x0009B024
private void JJ(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.J(b, c, d) + x + 2840853838U;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF5 RID: 12277 RVA: 0x0009CE68 File Offset: 0x0009B068
private void FFF(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.F(b, c, d) + x;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF6 RID: 12278 RVA: 0x0009CEA4 File Offset: 0x0009B0A4
private void GGG(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.G(b, c, d) + x + 2053994217U;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF7 RID: 12279 RVA: 0x0009CEE8 File Offset: 0x0009B0E8
private void HHH(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.H(b, c, d) + x + 1836072691U;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF8 RID: 12280 RVA: 0x0009CF2C File Offset: 0x0009B12C
private void III(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.I(b, c, d) + x + 1548603684U;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x06002FF9 RID: 12281 RVA: 0x0009CF70 File Offset: 0x0009B170
private void JJJ(ref uint a, uint b, ref uint c, uint d, uint e, uint x, int s)
{
a += this.J(b, c, d) + x + 1352829926U;
a = this.ROL(a, s) + e;
c = this.ROL(c, 10);
}
// Token: 0x0400138A RID: 5002
private const int BLOCK_SIZE_BYTES = 64;
// Token: 0x0400138B RID: 5003
private byte[] _ProcessingBuffer;
// Token: 0x0400138C RID: 5004
private uint[] _X;
// Token: 0x0400138D RID: 5005
private uint[] _HashValue;
// Token: 0x0400138E RID: 5006
private ulong _Length;
// Token: 0x0400138F RID: 5007
private int _ProcessingBufferCount;
}
}
@@ -0,0 +1,127 @@
using System;
using System.Runtime.CompilerServices;
namespace System.Security.Cryptography
{
/// <summary>Implements a cryptographic Random Number Generator (RNG) using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited.</summary>
// Token: 0x0200051A RID: 1306
public sealed class RNGCryptoServiceProvider : RandomNumberGenerator
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RNGCryptoServiceProvider" /> class.</summary>
// Token: 0x06002FFA RID: 12282 RVA: 0x0009CFB4 File Offset: 0x0009B1B4
public RNGCryptoServiceProvider()
{
this._handle = RNGCryptoServiceProvider.RngInitialize(null);
this.Check();
}
// Token: 0x06002FFB RID: 12283 RVA: 0x0009CFD0 File Offset: 0x0009B1D0
static RNGCryptoServiceProvider()
{
if (RNGCryptoServiceProvider.RngOpen())
{
RNGCryptoServiceProvider._lock = new object();
}
}
// Token: 0x06002FFC RID: 12284 RVA: 0x0009CFE8 File Offset: 0x0009B1E8
private void Check()
{
if (this._handle == IntPtr.Zero)
{
throw new CryptographicException(Locale.GetText("Couldn't access random source."));
}
}
// Token: 0x06002FFD RID: 12285
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool RngOpen();
// Token: 0x06002FFE RID: 12286
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr RngInitialize(byte[] seed);
// Token: 0x06002FFF RID: 12287
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr RngGetBytes(IntPtr handle, byte[] data);
// Token: 0x06003000 RID: 12288
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void RngClose(IntPtr handle);
/// <summary>Fills an array of bytes with a cryptographically strong sequence of random values.</summary>
/// <param name="data">The array to fill with a cryptographically strong sequence of random values. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="data" /> is null.</exception>
// Token: 0x06003001 RID: 12289 RVA: 0x0009D010 File Offset: 0x0009B210
public override void GetBytes(byte[] data)
{
if (data == null)
{
throw new ArgumentNullException("data");
}
if (RNGCryptoServiceProvider._lock == null)
{
this._handle = RNGCryptoServiceProvider.RngGetBytes(this._handle, data);
}
else
{
object @lock = RNGCryptoServiceProvider._lock;
lock (@lock)
{
this._handle = RNGCryptoServiceProvider.RngGetBytes(this._handle, data);
}
}
this.Check();
}
/// <summary>Fills an array of bytes with a cryptographically strong sequence of random nonzero values.</summary>
/// <param name="data">The array to fill with a cryptographically strong sequence of random nonzero values. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="data" /> is null.</exception>
// Token: 0x06003002 RID: 12290 RVA: 0x0009D09C File Offset: 0x0009B29C
public override void GetNonZeroBytes(byte[] data)
{
if (data == null)
{
throw new ArgumentNullException("data");
}
byte[] array = new byte[data.Length * 2];
int i = 0;
while (i < data.Length)
{
this._handle = RNGCryptoServiceProvider.RngGetBytes(this._handle, array);
this.Check();
for (int j = 0; j < array.Length; j++)
{
if (i == data.Length)
{
break;
}
if (array[j] != 0)
{
data[i++] = array[j];
}
}
}
}
// Token: 0x06003003 RID: 12291 RVA: 0x0009D124 File Offset: 0x0009B324
~RNGCryptoServiceProvider()
{
if (this._handle != IntPtr.Zero)
{
RNGCryptoServiceProvider.RngClose(this._handle);
this._handle = IntPtr.Zero;
}
}
// Token: 0x04001390 RID: 5008
private static object _lock;
// Token: 0x04001391 RID: 5009
private IntPtr _handle;
}
}
@@ -0,0 +1,177 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class from which all implementations of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm inherit.</summary>
// Token: 0x0200051B RID: 1307
[ComVisible(true)]
public abstract class RSA : AsymmetricAlgorithm
{
/// <summary>Creates an instance of the default implementation of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
/// <returns>A new instance of the default implementation of <see cref="T:System.Security.Cryptography.RSA" />.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06003005 RID: 12293 RVA: 0x0009D18C File Offset: 0x0009B38C
public new static RSA Create()
{
return RSA.Create("System.Security.Cryptography.RSA");
}
/// <summary>Creates an instance of the specified implementation of <see cref="T:System.Security.Cryptography.RSA" />.</summary>
/// <returns>A new instance of the specified implementation of <see cref="T:System.Security.Cryptography.RSA" />.</returns>
/// <param name="algName">The name of the implementation of <see cref="T:System.Security.Cryptography.RSA" /> to use. </param>
// Token: 0x06003006 RID: 12294 RVA: 0x0009D198 File Offset: 0x0009B398
public new static RSA Create(string algName)
{
return (RSA)CryptoConfig.CreateFromName(algName);
}
/// <summary>When overridden in a derived class, encrypts the input data using the public key.</summary>
/// <returns>The resulting encryption of the <paramref name="rgb" /> parameter as cipher text.</returns>
/// <param name="rgb">The plain text to be encrypted. </param>
// Token: 0x06003007 RID: 12295
public abstract byte[] EncryptValue(byte[] rgb);
/// <summary>When overridden in a derived class, decrypts the input data using the private key.</summary>
/// <returns>The resulting decryption of the <paramref name="rgb" /> parameter in plain text.</returns>
/// <param name="rgb">The cipher text to be decrypted. </param>
// Token: 0x06003008 RID: 12296
public abstract byte[] DecryptValue(byte[] rgb);
/// <summary>When overridden in a derived class, exports the <see cref="T:System.Security.Cryptography.RSAParameters" />.</summary>
/// <returns>The parameters for <see cref="T:System.Security.Cryptography.DSA" />.</returns>
/// <param name="includePrivateParameters">true to include private parameters; otherwise, false. </param>
// Token: 0x06003009 RID: 12297
public abstract RSAParameters ExportParameters(bool includePrivateParameters);
/// <summary>When overridden in a derived class, imports the specified <see cref="T:System.Security.Cryptography.RSAParameters" />.</summary>
/// <param name="parameters">The parameters for <see cref="T:System.Security.Cryptography.RSA" />. </param>
// Token: 0x0600300A RID: 12298
public abstract void ImportParameters(RSAParameters parameters);
// Token: 0x0600300B RID: 12299 RVA: 0x0009D1A8 File Offset: 0x0009B3A8
internal void ZeroizePrivateKey(RSAParameters parameters)
{
if (parameters.P != null)
{
Array.Clear(parameters.P, 0, parameters.P.Length);
}
if (parameters.Q != null)
{
Array.Clear(parameters.Q, 0, parameters.Q.Length);
}
if (parameters.DP != null)
{
Array.Clear(parameters.DP, 0, parameters.DP.Length);
}
if (parameters.DQ != null)
{
Array.Clear(parameters.DQ, 0, parameters.DQ.Length);
}
if (parameters.InverseQ != null)
{
Array.Clear(parameters.InverseQ, 0, parameters.InverseQ.Length);
}
if (parameters.D != null)
{
Array.Clear(parameters.D, 0, parameters.D.Length);
}
}
/// <summary>Initializes an <see cref="T:System.Security.Cryptography.RSA" /> object from the key information from an XML string.</summary>
/// <param name="xmlString">The XML string containing <see cref="T:System.Security.Cryptography.RSA" /> key information. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="xmlString" /> parameter is null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The format of the <paramref name="xmlString" /> parameter is not valid. </exception>
// Token: 0x0600300C RID: 12300 RVA: 0x0009D284 File Offset: 0x0009B484
public override void FromXmlString(string xmlString)
{
if (xmlString == null)
{
throw new ArgumentNullException("xmlString");
}
RSAParameters rsaparameters = default(RSAParameters);
try
{
rsaparameters.P = AsymmetricAlgorithm.GetNamedParam(xmlString, "P");
rsaparameters.Q = AsymmetricAlgorithm.GetNamedParam(xmlString, "Q");
rsaparameters.D = AsymmetricAlgorithm.GetNamedParam(xmlString, "D");
rsaparameters.DP = AsymmetricAlgorithm.GetNamedParam(xmlString, "DP");
rsaparameters.DQ = AsymmetricAlgorithm.GetNamedParam(xmlString, "DQ");
rsaparameters.InverseQ = AsymmetricAlgorithm.GetNamedParam(xmlString, "InverseQ");
rsaparameters.Exponent = AsymmetricAlgorithm.GetNamedParam(xmlString, "Exponent");
rsaparameters.Modulus = AsymmetricAlgorithm.GetNamedParam(xmlString, "Modulus");
this.ImportParameters(rsaparameters);
}
catch (Exception ex)
{
this.ZeroizePrivateKey(rsaparameters);
throw new CryptographicException(Locale.GetText("Couldn't decode XML"), ex);
}
finally
{
this.ZeroizePrivateKey(rsaparameters);
}
}
/// <summary>Creates and returns an XML string containing the key of the current <see cref="T:System.Security.Cryptography.RSA" /> object.</summary>
/// <returns>An XML string containing the key of the current <see cref="T:System.Security.Cryptography.RSA" /> object.</returns>
/// <param name="includePrivateParameters">true to include a public and private RSA key; false to include only the public key. </param>
// Token: 0x0600300D RID: 12301 RVA: 0x0009D3A0 File Offset: 0x0009B5A0
public override string ToXmlString(bool includePrivateParameters)
{
StringBuilder stringBuilder = new StringBuilder();
RSAParameters rsaparameters = this.ExportParameters(includePrivateParameters);
try
{
stringBuilder.Append("<RSAKeyValue>");
stringBuilder.Append("<Modulus>");
stringBuilder.Append(Convert.ToBase64String(rsaparameters.Modulus));
stringBuilder.Append("</Modulus>");
stringBuilder.Append("<Exponent>");
stringBuilder.Append(Convert.ToBase64String(rsaparameters.Exponent));
stringBuilder.Append("</Exponent>");
if (includePrivateParameters)
{
if (rsaparameters.D == null)
{
string text = Locale.GetText("Missing D parameter for the private key.");
throw new ArgumentNullException(text);
}
if (rsaparameters.P == null || rsaparameters.Q == null || rsaparameters.DP == null || rsaparameters.DQ == null || rsaparameters.InverseQ == null)
{
string text2 = Locale.GetText("Missing some CRT parameters for the private key.");
throw new CryptographicException(text2);
}
stringBuilder.Append("<P>");
stringBuilder.Append(Convert.ToBase64String(rsaparameters.P));
stringBuilder.Append("</P>");
stringBuilder.Append("<Q>");
stringBuilder.Append(Convert.ToBase64String(rsaparameters.Q));
stringBuilder.Append("</Q>");
stringBuilder.Append("<DP>");
stringBuilder.Append(Convert.ToBase64String(rsaparameters.DP));
stringBuilder.Append("</DP>");
stringBuilder.Append("<DQ>");
stringBuilder.Append(Convert.ToBase64String(rsaparameters.DQ));
stringBuilder.Append("</DQ>");
stringBuilder.Append("<InverseQ>");
stringBuilder.Append(Convert.ToBase64String(rsaparameters.InverseQ));
stringBuilder.Append("</InverseQ>");
stringBuilder.Append("<D>");
stringBuilder.Append(Convert.ToBase64String(rsaparameters.D));
stringBuilder.Append("</D>");
}
stringBuilder.Append("</RSAKeyValue>");
}
catch
{
this.ZeroizePrivateKey(rsaparameters);
throw;
}
return stringBuilder.ToString();
}
}
}
@@ -0,0 +1,592 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Performs asymmetric encryption and decryption using the implementation of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm provided by the cryptographic service provider (CSP). This class cannot be inherited.</summary>
// Token: 0x0200051C RID: 1308
[ComVisible(true)]
public sealed class RSACryptoServiceProvider : RSA, ICspAsymmetricAlgorithm
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> class using the default key.</summary>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired. </exception>
// Token: 0x0600300E RID: 12302 RVA: 0x0009D5D4 File Offset: 0x0009B7D4
public RSACryptoServiceProvider()
{
this.Common(1024, null);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> class with the specified parameters.</summary>
/// <param name="parameters">The parameters to be passed to the cryptographic service provider (CSP). </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The CSP cannot be acquired. </exception>
// Token: 0x0600300F RID: 12303 RVA: 0x0009D5F0 File Offset: 0x0009B7F0
public RSACryptoServiceProvider(CspParameters parameters)
{
this.Common(1024, parameters);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> class with the specified key size.</summary>
/// <param name="dwKeySize">The size of the key to use in bits. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired. </exception>
// Token: 0x06003010 RID: 12304 RVA: 0x0009D60C File Offset: 0x0009B80C
public RSACryptoServiceProvider(int dwKeySize)
{
this.Common(dwKeySize, null);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> class with the specified key size and parameters.</summary>
/// <param name="dwKeySize">The size of the key to use in bits. </param>
/// <param name="parameters">The parameters to be passed to the cryptographic service provider (CSP). </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The CSP cannot be acquired.-or- The key cannot be created. </exception>
// Token: 0x06003011 RID: 12305 RVA: 0x0009D624 File Offset: 0x0009B824
public RSACryptoServiceProvider(int dwKeySize, CspParameters parameters)
{
this.Common(dwKeySize, parameters);
}
// Token: 0x06003013 RID: 12307 RVA: 0x0009D640 File Offset: 0x0009B840
private void Common(int dwKeySize, CspParameters p)
{
this.LegalKeySizesValue = new KeySizes[1];
this.LegalKeySizesValue[0] = new KeySizes(384, 16384, 8);
base.KeySize = dwKeySize;
this.rsa = new RSAManaged(this.KeySize);
this.rsa.KeyGenerated += this.OnKeyGenerated;
this.persistKey = p != null;
if (p == null)
{
p = new CspParameters(1);
if (RSACryptoServiceProvider.useMachineKeyStore)
{
p.Flags |= CspProviderFlags.UseMachineKeyStore;
}
this.store = new KeyPairPersistence(p);
}
else
{
this.store = new KeyPairPersistence(p);
this.store.Load();
if (this.store.KeyValue != null)
{
this.persisted = true;
this.FromXmlString(this.store.KeyValue);
}
}
}
/// <summary>Gets or sets a value indicating whether the key should be persisted in the computer's key store instead of the user profile store.</summary>
/// <returns>true if the key should be persisted in the computer key store; otherwise, false.</returns>
// Token: 0x17000975 RID: 2421
// (get) Token: 0x06003014 RID: 12308 RVA: 0x0009D724 File Offset: 0x0009B924
// (set) Token: 0x06003015 RID: 12309 RVA: 0x0009D72C File Offset: 0x0009B92C
public static bool UseMachineKeyStore
{
get
{
return RSACryptoServiceProvider.useMachineKeyStore;
}
set
{
RSACryptoServiceProvider.useMachineKeyStore = value;
}
}
// Token: 0x06003016 RID: 12310 RVA: 0x0009D734 File Offset: 0x0009B934
~RSACryptoServiceProvider()
{
this.Dispose(false);
}
/// <summary>Gets the name of the key exchange algorithm available with this implementation of <see cref="T:System.Security.Cryptography.RSA" />.</summary>
/// <returns>The name of the key exchange algorithm if it exists; otherwise, null.</returns>
// Token: 0x17000976 RID: 2422
// (get) Token: 0x06003017 RID: 12311 RVA: 0x0009D770 File Offset: 0x0009B970
public override string KeyExchangeAlgorithm
{
get
{
return "RSA-PKCS1-KeyEx";
}
}
/// <summary>Gets the size of the current key.</summary>
/// <returns>The size of the key in bits.</returns>
// Token: 0x17000977 RID: 2423
// (get) Token: 0x06003018 RID: 12312 RVA: 0x0009D778 File Offset: 0x0009B978
public override int KeySize
{
get
{
if (this.rsa == null)
{
return this.KeySizeValue;
}
return this.rsa.KeySize;
}
}
/// <summary>Gets or sets a value indicating whether the key should be persisted in the cryptographic service provider (CSP).</summary>
/// <returns>true if the key should be persisted in the CSP; otherwise, false.</returns>
// Token: 0x17000978 RID: 2424
// (get) Token: 0x06003019 RID: 12313 RVA: 0x0009D798 File Offset: 0x0009B998
// (set) Token: 0x0600301A RID: 12314 RVA: 0x0009D7A0 File Offset: 0x0009B9A0
public bool PersistKeyInCsp
{
get
{
return this.persistKey;
}
set
{
this.persistKey = value;
if (this.persistKey)
{
this.OnKeyGenerated(this.rsa, null);
}
}
}
/// <summary>Gets a value that indicates whether the <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> object contains only a public key.</summary>
/// <returns>true if the <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> object contains only a public key; otherwise, false.</returns>
// Token: 0x17000979 RID: 2425
// (get) Token: 0x0600301B RID: 12315 RVA: 0x0009D7C4 File Offset: 0x0009B9C4
[ComVisible(false)]
public bool PublicOnly
{
get
{
return this.rsa.PublicOnly;
}
}
/// <summary>Gets the name of the signature algorithm available with this implementation of <see cref="T:System.Security.Cryptography.RSA" />.</summary>
/// <returns>The name of the signature algorithm.</returns>
// Token: 0x1700097A RID: 2426
// (get) Token: 0x0600301C RID: 12316 RVA: 0x0009D7D4 File Offset: 0x0009B9D4
public override string SignatureAlgorithm
{
get
{
return "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
}
}
/// <summary>Decrypts data with the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
/// <returns>The decrypted data, which is the original plain text before encryption.</returns>
/// <param name="rgb">The data to be decrypted. </param>
/// <param name="fOAEP">true to perform direct <see cref="T:System.Security.Cryptography.RSA" /> decryption using OAEP padding (only available on a computer running Microsoft Windows XP or later); otherwise, false to use PKCS#1 v1.5 padding. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- The <paramref name="fOAEP" /> parameter is true and the length of the <paramref name="rgb" /> parameter is greater than <see cref="P:System.Security.Cryptography.RSACryptoServiceProvider.KeySize" />.-or- The <paramref name="fOAEP" /> parameter is true and OAEP is not supported. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="rgb " />is null.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600301D RID: 12317 RVA: 0x0009D7DC File Offset: 0x0009B9DC
public byte[] Decrypt(byte[] rgb, bool fOAEP)
{
if (this.m_disposed)
{
throw new ObjectDisposedException("rsa");
}
AsymmetricKeyExchangeDeformatter asymmetricKeyExchangeDeformatter;
if (fOAEP)
{
asymmetricKeyExchangeDeformatter = new RSAOAEPKeyExchangeDeformatter(this.rsa);
}
else
{
asymmetricKeyExchangeDeformatter = new RSAPKCS1KeyExchangeDeformatter(this.rsa);
}
return asymmetricKeyExchangeDeformatter.DecryptKeyExchange(rgb);
}
/// <summary>This method is not supported in the current version.</summary>
/// <returns>The decrypted data, which is the original plain text before encryption.</returns>
/// <param name="rgb">The data to be decrypted. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported in the current version. </exception>
// Token: 0x0600301E RID: 12318 RVA: 0x0009D82C File Offset: 0x0009BA2C
public override byte[] DecryptValue(byte[] rgb)
{
if (!this.rsa.IsCrtPossible)
{
throw new CryptographicException("Incomplete private key - missing CRT.");
}
return this.rsa.DecryptValue(rgb);
}
/// <summary>Encrypts data with the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
/// <returns>The encrypted data.</returns>
/// <param name="rgb">The data to be encrypted. </param>
/// <param name="fOAEP">true to perform direct <see cref="T:System.Security.Cryptography.RSA" /> encryption using Optimal Asymmetric Encryption Padding (OAEP), which is only available on a computer running Microsoft Windows XP or later; false to use PKCS#1 v1.5 padding. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- The length of the <paramref name="rgb" /> parameter is greater than the maximum allowed length.-or- The <paramref name="fOAEP" /> parameter is true and OAEP padding is not supported. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="rgb " />is null.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600301F RID: 12319 RVA: 0x0009D858 File Offset: 0x0009BA58
public byte[] Encrypt(byte[] rgb, bool fOAEP)
{
AsymmetricKeyExchangeFormatter asymmetricKeyExchangeFormatter;
if (fOAEP)
{
asymmetricKeyExchangeFormatter = new RSAOAEPKeyExchangeFormatter(this.rsa);
}
else
{
asymmetricKeyExchangeFormatter = new RSAPKCS1KeyExchangeFormatter(this.rsa);
}
return asymmetricKeyExchangeFormatter.CreateKeyExchange(rgb);
}
/// <summary>This method is not supported in the current version.</summary>
/// <returns>The encrypted data.</returns>
/// <param name="rgb">The data to be encrypted. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported in the current version. </exception>
// Token: 0x06003020 RID: 12320 RVA: 0x0009D894 File Offset: 0x0009BA94
public override byte[] EncryptValue(byte[] rgb)
{
return this.rsa.EncryptValue(rgb);
}
/// <summary>Exports the <see cref="T:System.Security.Cryptography.RSAParameters" />.</summary>
/// <returns>The parameters for <see cref="T:System.Security.Cryptography.RSA" />.</returns>
/// <param name="includePrivateParameters">true to include private parameters; otherwise, false. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key cannot be exported. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003021 RID: 12321 RVA: 0x0009D8A4 File Offset: 0x0009BAA4
public override RSAParameters ExportParameters(bool includePrivateParameters)
{
if (includePrivateParameters && !this.privateKeyExportable)
{
throw new CryptographicException("cannot export private key");
}
return this.rsa.ExportParameters(includePrivateParameters);
}
/// <summary>Imports the specified <see cref="T:System.Security.Cryptography.RSAParameters" />.</summary>
/// <param name="parameters">The parameters for <see cref="T:System.Security.Cryptography.RSA" />. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- The <paramref name="parameters" /> parameter has missing fields. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003022 RID: 12322 RVA: 0x0009D8DC File Offset: 0x0009BADC
public override void ImportParameters(RSAParameters parameters)
{
this.rsa.ImportParameters(parameters);
}
// Token: 0x06003023 RID: 12323 RVA: 0x0009D8EC File Offset: 0x0009BAEC
private HashAlgorithm GetHash(object halg)
{
if (halg == null)
{
throw new ArgumentNullException("halg");
}
HashAlgorithm hashAlgorithm;
if (halg is string)
{
hashAlgorithm = HashAlgorithm.Create((string)halg);
}
else if (halg is HashAlgorithm)
{
hashAlgorithm = (HashAlgorithm)halg;
}
else
{
if (!(halg is Type))
{
throw new ArgumentException("halg");
}
hashAlgorithm = (HashAlgorithm)Activator.CreateInstance((Type)halg);
}
return hashAlgorithm;
}
/// <summary>Computes the hash value of the specified byte array using the specified hash algorithm, and signs the resulting hash value.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.RSA" /> signature for the specified data.</returns>
/// <param name="buffer">The input data for which to compute the hash. </param>
/// <param name="halg">The hash algorithm to use to create the hash value. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="halg" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="halg" /> parameter is not a valid type. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003024 RID: 12324 RVA: 0x0009D96C File Offset: 0x0009BB6C
public byte[] SignData(byte[] buffer, object halg)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
return this.SignData(buffer, 0, buffer.Length, halg);
}
/// <summary>Computes the hash value of the specified input stream using the specified hash algorithm, and signs the resulting hash value.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.RSA" /> signature for the specified data.</returns>
/// <param name="inputStream">The input data for which to compute the hash. </param>
/// <param name="halg">The hash algorithm to use to create the hash value. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="halg" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="halg" /> parameter is not a valid type. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003025 RID: 12325 RVA: 0x0009D98C File Offset: 0x0009BB8C
public byte[] SignData(Stream inputStream, object halg)
{
HashAlgorithm hash = this.GetHash(halg);
byte[] array = hash.ComputeHash(inputStream);
return PKCS1.Sign_v15(this, hash, array);
}
/// <summary>Computes the hash value of a subset of the specified byte array using the specified hash algorithm, and signs the resulting hash value.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.RSA" /> signature for the specified data.</returns>
/// <param name="buffer">The input data for which to compute the hash. </param>
/// <param name="offset">The offset into the array from which to begin using data. </param>
/// <param name="count">The number of bytes in the array to use as data. </param>
/// <param name="halg">The hash algorithm to use to create the hash value. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="halg" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="halg" /> parameter is not a valid type. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003026 RID: 12326 RVA: 0x0009D9B4 File Offset: 0x0009BBB4
public byte[] SignData(byte[] buffer, int offset, int count, object halg)
{
HashAlgorithm hash = this.GetHash(halg);
byte[] array = hash.ComputeHash(buffer, offset, count);
return PKCS1.Sign_v15(this, hash, array);
}
// Token: 0x06003027 RID: 12327 RVA: 0x0009D9DC File Offset: 0x0009BBDC
private string GetHashNameFromOID(string oid)
{
if (oid != null)
{
if (RSACryptoServiceProvider.<>f__switch$map29 == null)
{
RSACryptoServiceProvider.<>f__switch$map29 = new Dictionary<string, int>(2)
{
{ "1.3.14.3.2.26", 0 },
{ "1.2.840.113549.2.5", 1 }
};
}
int num;
if (RSACryptoServiceProvider.<>f__switch$map29.TryGetValue(oid, out num))
{
if (num == 0)
{
return "SHA1";
}
if (num == 1)
{
return "MD5";
}
}
}
throw new NotSupportedException(oid + " is an unsupported hash algorithm for RSA signing");
}
/// <summary>Computes the signature for the specified hash value by encrypting it with the private key.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.RSA" /> signature for the specified hash value.</returns>
/// <param name="rgbHash">The hash value of the data to be signed. </param>
/// <param name="str">The hash algorithm identifier (OID) used to create the hash value of the data. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbHash" /> parameter is null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- There is no private key. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003028 RID: 12328 RVA: 0x0009DA60 File Offset: 0x0009BC60
public byte[] SignHash(byte[] rgbHash, string str)
{
if (rgbHash == null)
{
throw new ArgumentNullException("rgbHash");
}
string text = ((str != null) ? this.GetHashNameFromOID(str) : "SHA1");
HashAlgorithm hashAlgorithm = HashAlgorithm.Create(text);
return PKCS1.Sign_v15(this, hashAlgorithm, rgbHash);
}
/// <summary>Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the hash value of the provided data.</summary>
/// <returns>true if the signature is valid; otherwise, false.</returns>
/// <param name="buffer">The data that was signed. </param>
/// <param name="halg">The name of the hash algorithm used to create the hash value of the data. </param>
/// <param name="signature">The signature data to use for verification. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="halg" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="halg" /> parameter is not a valid type. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003029 RID: 12329 RVA: 0x0009DAA8 File Offset: 0x0009BCA8
public bool VerifyData(byte[] buffer, object halg, byte[] signature)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (signature == null)
{
throw new ArgumentNullException("signature");
}
HashAlgorithm hash = this.GetHash(halg);
byte[] array = hash.ComputeHash(buffer);
return PKCS1.Verify_v15(this, hash, array, signature);
}
/// <summary>Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the provided hash value.</summary>
/// <returns>true if the signature is valid; otherwise, false.</returns>
/// <param name="rgbHash">The hash value of the signed data. </param>
/// <param name="str">The hash algorithm identifier (OID) used to create the hash value of the data. </param>
/// <param name="rgbSignature">The signature data to use for verification. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbHash" /> parameter is null.-or- The <paramref name="rgbSignature" /> parameter is null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cryptographic service provider (CSP) cannot be acquired.-or- The signature cannot be verified. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600302A RID: 12330 RVA: 0x0009DAF0 File Offset: 0x0009BCF0
public bool VerifyHash(byte[] rgbHash, string str, byte[] rgbSignature)
{
if (rgbHash == null)
{
throw new ArgumentNullException("rgbHash");
}
if (rgbSignature == null)
{
throw new ArgumentNullException("rgbSignature");
}
string text = ((str != null) ? this.GetHashNameFromOID(str) : "SHA1");
HashAlgorithm hashAlgorithm = HashAlgorithm.Create(text);
return PKCS1.Verify_v15(this, hashAlgorithm, rgbHash, rgbSignature);
}
// Token: 0x0600302B RID: 12331 RVA: 0x0009DB48 File Offset: 0x0009BD48
protected override void Dispose(bool disposing)
{
if (!this.m_disposed)
{
if (this.persisted && !this.persistKey)
{
this.store.Remove();
}
if (this.rsa != null)
{
this.rsa.Clear();
}
this.m_disposed = true;
}
}
// Token: 0x0600302C RID: 12332 RVA: 0x0009DBA0 File Offset: 0x0009BDA0
private void OnKeyGenerated(object sender, EventArgs e)
{
if (this.persistKey && !this.persisted)
{
this.store.KeyValue = this.ToXmlString(!this.rsa.PublicOnly);
this.store.Save();
this.persisted = true;
}
}
/// <summary>Gets a <see cref="T:System.Security.Cryptography.CspKeyContainerInfo" /> object that describes additional information about a cryptographic key pair. </summary>
/// <returns>A <see cref="T:System.Security.Cryptography.CspKeyContainerInfo" /> object that describes additional information about a cryptographic key pair.</returns>
// Token: 0x1700097B RID: 2427
// (get) Token: 0x0600302D RID: 12333 RVA: 0x0009DBF4 File Offset: 0x0009BDF4
[MonoTODO("Always return null")]
[ComVisible(false)]
public CspKeyContainerInfo CspKeyContainerInfo
{
get
{
return null;
}
}
/// <summary>Exports a blob containing the key information associated with an <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> object. </summary>
/// <returns>A byte array containing the key information associated with an <see cref="T:System.Security.Cryptography.RSACryptoServiceProvider" /> object.</returns>
/// <param name="includePrivateParameters">true to include the private key; otherwise, false.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600302E RID: 12334 RVA: 0x0009DBF8 File Offset: 0x0009BDF8
[ComVisible(false)]
public byte[] ExportCspBlob(bool includePrivateParameters)
{
byte[] array;
if (includePrivateParameters)
{
array = CryptoConvert.ToCapiPrivateKeyBlob(this);
}
else
{
array = CryptoConvert.ToCapiPublicKeyBlob(this);
}
array[5] = 164;
return array;
}
/// <summary>Imports a blob that represents RSA key information. </summary>
/// <param name="keyBlob">A byte array that represents an RSA key blob.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600302F RID: 12335 RVA: 0x0009DC2C File Offset: 0x0009BE2C
[ComVisible(false)]
public void ImportCspBlob(byte[] keyBlob)
{
if (keyBlob == null)
{
throw new ArgumentNullException("keyBlob");
}
RSA rsa = CryptoConvert.FromCapiKeyBlob(keyBlob);
if (rsa is RSACryptoServiceProvider)
{
RSAParameters rsaparameters = rsa.ExportParameters(!(rsa as RSACryptoServiceProvider).PublicOnly);
this.ImportParameters(rsaparameters);
}
else
{
try
{
RSAParameters rsaparameters2 = rsa.ExportParameters(true);
this.ImportParameters(rsaparameters2);
}
catch
{
RSAParameters rsaparameters3 = rsa.ExportParameters(false);
this.ImportParameters(rsaparameters3);
}
}
}
// Token: 0x04001392 RID: 5010
private const int PROV_RSA_FULL = 1;
// Token: 0x04001393 RID: 5011
private KeyPairPersistence store;
// Token: 0x04001394 RID: 5012
private bool persistKey;
// Token: 0x04001395 RID: 5013
private bool persisted;
// Token: 0x04001396 RID: 5014
private bool privateKeyExportable = true;
// Token: 0x04001397 RID: 5015
private bool m_disposed;
// Token: 0x04001398 RID: 5016
private RSAManaged rsa;
// Token: 0x04001399 RID: 5017
private static bool useMachineKeyStore;
}
}
@@ -0,0 +1,82 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Decrypts Optimal Asymmetric Encryption Padding (OAEP) key exchange data.</summary>
// Token: 0x0200051D RID: 1309
[ComVisible(true)]
public class RSAOAEPKeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter" /> class.</summary>
// Token: 0x06003030 RID: 12336 RVA: 0x0009DCC4 File Offset: 0x0009BEC4
public RSAOAEPKeyExchangeDeformatter()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter" /> class with the specified key.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the private key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key " />is null.</exception>
// Token: 0x06003031 RID: 12337 RVA: 0x0009DCCC File Offset: 0x0009BECC
public RSAOAEPKeyExchangeDeformatter(AsymmetricAlgorithm key)
{
this.SetKey(key);
}
/// <summary>Gets the parameters for the Optimal Asymmetric Encryption Padding (OAEP) key exchange.</summary>
/// <returns>An XML string containing the parameters of the OAEP key exchange operation.</returns>
// Token: 0x1700097C RID: 2428
// (get) Token: 0x06003032 RID: 12338 RVA: 0x0009DCDC File Offset: 0x0009BEDC
// (set) Token: 0x06003033 RID: 12339 RVA: 0x0009DCE0 File Offset: 0x0009BEE0
public override string Parameters
{
get
{
return null;
}
set
{
}
}
/// <summary>Extracts secret information from the encrypted key exchange data.</summary>
/// <returns>The secret information derived from the key exchange data.</returns>
/// <param name="rgbData">The key exchange data within which the secret information is hidden. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key exchange data verification has failed. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The key is missing.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003034 RID: 12340 RVA: 0x0009DCE4 File Offset: 0x0009BEE4
public override byte[] DecryptKeyExchange(byte[] rgbData)
{
if (this.rsa == null)
{
string text = Locale.GetText("No RSA key specified");
throw new CryptographicUnexpectedOperationException(text);
}
SHA1 sha = SHA1.Create();
byte[] array = PKCS1.Decrypt_OAEP(this.rsa, sha, rgbData);
if (array != null)
{
return array;
}
throw new CryptographicException(Locale.GetText("OAEP decoding error."));
}
/// <summary>Sets the private key to use for decrypting the secret information.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the private key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06003035 RID: 12341 RVA: 0x0009DD3C File Offset: 0x0009BF3C
public override void SetKey(AsymmetricAlgorithm key)
{
this.rsa = (RSA)key;
}
// Token: 0x0400139B RID: 5019
private RSA rsa;
}
}
@@ -0,0 +1,130 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Creates Optimal Asymmetric Encryption Padding (OAEP) key exchange data using <see cref="T:System.Security.Cryptography.RSA" />.</summary>
// Token: 0x0200051E RID: 1310
[ComVisible(true)]
public class RSAOAEPKeyExchangeFormatter : AsymmetricKeyExchangeFormatter
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAOAEPKeyExchangeFormatter" /> class.</summary>
// Token: 0x06003036 RID: 12342 RVA: 0x0009DD4C File Offset: 0x0009BF4C
public RSAOAEPKeyExchangeFormatter()
{
this.rsa = null;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAOAEPKeyExchangeFormatter" /> class with the specified key.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the public key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key " />is null.</exception>
// Token: 0x06003037 RID: 12343 RVA: 0x0009DD5C File Offset: 0x0009BF5C
public RSAOAEPKeyExchangeFormatter(AsymmetricAlgorithm key)
{
this.SetKey(key);
}
/// <summary>Gets or sets the parameter used to create padding in the key exchange creation process.</summary>
/// <returns>The parameter value.</returns>
// Token: 0x1700097D RID: 2429
// (get) Token: 0x06003038 RID: 12344 RVA: 0x0009DD6C File Offset: 0x0009BF6C
// (set) Token: 0x06003039 RID: 12345 RVA: 0x0009DD74 File Offset: 0x0009BF74
public byte[] Parameter
{
get
{
return this.param;
}
set
{
this.param = value;
}
}
/// <summary>Gets the parameters for the Optimal Asymmetric Encryption Padding (OAEP) key exchange.</summary>
/// <returns>An XML string containing the parameters of the OAEP key exchange operation.</returns>
// Token: 0x1700097E RID: 2430
// (get) Token: 0x0600303A RID: 12346 RVA: 0x0009DD80 File Offset: 0x0009BF80
public override string Parameters
{
get
{
return null;
}
}
/// <summary>Gets or sets the random number generator algorithm to use in the creation of the key exchange.</summary>
/// <returns>The instance of a random number generator algorithm to use.</returns>
// Token: 0x1700097F RID: 2431
// (get) Token: 0x0600303B RID: 12347 RVA: 0x0009DD84 File Offset: 0x0009BF84
// (set) Token: 0x0600303C RID: 12348 RVA: 0x0009DD8C File Offset: 0x0009BF8C
public RandomNumberGenerator Rng
{
get
{
return this.random;
}
set
{
this.random = value;
}
}
/// <summary>Creates the encrypted key exchange data from the specified input data.</summary>
/// <returns>The encrypted key exchange data to be sent to the intended recipient.</returns>
/// <param name="rgbData">The secret information to be passed in the key exchange. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The key is missing.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600303D RID: 12349 RVA: 0x0009DD98 File Offset: 0x0009BF98
public override byte[] CreateKeyExchange(byte[] rgbData)
{
if (this.random == null)
{
this.random = RandomNumberGenerator.Create();
}
if (this.rsa == null)
{
string text = Locale.GetText("No RSA key specified");
throw new CryptographicUnexpectedOperationException(text);
}
SHA1 sha = SHA1.Create();
return PKCS1.Encrypt_OAEP(this.rsa, sha, this.random, rgbData);
}
/// <summary>Creates the encrypted key exchange data from the specified input data.</summary>
/// <returns>The encrypted key exchange data to be sent to the intended recipient.</returns>
/// <param name="rgbData">The secret information to be passed in the key exchange. </param>
/// <param name="symAlgType">This parameter is not used in the current version. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600303E RID: 12350 RVA: 0x0009DDF4 File Offset: 0x0009BFF4
public override byte[] CreateKeyExchange(byte[] rgbData, Type symAlgType)
{
return this.CreateKeyExchange(rgbData);
}
/// <summary>Sets the public key to use for encrypting the key exchange data.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the public key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key " />is null.</exception>
// Token: 0x0600303F RID: 12351 RVA: 0x0009DE00 File Offset: 0x0009C000
public override void SetKey(AsymmetricAlgorithm key)
{
this.rsa = (RSA)key;
}
// Token: 0x0400139C RID: 5020
private RSA rsa;
// Token: 0x0400139D RID: 5021
private RandomNumberGenerator random;
// Token: 0x0400139E RID: 5022
private byte[] param;
}
}
@@ -0,0 +1,99 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Decrypts the PKCS #1 key exchange data.</summary>
// Token: 0x0200051F RID: 1311
[ComVisible(true)]
public class RSAPKCS1KeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter" /> class.</summary>
// Token: 0x06003040 RID: 12352 RVA: 0x0009DE10 File Offset: 0x0009C010
public RSAPKCS1KeyExchangeDeformatter()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter" /> class with the specified key.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the private key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06003041 RID: 12353 RVA: 0x0009DE18 File Offset: 0x0009C018
public RSAPKCS1KeyExchangeDeformatter(AsymmetricAlgorithm key)
{
this.SetKey(key);
}
/// <summary>Gets the parameters for the PKCS #1 key exchange.</summary>
/// <returns>An XML string containing the parameters of the PKCS #1 key exchange operation.</returns>
// Token: 0x17000980 RID: 2432
// (get) Token: 0x06003042 RID: 12354 RVA: 0x0009DE28 File Offset: 0x0009C028
// (set) Token: 0x06003043 RID: 12355 RVA: 0x0009DE2C File Offset: 0x0009C02C
public override string Parameters
{
get
{
return null;
}
set
{
}
}
/// <summary>Gets or sets the random number generator algorithm to use in the creation of the key exchange.</summary>
/// <returns>The instance of a random number generator algorithm to use.</returns>
// Token: 0x17000981 RID: 2433
// (get) Token: 0x06003044 RID: 12356 RVA: 0x0009DE30 File Offset: 0x0009C030
// (set) Token: 0x06003045 RID: 12357 RVA: 0x0009DE38 File Offset: 0x0009C038
public RandomNumberGenerator RNG
{
get
{
return this.random;
}
set
{
this.random = value;
}
}
/// <summary>Extracts secret information from the encrypted key exchange data.</summary>
/// <returns>The secret information derived from the key exchange data.</returns>
/// <param name="rgbIn">The key exchange data within which the secret information is hidden. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The key is missing.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003046 RID: 12358 RVA: 0x0009DE44 File Offset: 0x0009C044
public override byte[] DecryptKeyExchange(byte[] rgbIn)
{
if (this.rsa == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("No key pair available."));
}
byte[] array = PKCS1.Decrypt_v15(this.rsa, rgbIn);
if (array != null)
{
return array;
}
throw new CryptographicException(Locale.GetText("PKCS1 decoding error."));
}
/// <summary>Sets the private key to use for decrypting the secret information.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the private key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06003047 RID: 12359 RVA: 0x0009DE90 File Offset: 0x0009C090
public override void SetKey(AsymmetricAlgorithm key)
{
this.rsa = (RSA)key;
}
// Token: 0x0400139F RID: 5023
private RSA rsa;
// Token: 0x040013A0 RID: 5024
private RandomNumberGenerator random;
}
}
@@ -0,0 +1,124 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Creates the PKCS#1 key exchange data using <see cref="T:System.Security.Cryptography.RSA" />.</summary>
// Token: 0x02000520 RID: 1312
[ComVisible(true)]
public class RSAPKCS1KeyExchangeFormatter : AsymmetricKeyExchangeFormatter
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter" /> class.</summary>
// Token: 0x06003048 RID: 12360 RVA: 0x0009DEA0 File Offset: 0x0009C0A0
public RSAPKCS1KeyExchangeFormatter()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter" /> class with the specified key.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the public key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key " />is null.</exception>
// Token: 0x06003049 RID: 12361 RVA: 0x0009DEA8 File Offset: 0x0009C0A8
public RSAPKCS1KeyExchangeFormatter(AsymmetricAlgorithm key)
{
this.SetRSAKey(key);
}
/// <summary>Gets or sets the random number generator algorithm to use in the creation of the key exchange.</summary>
/// <returns>The instance of a random number generator algorithm to use.</returns>
// Token: 0x17000982 RID: 2434
// (get) Token: 0x0600304A RID: 12362 RVA: 0x0009DEB8 File Offset: 0x0009C0B8
// (set) Token: 0x0600304B RID: 12363 RVA: 0x0009DEC0 File Offset: 0x0009C0C0
public RandomNumberGenerator Rng
{
get
{
return this.random;
}
set
{
this.random = value;
}
}
/// <summary>Gets the parameters for the PKCS #1 key exchange.</summary>
/// <returns>An XML string containing the parameters of the PKCS #1 key exchange operation.</returns>
// Token: 0x17000983 RID: 2435
// (get) Token: 0x0600304C RID: 12364 RVA: 0x0009DECC File Offset: 0x0009C0CC
public override string Parameters
{
get
{
return "<enc:KeyEncryptionMethod enc:Algorithm=\"http://www.microsoft.com/xml/security/algorithm/PKCS1-v1.5-KeyEx\" xmlns:enc=\"http://www.microsoft.com/xml/security/encryption/v1.0\" />";
}
}
/// <summary>Creates the encrypted key exchange data from the specified input data.</summary>
/// <returns>The encrypted key exchange data to be sent to the intended recipient.</returns>
/// <param name="rgbData">The secret information to be passed in the key exchange. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">
/// <paramref name="rgbData " />is too big.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The key is null.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600304D RID: 12365 RVA: 0x0009DED4 File Offset: 0x0009C0D4
public override byte[] CreateKeyExchange(byte[] rgbData)
{
if (rgbData == null)
{
throw new ArgumentNullException("rgbData");
}
if (this.rsa == null)
{
string text = Locale.GetText("No RSA key specified");
throw new CryptographicUnexpectedOperationException(text);
}
if (this.random == null)
{
this.random = RandomNumberGenerator.Create();
}
return PKCS1.Encrypt_v15(this.rsa, this.random, rgbData);
}
/// <summary>Creates the encrypted key exchange data from the specified input data.</summary>
/// <returns>The encrypted key exchange data to be sent to the intended recipient.</returns>
/// <param name="rgbData">The secret information to be passed in the key exchange. </param>
/// <param name="symAlgType">This parameter is not used in the current version. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600304E RID: 12366 RVA: 0x0009DF38 File Offset: 0x0009C138
public override byte[] CreateKeyExchange(byte[] rgbData, Type symAlgType)
{
return this.CreateKeyExchange(rgbData);
}
// Token: 0x0600304F RID: 12367 RVA: 0x0009DF44 File Offset: 0x0009C144
private void SetRSAKey(AsymmetricAlgorithm key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.rsa = (RSA)key;
}
/// <summary>Sets the public key to use for encrypting the key exchange data.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the public key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key " />is null.</exception>
// Token: 0x06003050 RID: 12368 RVA: 0x0009DF64 File Offset: 0x0009C164
public override void SetKey(AsymmetricAlgorithm key)
{
this.SetRSAKey(key);
}
// Token: 0x040013A1 RID: 5025
private RSA rsa;
// Token: 0x040013A2 RID: 5026
private RandomNumberGenerator random;
}
}
@@ -0,0 +1,23 @@
using System;
namespace System.Security.Cryptography
{
// Token: 0x02000537 RID: 1335
internal class RSAPKCS1SHA1SignatureDescription : SignatureDescription
{
// Token: 0x060030DC RID: 12508 RVA: 0x000A807C File Offset: 0x000A627C
public RSAPKCS1SHA1SignatureDescription()
{
base.DeformatterAlgorithm = "System.Security.Cryptography.RSAPKCS1SignatureDeformatter";
base.DigestAlgorithm = "System.Security.Cryptography.SHA1CryptoServiceProvider";
base.FormatterAlgorithm = "System.Security.Cryptography.RSAPKCS1SignatureFormatter";
base.KeyAlgorithm = "System.Security.Cryptography.RSACryptoServiceProvider";
}
// Token: 0x060030DD RID: 12509 RVA: 0x000A80BC File Offset: 0x000A62BC
public override AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
{
return base.CreateDeformatter(key);
}
}
}
@@ -0,0 +1,91 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Verifies an <see cref="T:System.Security.Cryptography.RSA" /> PKCS #1 version 1.5 signature.</summary>
// Token: 0x02000521 RID: 1313
[ComVisible(true)]
public class RSAPKCS1SignatureDeformatter : AsymmetricSignatureDeformatter
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAPKCS1SignatureDeformatter" /> class.</summary>
// Token: 0x06003051 RID: 12369 RVA: 0x0009DF70 File Offset: 0x0009C170
public RSAPKCS1SignatureDeformatter()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAPKCS1SignatureDeformatter" /> class with the specified key.</summary>
/// <param name="key">The instance of <see cref="T:System.Security.Cryptography.RSA" /> that holds the public key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key " />is null.</exception>
// Token: 0x06003052 RID: 12370 RVA: 0x0009DF78 File Offset: 0x0009C178
public RSAPKCS1SignatureDeformatter(AsymmetricAlgorithm key)
{
this.SetKey(key);
}
/// <summary>Sets the hash algorithm to use for verifying the signature.</summary>
/// <param name="strName">The name of the hash algorithm to use for verifying the signature. </param>
// Token: 0x06003053 RID: 12371 RVA: 0x0009DF88 File Offset: 0x0009C188
public override void SetHashAlgorithm(string strName)
{
if (strName == null)
{
throw new ArgumentNullException("strName");
}
this.hashName = strName;
}
/// <summary>Sets the public key to use for verifying the signature.</summary>
/// <param name="key">The instance of <see cref="T:System.Security.Cryptography.RSA" /> that holds the public key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key " />is null.</exception>
// Token: 0x06003054 RID: 12372 RVA: 0x0009DFA4 File Offset: 0x0009C1A4
public override void SetKey(AsymmetricAlgorithm key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.rsa = (RSA)key;
}
/// <summary>Verifies the <see cref="T:System.Security.Cryptography.RSA" /> PKCS#1 signature for the specified data.</summary>
/// <returns>true if <paramref name="rgbSignature" /> matches the signature computed using the specified hash algorithm and key on <paramref name="rgbHash" />; otherwise, false.</returns>
/// <param name="rgbHash">The data signed with <paramref name="rgbSignature" />. </param>
/// <param name="rgbSignature">The signature to be verified for <paramref name="rgbHash" />. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The key is null.-or- The hash algorithm is null. </exception>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbHash" /> parameter is null.-or- The <paramref name="rgbSignature" /> parameter is null. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003055 RID: 12373 RVA: 0x0009DFC4 File Offset: 0x0009C1C4
public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
{
if (this.rsa == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("No public key available."));
}
if (this.hashName == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("Missing hash algorithm."));
}
if (rgbHash == null)
{
throw new ArgumentNullException("rgbHash");
}
if (rgbSignature == null)
{
throw new ArgumentNullException("rgbSignature");
}
return PKCS1.Verify_v15(this.rsa, HashAlgorithm.Create(this.hashName), rgbHash, rgbSignature);
}
// Token: 0x040013A3 RID: 5027
private RSA rsa;
// Token: 0x040013A4 RID: 5028
private string hashName;
}
}
@@ -0,0 +1,82 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Creates an <see cref="T:System.Security.Cryptography.RSA" /> PKCS #1 version 1.5 signature.</summary>
// Token: 0x02000522 RID: 1314
[ComVisible(true)]
public class RSAPKCS1SignatureFormatter : AsymmetricSignatureFormatter
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAPKCS1SignatureFormatter" /> class.</summary>
// Token: 0x06003056 RID: 12374 RVA: 0x0009E044 File Offset: 0x0009C244
public RSAPKCS1SignatureFormatter()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.RSAPKCS1SignatureFormatter" /> class with the specified key.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the private key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x06003057 RID: 12375 RVA: 0x0009E04C File Offset: 0x0009C24C
public RSAPKCS1SignatureFormatter(AsymmetricAlgorithm key)
{
this.SetKey(key);
}
/// <summary>Creates the <see cref="T:System.Security.Cryptography.RSA" /> PKCS #1 signature for the specified data.</summary>
/// <returns>The digital signature for <paramref name="rgbHash" />.</returns>
/// <param name="rgbHash">The data to be signed. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The key is null.-or- The hash algorithm is null. </exception>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbHash" /> parameter is null. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003058 RID: 12376 RVA: 0x0009E05C File Offset: 0x0009C25C
public override byte[] CreateSignature(byte[] rgbHash)
{
if (this.rsa == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("No key pair available."));
}
if (this.hash == null)
{
throw new CryptographicUnexpectedOperationException(Locale.GetText("Missing hash algorithm."));
}
if (rgbHash == null)
{
throw new ArgumentNullException("rgbHash");
}
return PKCS1.Sign_v15(this.rsa, this.hash, rgbHash);
}
/// <summary>Sets the hash algorithm to use for creating the signature.</summary>
/// <param name="strName">The name of the hash algorithm to use for creating the signature. </param>
// Token: 0x06003059 RID: 12377 RVA: 0x0009E0C4 File Offset: 0x0009C2C4
public override void SetHashAlgorithm(string strName)
{
this.hash = HashAlgorithm.Create(strName);
}
/// <summary>Sets the private key to use for creating the signature.</summary>
/// <param name="key">The instance of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm that holds the private key. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x0600305A RID: 12378 RVA: 0x0009E0D4 File Offset: 0x0009C2D4
public override void SetKey(AsymmetricAlgorithm key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.rsa = (RSA)key;
}
// Token: 0x040013A5 RID: 5029
private RSA rsa;
// Token: 0x040013A6 RID: 5030
private HashAlgorithm hash;
}
}
@@ -0,0 +1,50 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the standard parameters for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x02000523 RID: 1315
[ComVisible(true)]
[Serializable]
public struct RSAParameters
{
/// <summary>Represents the P parameter for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x040013A7 RID: 5031
[NonSerialized]
public byte[] P;
/// <summary>Represents the Q parameter for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x040013A8 RID: 5032
[NonSerialized]
public byte[] Q;
/// <summary>Represents the D parameter for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x040013A9 RID: 5033
[NonSerialized]
public byte[] D;
/// <summary>Represents the DP parameter for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x040013AA RID: 5034
[NonSerialized]
public byte[] DP;
/// <summary>Represents the DQ parameter for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x040013AB RID: 5035
[NonSerialized]
public byte[] DQ;
/// <summary>Represents the InverseQ parameter for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x040013AC RID: 5036
[NonSerialized]
public byte[] InverseQ;
/// <summary>Represents the Modulus parameter for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x040013AD RID: 5037
public byte[] Modulus;
/// <summary>Represents the Exponent parameter for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.</summary>
// Token: 0x040013AE RID: 5038
public byte[] Exponent;
}
}
@@ -0,0 +1,39 @@
using System;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract class from which all implementations of cryptographic random number generators derive.</summary>
// Token: 0x02000524 RID: 1316
public abstract class RandomNumberGenerator
{
/// <summary>Creates an instance of the default implementation of a cryptographic random number generator that can be used to generate random data.</summary>
/// <returns>A new instance of a cryptographic random number generator.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x0600305C RID: 12380 RVA: 0x0009E0FC File Offset: 0x0009C2FC
public static RandomNumberGenerator Create()
{
return RandomNumberGenerator.Create("System.Security.Cryptography.RandomNumberGenerator");
}
/// <summary>Creates an instance of the specified implementation of a cryptographic random number generator.</summary>
/// <returns>A new instance of a cryptographic random number generator.</returns>
/// <param name="rngName">The name of the random number generator implementation to use. </param>
// Token: 0x0600305D RID: 12381 RVA: 0x0009E108 File Offset: 0x0009C308
public static RandomNumberGenerator Create(string rngName)
{
return (RandomNumberGenerator)CryptoConfig.CreateFromName(rngName);
}
/// <summary>When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of values.</summary>
/// <param name="data">The array to fill with cryptographically strong random bytes. </param>
// Token: 0x0600305E RID: 12382
public abstract void GetBytes(byte[] data);
/// <summary>When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of nonzero values.</summary>
/// <param name="data">The array to fill with cryptographically strong random nonzero bytes. </param>
// Token: 0x0600305F RID: 12383
public abstract void GetNonZeroBytes(byte[] data);
}
}
@@ -0,0 +1,239 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Implements password-based key derivation functionality, PBKDF2, by using a pseudo-random number generator based on <see cref="T:System.Security.Cryptography.HMACSHA1" />.</summary>
// Token: 0x02000525 RID: 1317
[ComVisible(true)]
public class Rfc2898DeriveBytes : DeriveBytes
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Rfc2898DeriveBytes" /> class using a password and salt to derive the key.</summary>
/// <param name="password">The password used to derive the key. </param>
/// <param name="salt">The key salt used to derive the key. </param>
/// <exception cref="T:System.ArgumentException">The specified salt size is smaller than 8 bytes or the iteration count is less than 1. </exception>
/// <exception cref="T:System.ArgumentNullException">The password or salt is null. </exception>
// Token: 0x06003060 RID: 12384 RVA: 0x0009E118 File Offset: 0x0009C318
public Rfc2898DeriveBytes(string password, byte[] salt)
: this(password, salt, 1000)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Rfc2898DeriveBytes" /> class using a password, a salt, and number of iterations to derive the key.</summary>
/// <param name="password">The password used to derive the key. </param>
/// <param name="salt">The key salt used to derive the key. </param>
/// <param name="iterations">The number of iterations for the operation. </param>
/// <exception cref="T:System.ArgumentException">The specified salt size is smaller than 8 bytes or the iteration count is less than 1. </exception>
/// <exception cref="T:System.ArgumentNullException">The password or salt is null. </exception>
// Token: 0x06003061 RID: 12385 RVA: 0x0009E128 File Offset: 0x0009C328
public Rfc2898DeriveBytes(string password, byte[] salt, int iterations)
{
if (password == null)
{
throw new ArgumentNullException("password");
}
this.Salt = salt;
this.IterationCount = iterations;
this._hmac = new HMACSHA1(Encoding.UTF8.GetBytes(password));
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Rfc2898DeriveBytes" /> class using a password, a salt, and number of iterations to derive the key.</summary>
/// <param name="password">The password used to derive the key. </param>
/// <param name="salt">The key salt used to derive the key.</param>
/// <param name="iterations">The number of iterations for the operation. </param>
/// <exception cref="T:System.ArgumentException">The specified salt size is smaller than 8 bytes or the iteration count is less than 1. </exception>
/// <exception cref="T:System.ArgumentNullException">The password or salt is null. </exception>
// Token: 0x06003062 RID: 12386 RVA: 0x0009E170 File Offset: 0x0009C370
public Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations)
{
if (password == null)
{
throw new ArgumentNullException("password");
}
this.Salt = salt;
this.IterationCount = iterations;
this._hmac = new HMACSHA1(password);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Rfc2898DeriveBytes" /> class using the password and salt size to derive the key.</summary>
/// <param name="password">The password used to derive the key. </param>
/// <param name="saltSize">The size of the random salt that you want the class to generate. </param>
/// <exception cref="T:System.ArgumentException">The specified salt size is smaller than 8 bytes. </exception>
/// <exception cref="T:System.ArgumentNullException">The password or salt is null. </exception>
// Token: 0x06003063 RID: 12387 RVA: 0x0009E1B0 File Offset: 0x0009C3B0
public Rfc2898DeriveBytes(string password, int saltSize)
: this(password, saltSize, 1000)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Rfc2898DeriveBytes" /> class using a password, a salt size, and number of iterations to derive the key.</summary>
/// <param name="password">The password used to derive the key. </param>
/// <param name="saltSize">The size of the random salt that you want the class to generate. </param>
/// <param name="iterations">The number of iterations for the operation. </param>
/// <exception cref="T:System.ArgumentException">The specified salt size is smaller than 8 bytes or the iteration count is less than 1. </exception>
/// <exception cref="T:System.ArgumentNullException">The password or salt is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="iterations " />is out of range. This parameter requires a non-negative number.</exception>
// Token: 0x06003064 RID: 12388 RVA: 0x0009E1C0 File Offset: 0x0009C3C0
public Rfc2898DeriveBytes(string password, int saltSize, int iterations)
{
if (password == null)
{
throw new ArgumentNullException("password");
}
if (saltSize < 0)
{
throw new ArgumentOutOfRangeException("invalid salt length");
}
this.Salt = KeyBuilder.Key(saltSize);
this.IterationCount = iterations;
this._hmac = new HMACSHA1(Encoding.UTF8.GetBytes(password));
}
/// <summary>Gets or sets the number of iterations for the operation.</summary>
/// <returns>The number of iterations for the operation.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The number of iterations is less than 1. </exception>
// Token: 0x17000984 RID: 2436
// (get) Token: 0x06003065 RID: 12389 RVA: 0x0009E220 File Offset: 0x0009C420
// (set) Token: 0x06003066 RID: 12390 RVA: 0x0009E228 File Offset: 0x0009C428
public int IterationCount
{
get
{
return this._iteration;
}
set
{
if (value < 1)
{
throw new ArgumentOutOfRangeException("IterationCount < 1");
}
this._iteration = value;
}
}
/// <summary>Gets or sets the key salt value for the operation.</summary>
/// <returns>The key salt value for the operation.</returns>
/// <exception cref="T:System.ArgumentException">The specified salt size is smaller than 8 bytes. </exception>
/// <exception cref="T:System.ArgumentNullException">The salt is null. </exception>
// Token: 0x17000985 RID: 2437
// (get) Token: 0x06003067 RID: 12391 RVA: 0x0009E244 File Offset: 0x0009C444
// (set) Token: 0x06003068 RID: 12392 RVA: 0x0009E258 File Offset: 0x0009C458
public byte[] Salt
{
get
{
return (byte[])this._salt.Clone();
}
set
{
if (value == null)
{
throw new ArgumentNullException("Salt");
}
if (value.Length < 8)
{
throw new ArgumentException("Salt < 8 bytes");
}
this._salt = (byte[])value.Clone();
}
}
// Token: 0x06003069 RID: 12393 RVA: 0x0009E29C File Offset: 0x0009C49C
private byte[] F(byte[] s, int c, int i)
{
s[s.Length - 4] = (byte)(i >> 24);
s[s.Length - 3] = (byte)(i >> 16);
s[s.Length - 2] = (byte)(i >> 8);
s[s.Length - 1] = (byte)i;
byte[] array = this._hmac.ComputeHash(s);
byte[] array2 = array;
for (int j = 1; j < c; j++)
{
byte[] array3 = this._hmac.ComputeHash(array2);
for (int k = 0; k < 20; k++)
{
array[k] ^= array3[k];
}
array2 = array3;
}
return array;
}
/// <summary>Returns the pseudo-random key for this object.</summary>
/// <returns>A byte array filled with pseudo-random key bytes.</returns>
/// <param name="cb">The number of pseudo-random key bytes to generate. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="cb " />is out of range. This parameter requires a non-negative number.</exception>
// Token: 0x0600306A RID: 12394 RVA: 0x0009E32C File Offset: 0x0009C52C
public override byte[] GetBytes(int cb)
{
if (cb < 1)
{
throw new ArgumentOutOfRangeException("cb");
}
int num = cb / 20;
int num2 = cb % 20;
if (num2 != 0)
{
num++;
}
byte[] array = new byte[cb];
int num3 = 0;
if (this._pos > 0)
{
int num4 = Math.Min(20 - this._pos, cb);
Buffer.BlockCopy(this._buffer, this._pos, array, 0, num4);
if (num4 >= cb)
{
return array;
}
this._pos = 0;
num3 = num4;
}
byte[] array2 = new byte[this._salt.Length + 4];
Buffer.BlockCopy(this._salt, 0, array2, 0, this._salt.Length);
for (int i = 1; i <= num; i++)
{
this._buffer = this.F(array2, this._iteration, ++this._f);
int num5 = ((i != num) ? 20 : (array.Length - num3));
Buffer.BlockCopy(this._buffer, this._pos, array, num3, num5);
num3 += this._pos + num5;
this._pos = ((num5 != 20) ? num5 : 0);
}
return array;
}
/// <summary>Resets the state of the operation.</summary>
// Token: 0x0600306B RID: 12395 RVA: 0x0009E464 File Offset: 0x0009C664
public override void Reset()
{
this._buffer = null;
this._pos = 0;
this._f = 0;
}
// Token: 0x040013AF RID: 5039
private const int defaultIterations = 1000;
// Token: 0x040013B0 RID: 5040
private int _iteration;
// Token: 0x040013B1 RID: 5041
private byte[] _salt;
// Token: 0x040013B2 RID: 5042
private HMACSHA1 _hmac;
// Token: 0x040013B3 RID: 5043
private byte[] _buffer;
// Token: 0x040013B4 RID: 5044
private int _pos;
// Token: 0x040013B5 RID: 5045
private int _f;
}
}
@@ -0,0 +1,46 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class from which all implementations of the <see cref="T:System.Security.Cryptography.Rijndael" /> symmetric encryption algorithm must inherit.</summary>
// Token: 0x02000526 RID: 1318
[ComVisible(true)]
public abstract class Rijndael : SymmetricAlgorithm
{
/// <summary>Initializes a new instance of <see cref="T:System.Security.Cryptography.Rijndael" />.</summary>
// Token: 0x0600306C RID: 12396 RVA: 0x0009E47C File Offset: 0x0009C67C
protected Rijndael()
{
this.KeySizeValue = 256;
this.BlockSizeValue = 128;
this.FeedbackSizeValue = 128;
this.LegalKeySizesValue = new KeySizes[1];
this.LegalKeySizesValue[0] = new KeySizes(128, 256, 64);
this.LegalBlockSizesValue = new KeySizes[1];
this.LegalBlockSizesValue[0] = new KeySizes(128, 256, 64);
}
/// <summary>Creates a cryptographic object to perform the <see cref="T:System.Security.Cryptography.Rijndael" /> algorithm.</summary>
/// <returns>A cryptographic object.</returns>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x0600306D RID: 12397 RVA: 0x0009E4FC File Offset: 0x0009C6FC
public new static Rijndael Create()
{
return Rijndael.Create("System.Security.Cryptography.Rijndael");
}
/// <summary>Creates a cryptographic object to perform the specified implementation of the <see cref="T:System.Security.Cryptography.Rijndael" /> algorithm.</summary>
/// <returns>A cryptographic object.</returns>
/// <param name="algName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.Rijndael" /> to create. </param>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="algName" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
// Token: 0x0600306E RID: 12398 RVA: 0x0009E508 File Offset: 0x0009C708
public new static Rijndael Create(string algName)
{
return (Rijndael)CryptoConfig.CreateFromName(algName);
}
}
}
@@ -0,0 +1,50 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Accesses the managed version of the <see cref="T:System.Security.Cryptography.Rijndael" /> algorithm. This class cannot be inherited.</summary>
// Token: 0x02000527 RID: 1319
[ComVisible(true)]
public sealed class RijndaelManaged : Rijndael
{
/// <summary>Generates a random initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />) to be used for the algorithm.</summary>
// Token: 0x06003070 RID: 12400 RVA: 0x0009E520 File Offset: 0x0009C720
public override void GenerateIV()
{
this.IVValue = KeyBuilder.IV(this.BlockSizeValue >> 3);
}
/// <summary>Generates a random <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" /> to be used for the algorithm.</summary>
// Token: 0x06003071 RID: 12401 RVA: 0x0009E538 File Offset: 0x0009C738
public override void GenerateKey()
{
this.KeyValue = KeyBuilder.Key(this.KeySizeValue >> 3);
}
/// <summary>Creates a symmetric <see cref="T:System.Security.Cryptography.Rijndael" /> decryptor object with the specified <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" /> and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric <see cref="T:System.Security.Cryptography.Rijndael" /> decryptor object.</returns>
/// <param name="rgbKey">The secret key to be used for the symmetric algorithm. The key size must be 128, 192, or 256 bits.</param>
/// <param name="rgbIV">The IV to be used for the symmetric algorithm. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbKey" /> parameter is null.-or-The <paramref name="rgbIV" /> parameter is null.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> parameter is not <see cref="F:System.Security.Cryptography.CipherMode.ECB" />, <see cref="F:System.Security.Cryptography.CipherMode.CBC" />, or <see cref="F:System.Security.Cryptography.CipherMode.CFB" />.</exception>
// Token: 0x06003072 RID: 12402 RVA: 0x0009E550 File Offset: 0x0009C750
public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
{
return new RijndaelManagedTransform(this, false, rgbKey, rgbIV);
}
/// <summary>Creates a symmetric <see cref="T:System.Security.Cryptography.Rijndael" /> encryptor object with the specified <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" /> and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric <see cref="T:System.Security.Cryptography.Rijndael" /> encryptor object.</returns>
/// <param name="rgbKey">The secret key to be used for the symmetric algorithm. The key size must be 128, 192, or 256 bits.</param>
/// <param name="rgbIV">The IV to be used for the symmetric algorithm. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="rgbKey" /> parameter is null.-or-The <paramref name="rgbIV" /> parameter is null.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> parameter is not <see cref="F:System.Security.Cryptography.CipherMode.ECB" />, <see cref="F:System.Security.Cryptography.CipherMode.CBC" />, or <see cref="F:System.Security.Cryptography.CipherMode.CFB" />.</exception>
// Token: 0x06003073 RID: 12403 RVA: 0x0009E55C File Offset: 0x0009C75C
public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
{
return new RijndaelManagedTransform(this, true, rgbKey, rgbIV);
}
}
}
@@ -0,0 +1,136 @@
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;
}
}
@@ -0,0 +1,1186 @@
using System;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
// Token: 0x02000528 RID: 1320
internal class RijndaelTransform : SymmetricTransform
{
// Token: 0x06003074 RID: 12404 RVA: 0x0009E568 File Offset: 0x0009C768
public RijndaelTransform(Rijndael algo, bool encryption, byte[] key, byte[] iv)
: base(algo, encryption, iv)
{
if (key == null)
{
throw new CryptographicException("key is null");
}
if (iv != null && iv.Length != algo.BlockSize >> 3)
{
string text = Locale.GetText("IV length is invalid ({0} bytes), it should be {1} bytes long.", new object[]
{
iv.Length,
algo.BlockSize >> 3
});
throw new CryptographicException(text);
}
int num = key.Length;
if (num != 16 && num != 24 && num != 32)
{
string text2 = Locale.GetText("Key is too small ({0} bytes), it should be {1}, {2} or {3} bytes long.", new object[] { num, 16, 24, 32 });
throw new CryptographicException(text2);
}
num <<= 3;
int blockSize = algo.BlockSize;
this.Nb = blockSize >> 5;
this.Nk = num >> 5;
if (this.Nb == 8 || this.Nk == 8)
{
this.Nr = 14;
}
else if (this.Nb == 6 || this.Nk == 6)
{
this.Nr = 12;
}
else
{
this.Nr = 10;
}
int num2 = this.Nb * (this.Nr + 1);
uint[] array = new uint[num2];
int num3 = 0;
for (int i = 0; i < this.Nk; i++)
{
uint num4 = (uint)((uint)key[num3++] << 24);
num4 |= (uint)((uint)key[num3++] << 16);
num4 |= (uint)((uint)key[num3++] << 8);
num4 |= (uint)key[num3++];
array[i] = num4;
}
for (int j = this.Nk; j < num2; j++)
{
uint num5 = array[j - 1];
if (j % this.Nk == 0)
{
uint num6 = (num5 << 8) | ((num5 >> 24) & 255U);
num5 = this.SubByte(num6) ^ RijndaelTransform.Rcon[j / this.Nk];
}
else if (this.Nk > 6 && j % this.Nk == 4)
{
num5 = this.SubByte(num5);
}
array[j] = array[j - this.Nk] ^ num5;
}
if (!encryption && (algo.Mode == CipherMode.ECB || algo.Mode == CipherMode.CBC))
{
int k = 0;
int num7 = num2 - this.Nb;
while (k < num7)
{
for (int l = 0; l < this.Nb; l++)
{
uint num8 = array[k + l];
array[k + l] = array[num7 + l];
array[num7 + l] = num8;
}
k += this.Nb;
num7 -= this.Nb;
}
for (int m = this.Nb; m < array.Length - this.Nb; m++)
{
array[m] = RijndaelTransform.iT0[(int)RijndaelTransform.SBox[(int)((UIntPtr)(array[m] >> 24))]] ^ RijndaelTransform.iT1[(int)RijndaelTransform.SBox[(int)((byte)(array[m] >> 16))]] ^ RijndaelTransform.iT2[(int)RijndaelTransform.SBox[(int)((byte)(array[m] >> 8))]] ^ RijndaelTransform.iT3[(int)RijndaelTransform.SBox[(int)((byte)array[m])]];
}
}
this.expandedKey = array;
}
// Token: 0x06003076 RID: 12406 RVA: 0x0009E9FC File Offset: 0x0009CBFC
public void Clear()
{
this.Dispose(true);
}
// Token: 0x06003077 RID: 12407 RVA: 0x0009EA08 File Offset: 0x0009CC08
protected override void ECB(byte[] input, byte[] output)
{
if (this.encrypt)
{
switch (this.Nb)
{
case 4:
this.Encrypt128(input, output, this.expandedKey);
return;
case 6:
this.Encrypt192(input, output, this.expandedKey);
return;
case 8:
this.Encrypt256(input, output, this.expandedKey);
return;
}
}
else
{
switch (this.Nb)
{
case 4:
this.Decrypt128(input, output, this.expandedKey);
return;
case 6:
this.Decrypt192(input, output, this.expandedKey);
return;
case 8:
this.Decrypt256(input, output, this.expandedKey);
return;
}
}
}
// Token: 0x06003078 RID: 12408 RVA: 0x0009EAD0 File Offset: 0x0009CCD0
private uint SubByte(uint a)
{
uint num = 255U & a;
uint num2 = (uint)RijndaelTransform.SBox[(int)((UIntPtr)num)];
num = 255U & (a >> 8);
num2 |= (uint)((uint)RijndaelTransform.SBox[(int)((UIntPtr)num)] << 8);
num = 255U & (a >> 16);
num2 |= (uint)((uint)RijndaelTransform.SBox[(int)((UIntPtr)num)] << 16);
num = 255U & (a >> 24);
return num2 | (uint)((uint)RijndaelTransform.SBox[(int)((UIntPtr)num)] << 24);
}
// Token: 0x06003079 RID: 12409 RVA: 0x0009EB38 File Offset: 0x0009CD38
private void Encrypt128(byte[] indata, byte[] outdata, uint[] ekey)
{
int num = 40;
uint num2 = (uint)((((int)indata[0] << 24) | ((int)indata[1] << 16) | ((int)indata[2] << 8) | (int)indata[3]) ^ (int)ekey[0]);
uint num3 = (uint)((((int)indata[4] << 24) | ((int)indata[5] << 16) | ((int)indata[6] << 8) | (int)indata[7]) ^ (int)ekey[1]);
uint num4 = (uint)((((int)indata[8] << 24) | ((int)indata[9] << 16) | ((int)indata[10] << 8) | (int)indata[11]) ^ (int)ekey[2]);
uint num5 = (uint)((((int)indata[12] << 24) | ((int)indata[13] << 16) | ((int)indata[14] << 8) | (int)indata[15]) ^ (int)ekey[3]);
uint num6 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[4];
uint num7 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[5];
uint num8 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[6];
uint num9 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[7];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[8];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[9];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[10];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[11];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[12];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[13];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[14];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[15];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[16];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[17];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[18];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[19];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[20];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[21];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[22];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[23];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[24];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[25];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[26];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[27];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[28];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[29];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[30];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[31];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[32];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[33];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[34];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[35];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[36];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[37];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[38];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[39];
if (this.Nr > 10)
{
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[40];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[41];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[42];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[43];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[44];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[45];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[46];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[47];
num = 48;
if (this.Nr > 12)
{
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[48];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[49];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[50];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[51];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[52];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[53];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[54];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[55];
num = 56;
}
}
outdata[0] = RijndaelTransform.SBox[(int)((UIntPtr)(num6 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[1] = RijndaelTransform.SBox[(int)((byte)(num7 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[2] = RijndaelTransform.SBox[(int)((byte)(num8 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[3] = RijndaelTransform.SBox[(int)((byte)num9)] ^ (byte)ekey[num++];
outdata[4] = RijndaelTransform.SBox[(int)((UIntPtr)(num7 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[5] = RijndaelTransform.SBox[(int)((byte)(num8 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[6] = RijndaelTransform.SBox[(int)((byte)(num9 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[7] = RijndaelTransform.SBox[(int)((byte)num6)] ^ (byte)ekey[num++];
outdata[8] = RijndaelTransform.SBox[(int)((UIntPtr)(num8 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[9] = RijndaelTransform.SBox[(int)((byte)(num9 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[10] = RijndaelTransform.SBox[(int)((byte)(num6 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[11] = RijndaelTransform.SBox[(int)((byte)num7)] ^ (byte)ekey[num++];
outdata[12] = RijndaelTransform.SBox[(int)((UIntPtr)(num9 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[13] = RijndaelTransform.SBox[(int)((byte)(num6 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[14] = RijndaelTransform.SBox[(int)((byte)(num7 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[15] = RijndaelTransform.SBox[(int)((byte)num8)] ^ (byte)ekey[num++];
}
// Token: 0x0600307A RID: 12410 RVA: 0x0009F7D8 File Offset: 0x0009D9D8
private void Encrypt192(byte[] indata, byte[] outdata, uint[] ekey)
{
int num = 72;
uint num2 = (uint)((((int)indata[0] << 24) | ((int)indata[1] << 16) | ((int)indata[2] << 8) | (int)indata[3]) ^ (int)ekey[0]);
uint num3 = (uint)((((int)indata[4] << 24) | ((int)indata[5] << 16) | ((int)indata[6] << 8) | (int)indata[7]) ^ (int)ekey[1]);
uint num4 = (uint)((((int)indata[8] << 24) | ((int)indata[9] << 16) | ((int)indata[10] << 8) | (int)indata[11]) ^ (int)ekey[2]);
uint num5 = (uint)((((int)indata[12] << 24) | ((int)indata[13] << 16) | ((int)indata[14] << 8) | (int)indata[15]) ^ (int)ekey[3]);
uint num6 = (uint)((((int)indata[16] << 24) | ((int)indata[17] << 16) | ((int)indata[18] << 8) | (int)indata[19]) ^ (int)ekey[4]);
uint num7 = (uint)((((int)indata[20] << 24) | ((int)indata[21] << 16) | ((int)indata[22] << 8) | (int)indata[23]) ^ (int)ekey[5]);
uint num8 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[6];
uint num9 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[7];
uint num10 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[8];
uint num11 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[9];
uint num12 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[10];
uint num13 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[11];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[12];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[13];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[14];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[15];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[16];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[17];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[18];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[19];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[20];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[21];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[22];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[23];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[24];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[25];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[26];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[27];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[28];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[29];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[30];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[31];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[32];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[33];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[34];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[35];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[36];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[37];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[38];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[39];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[40];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[41];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[42];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[43];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[44];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[45];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[46];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[47];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[48];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[49];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[50];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[51];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[52];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[53];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[54];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[55];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[56];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[57];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[58];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[59];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[60];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[61];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[62];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[63];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[64];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[65];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[66];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[67];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[68];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[69];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[70];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[71];
if (this.Nr > 12)
{
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[72];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[73];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[74];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[75];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[76];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[77];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[78];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[79];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[80];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[81];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[82];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[83];
num = 84;
}
outdata[0] = RijndaelTransform.SBox[(int)((UIntPtr)(num8 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[1] = RijndaelTransform.SBox[(int)((byte)(num9 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[2] = RijndaelTransform.SBox[(int)((byte)(num10 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[3] = RijndaelTransform.SBox[(int)((byte)num11)] ^ (byte)ekey[num++];
outdata[4] = RijndaelTransform.SBox[(int)((UIntPtr)(num9 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[5] = RijndaelTransform.SBox[(int)((byte)(num10 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[6] = RijndaelTransform.SBox[(int)((byte)(num11 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[7] = RijndaelTransform.SBox[(int)((byte)num12)] ^ (byte)ekey[num++];
outdata[8] = RijndaelTransform.SBox[(int)((UIntPtr)(num10 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[9] = RijndaelTransform.SBox[(int)((byte)(num11 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[10] = RijndaelTransform.SBox[(int)((byte)(num12 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[11] = RijndaelTransform.SBox[(int)((byte)num13)] ^ (byte)ekey[num++];
outdata[12] = RijndaelTransform.SBox[(int)((UIntPtr)(num11 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[13] = RijndaelTransform.SBox[(int)((byte)(num12 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[14] = RijndaelTransform.SBox[(int)((byte)(num13 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[15] = RijndaelTransform.SBox[(int)((byte)num8)] ^ (byte)ekey[num++];
outdata[16] = RijndaelTransform.SBox[(int)((UIntPtr)(num12 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[17] = RijndaelTransform.SBox[(int)((byte)(num13 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[18] = RijndaelTransform.SBox[(int)((byte)(num8 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[19] = RijndaelTransform.SBox[(int)((byte)num9)] ^ (byte)ekey[num++];
outdata[20] = RijndaelTransform.SBox[(int)((UIntPtr)(num13 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[21] = RijndaelTransform.SBox[(int)((byte)(num8 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[22] = RijndaelTransform.SBox[(int)((byte)(num9 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[23] = RijndaelTransform.SBox[(int)((byte)num10)] ^ (byte)ekey[num++];
}
// Token: 0x0600307B RID: 12411 RVA: 0x000A0AF4 File Offset: 0x0009ECF4
private void Encrypt256(byte[] indata, byte[] outdata, uint[] ekey)
{
uint num = (uint)((((int)indata[0] << 24) | ((int)indata[1] << 16) | ((int)indata[2] << 8) | (int)indata[3]) ^ (int)ekey[0]);
uint num2 = (uint)((((int)indata[4] << 24) | ((int)indata[5] << 16) | ((int)indata[6] << 8) | (int)indata[7]) ^ (int)ekey[1]);
uint num3 = (uint)((((int)indata[8] << 24) | ((int)indata[9] << 16) | ((int)indata[10] << 8) | (int)indata[11]) ^ (int)ekey[2]);
uint num4 = (uint)((((int)indata[12] << 24) | ((int)indata[13] << 16) | ((int)indata[14] << 8) | (int)indata[15]) ^ (int)ekey[3]);
uint num5 = (uint)((((int)indata[16] << 24) | ((int)indata[17] << 16) | ((int)indata[18] << 8) | (int)indata[19]) ^ (int)ekey[4]);
uint num6 = (uint)((((int)indata[20] << 24) | ((int)indata[21] << 16) | ((int)indata[22] << 8) | (int)indata[23]) ^ (int)ekey[5]);
uint num7 = (uint)((((int)indata[24] << 24) | ((int)indata[25] << 16) | ((int)indata[26] << 8) | (int)indata[27]) ^ (int)ekey[6]);
uint num8 = (uint)((((int)indata[28] << 24) | ((int)indata[29] << 16) | ((int)indata[30] << 8) | (int)indata[31]) ^ (int)ekey[7]);
uint num9 = RijndaelTransform.T0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[8];
uint num10 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[9];
uint num11 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[10];
uint num12 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[11];
uint num13 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num)] ^ ekey[12];
uint num14 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[13];
uint num15 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[14];
uint num16 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[15];
num = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[16];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num14)] ^ ekey[17];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num15)] ^ ekey[18];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num16)] ^ ekey[19];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[20];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[21];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[22];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[23];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[24];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[25];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[26];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[27];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num)] ^ ekey[28];
num14 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[29];
num15 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[30];
num16 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[31];
num = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[32];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num14)] ^ ekey[33];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num15)] ^ ekey[34];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num16)] ^ ekey[35];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[36];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[37];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[38];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[39];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[40];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[41];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[42];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[43];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num)] ^ ekey[44];
num14 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[45];
num15 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[46];
num16 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[47];
num = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[48];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num14)] ^ ekey[49];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num15)] ^ ekey[50];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num16)] ^ ekey[51];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[52];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[53];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[54];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[55];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[56];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[57];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[58];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[59];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num)] ^ ekey[60];
num14 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[61];
num15 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[62];
num16 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[63];
num = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[64];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num14)] ^ ekey[65];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num15)] ^ ekey[66];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num16)] ^ ekey[67];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[68];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[69];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[70];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[71];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[72];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[73];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[74];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[75];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num)] ^ ekey[76];
num14 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[77];
num15 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[78];
num16 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[79];
num = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[80];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num14)] ^ ekey[81];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num15)] ^ ekey[82];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num16)] ^ ekey[83];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[84];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[85];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[86];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[87];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[88];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[89];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[90];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[91];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num)] ^ ekey[92];
num14 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[93];
num15 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[94];
num16 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[95];
num = RijndaelTransform.T0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num13)] ^ ekey[96];
num2 = RijndaelTransform.T0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num14)] ^ ekey[97];
num3 = RijndaelTransform.T0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num15)] ^ ekey[98];
num4 = RijndaelTransform.T0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num16)] ^ ekey[99];
num5 = RijndaelTransform.T0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num9)] ^ ekey[100];
num6 = RijndaelTransform.T0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num10)] ^ ekey[101];
num7 = RijndaelTransform.T0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num11)] ^ ekey[102];
num8 = RijndaelTransform.T0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num12)] ^ ekey[103];
num9 = RijndaelTransform.T0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num5)] ^ ekey[104];
num10 = RijndaelTransform.T0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num6)] ^ ekey[105];
num11 = RijndaelTransform.T0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num7)] ^ ekey[106];
num12 = RijndaelTransform.T0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num8)] ^ ekey[107];
num13 = RijndaelTransform.T0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num)] ^ ekey[108];
num14 = RijndaelTransform.T0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num >> 8))] ^ RijndaelTransform.T3[(int)((byte)num2)] ^ ekey[109];
num15 = RijndaelTransform.T0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num3)] ^ ekey[110];
num16 = RijndaelTransform.T0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.T1[(int)((byte)(num >> 16))] ^ RijndaelTransform.T2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.T3[(int)((byte)num4)] ^ ekey[111];
outdata[0] = RijndaelTransform.SBox[(int)((UIntPtr)(num9 >> 24))] ^ (byte)(ekey[112] >> 24);
outdata[1] = RijndaelTransform.SBox[(int)((byte)(num10 >> 16))] ^ (byte)(ekey[112] >> 16);
outdata[2] = RijndaelTransform.SBox[(int)((byte)(num12 >> 8))] ^ (byte)(ekey[112] >> 8);
outdata[3] = RijndaelTransform.SBox[(int)((byte)num13)] ^ (byte)ekey[112];
outdata[4] = RijndaelTransform.SBox[(int)((UIntPtr)(num10 >> 24))] ^ (byte)(ekey[113] >> 24);
outdata[5] = RijndaelTransform.SBox[(int)((byte)(num11 >> 16))] ^ (byte)(ekey[113] >> 16);
outdata[6] = RijndaelTransform.SBox[(int)((byte)(num13 >> 8))] ^ (byte)(ekey[113] >> 8);
outdata[7] = RijndaelTransform.SBox[(int)((byte)num14)] ^ (byte)ekey[113];
outdata[8] = RijndaelTransform.SBox[(int)((UIntPtr)(num11 >> 24))] ^ (byte)(ekey[114] >> 24);
outdata[9] = RijndaelTransform.SBox[(int)((byte)(num12 >> 16))] ^ (byte)(ekey[114] >> 16);
outdata[10] = RijndaelTransform.SBox[(int)((byte)(num14 >> 8))] ^ (byte)(ekey[114] >> 8);
outdata[11] = RijndaelTransform.SBox[(int)((byte)num15)] ^ (byte)ekey[114];
outdata[12] = RijndaelTransform.SBox[(int)((UIntPtr)(num12 >> 24))] ^ (byte)(ekey[115] >> 24);
outdata[13] = RijndaelTransform.SBox[(int)((byte)(num13 >> 16))] ^ (byte)(ekey[115] >> 16);
outdata[14] = RijndaelTransform.SBox[(int)((byte)(num15 >> 8))] ^ (byte)(ekey[115] >> 8);
outdata[15] = RijndaelTransform.SBox[(int)((byte)num16)] ^ (byte)ekey[115];
outdata[16] = RijndaelTransform.SBox[(int)((UIntPtr)(num13 >> 24))] ^ (byte)(ekey[116] >> 24);
outdata[17] = RijndaelTransform.SBox[(int)((byte)(num14 >> 16))] ^ (byte)(ekey[116] >> 16);
outdata[18] = RijndaelTransform.SBox[(int)((byte)(num16 >> 8))] ^ (byte)(ekey[116] >> 8);
outdata[19] = RijndaelTransform.SBox[(int)((byte)num9)] ^ (byte)ekey[116];
outdata[20] = RijndaelTransform.SBox[(int)((UIntPtr)(num14 >> 24))] ^ (byte)(ekey[117] >> 24);
outdata[21] = RijndaelTransform.SBox[(int)((byte)(num15 >> 16))] ^ (byte)(ekey[117] >> 16);
outdata[22] = RijndaelTransform.SBox[(int)((byte)(num9 >> 8))] ^ (byte)(ekey[117] >> 8);
outdata[23] = RijndaelTransform.SBox[(int)((byte)num10)] ^ (byte)ekey[117];
outdata[24] = RijndaelTransform.SBox[(int)((UIntPtr)(num15 >> 24))] ^ (byte)(ekey[118] >> 24);
outdata[25] = RijndaelTransform.SBox[(int)((byte)(num16 >> 16))] ^ (byte)(ekey[118] >> 16);
outdata[26] = RijndaelTransform.SBox[(int)((byte)(num10 >> 8))] ^ (byte)(ekey[118] >> 8);
outdata[27] = RijndaelTransform.SBox[(int)((byte)num11)] ^ (byte)ekey[118];
outdata[28] = RijndaelTransform.SBox[(int)((UIntPtr)(num16 >> 24))] ^ (byte)(ekey[119] >> 24);
outdata[29] = RijndaelTransform.SBox[(int)((byte)(num9 >> 16))] ^ (byte)(ekey[119] >> 16);
outdata[30] = RijndaelTransform.SBox[(int)((byte)(num11 >> 8))] ^ (byte)(ekey[119] >> 8);
outdata[31] = RijndaelTransform.SBox[(int)((byte)num12)] ^ (byte)ekey[119];
}
// Token: 0x0600307C RID: 12412 RVA: 0x000A245C File Offset: 0x000A065C
private void Decrypt128(byte[] indata, byte[] outdata, uint[] ekey)
{
int num = 40;
uint num2 = (uint)((((int)indata[0] << 24) | ((int)indata[1] << 16) | ((int)indata[2] << 8) | (int)indata[3]) ^ (int)ekey[0]);
uint num3 = (uint)((((int)indata[4] << 24) | ((int)indata[5] << 16) | ((int)indata[6] << 8) | (int)indata[7]) ^ (int)ekey[1]);
uint num4 = (uint)((((int)indata[8] << 24) | ((int)indata[9] << 16) | ((int)indata[10] << 8) | (int)indata[11]) ^ (int)ekey[2]);
uint num5 = (uint)((((int)indata[12] << 24) | ((int)indata[13] << 16) | ((int)indata[14] << 8) | (int)indata[15]) ^ (int)ekey[3]);
uint num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[4];
uint num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[5];
uint num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[6];
uint num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[7];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[8];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[9];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[10];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[11];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[12];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[13];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[14];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[15];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[16];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[17];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[18];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[19];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[20];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[21];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[22];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[23];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[24];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[25];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[26];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[27];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[28];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[29];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[30];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[31];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[32];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[33];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[34];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[35];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[36];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[37];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[38];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[39];
if (this.Nr > 10)
{
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[40];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[41];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[42];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[43];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[44];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[45];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[46];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[47];
num = 48;
if (this.Nr > 12)
{
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[48];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[49];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[50];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[51];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[52];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[53];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[54];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[55];
num = 56;
}
}
outdata[0] = RijndaelTransform.iSBox[(int)((UIntPtr)(num6 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[1] = RijndaelTransform.iSBox[(int)((byte)(num9 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[2] = RijndaelTransform.iSBox[(int)((byte)(num8 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[3] = RijndaelTransform.iSBox[(int)((byte)num7)] ^ (byte)ekey[num++];
outdata[4] = RijndaelTransform.iSBox[(int)((UIntPtr)(num7 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[5] = RijndaelTransform.iSBox[(int)((byte)(num6 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[6] = RijndaelTransform.iSBox[(int)((byte)(num9 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[7] = RijndaelTransform.iSBox[(int)((byte)num8)] ^ (byte)ekey[num++];
outdata[8] = RijndaelTransform.iSBox[(int)((UIntPtr)(num8 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[9] = RijndaelTransform.iSBox[(int)((byte)(num7 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[10] = RijndaelTransform.iSBox[(int)((byte)(num6 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[11] = RijndaelTransform.iSBox[(int)((byte)num9)] ^ (byte)ekey[num++];
outdata[12] = RijndaelTransform.iSBox[(int)((UIntPtr)(num9 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[13] = RijndaelTransform.iSBox[(int)((byte)(num8 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[14] = RijndaelTransform.iSBox[(int)((byte)(num7 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[15] = RijndaelTransform.iSBox[(int)((byte)num6)] ^ (byte)ekey[num++];
}
// Token: 0x0600307D RID: 12413 RVA: 0x000A30FC File Offset: 0x000A12FC
private void Decrypt192(byte[] indata, byte[] outdata, uint[] ekey)
{
int num = 72;
uint num2 = (uint)((((int)indata[0] << 24) | ((int)indata[1] << 16) | ((int)indata[2] << 8) | (int)indata[3]) ^ (int)ekey[0]);
uint num3 = (uint)((((int)indata[4] << 24) | ((int)indata[5] << 16) | ((int)indata[6] << 8) | (int)indata[7]) ^ (int)ekey[1]);
uint num4 = (uint)((((int)indata[8] << 24) | ((int)indata[9] << 16) | ((int)indata[10] << 8) | (int)indata[11]) ^ (int)ekey[2]);
uint num5 = (uint)((((int)indata[12] << 24) | ((int)indata[13] << 16) | ((int)indata[14] << 8) | (int)indata[15]) ^ (int)ekey[3]);
uint num6 = (uint)((((int)indata[16] << 24) | ((int)indata[17] << 16) | ((int)indata[18] << 8) | (int)indata[19]) ^ (int)ekey[4]);
uint num7 = (uint)((((int)indata[20] << 24) | ((int)indata[21] << 16) | ((int)indata[22] << 8) | (int)indata[23]) ^ (int)ekey[5]);
uint num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[6];
uint num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[7];
uint num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[8];
uint num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[9];
uint num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[10];
uint num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[11];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[12];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[13];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[14];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[15];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[16];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[17];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[18];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[19];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[20];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[21];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[22];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[23];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[24];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[25];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[26];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[27];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[28];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[29];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[30];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[31];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[32];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[33];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[34];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[35];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[36];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[37];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[38];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[39];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[40];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[41];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[42];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[43];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[44];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[45];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[46];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[47];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[48];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[49];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[50];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[51];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[52];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[53];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[54];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[55];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[56];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[57];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[58];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[59];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[60];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[61];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[62];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[63];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[64];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[65];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[66];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[67];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[68];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[69];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[70];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[71];
if (this.Nr > 12)
{
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[72];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[73];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[74];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[75];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[76];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[77];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[78];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[79];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[80];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[81];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[82];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[83];
num = 84;
}
outdata[0] = RijndaelTransform.iSBox[(int)((UIntPtr)(num8 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[1] = RijndaelTransform.iSBox[(int)((byte)(num13 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[2] = RijndaelTransform.iSBox[(int)((byte)(num12 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[3] = RijndaelTransform.iSBox[(int)((byte)num11)] ^ (byte)ekey[num++];
outdata[4] = RijndaelTransform.iSBox[(int)((UIntPtr)(num9 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[5] = RijndaelTransform.iSBox[(int)((byte)(num8 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[6] = RijndaelTransform.iSBox[(int)((byte)(num13 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[7] = RijndaelTransform.iSBox[(int)((byte)num12)] ^ (byte)ekey[num++];
outdata[8] = RijndaelTransform.iSBox[(int)((UIntPtr)(num10 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[9] = RijndaelTransform.iSBox[(int)((byte)(num9 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[10] = RijndaelTransform.iSBox[(int)((byte)(num8 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[11] = RijndaelTransform.iSBox[(int)((byte)num13)] ^ (byte)ekey[num++];
outdata[12] = RijndaelTransform.iSBox[(int)((UIntPtr)(num11 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[13] = RijndaelTransform.iSBox[(int)((byte)(num10 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[14] = RijndaelTransform.iSBox[(int)((byte)(num9 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[15] = RijndaelTransform.iSBox[(int)((byte)num8)] ^ (byte)ekey[num++];
outdata[16] = RijndaelTransform.iSBox[(int)((UIntPtr)(num12 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[17] = RijndaelTransform.iSBox[(int)((byte)(num11 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[18] = RijndaelTransform.iSBox[(int)((byte)(num10 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[19] = RijndaelTransform.iSBox[(int)((byte)num9)] ^ (byte)ekey[num++];
outdata[20] = RijndaelTransform.iSBox[(int)((UIntPtr)(num13 >> 24))] ^ (byte)(ekey[num] >> 24);
outdata[21] = RijndaelTransform.iSBox[(int)((byte)(num12 >> 16))] ^ (byte)(ekey[num] >> 16);
outdata[22] = RijndaelTransform.iSBox[(int)((byte)(num11 >> 8))] ^ (byte)(ekey[num] >> 8);
outdata[23] = RijndaelTransform.iSBox[(int)((byte)num10)] ^ (byte)ekey[num++];
}
// Token: 0x0600307E RID: 12414 RVA: 0x000A4418 File Offset: 0x000A2618
private void Decrypt256(byte[] indata, byte[] outdata, uint[] ekey)
{
uint num = (uint)((((int)indata[0] << 24) | ((int)indata[1] << 16) | ((int)indata[2] << 8) | (int)indata[3]) ^ (int)ekey[0]);
uint num2 = (uint)((((int)indata[4] << 24) | ((int)indata[5] << 16) | ((int)indata[6] << 8) | (int)indata[7]) ^ (int)ekey[1]);
uint num3 = (uint)((((int)indata[8] << 24) | ((int)indata[9] << 16) | ((int)indata[10] << 8) | (int)indata[11]) ^ (int)ekey[2]);
uint num4 = (uint)((((int)indata[12] << 24) | ((int)indata[13] << 16) | ((int)indata[14] << 8) | (int)indata[15]) ^ (int)ekey[3]);
uint num5 = (uint)((((int)indata[16] << 24) | ((int)indata[17] << 16) | ((int)indata[18] << 8) | (int)indata[19]) ^ (int)ekey[4]);
uint num6 = (uint)((((int)indata[20] << 24) | ((int)indata[21] << 16) | ((int)indata[22] << 8) | (int)indata[23]) ^ (int)ekey[5]);
uint num7 = (uint)((((int)indata[24] << 24) | ((int)indata[25] << 16) | ((int)indata[26] << 8) | (int)indata[27]) ^ (int)ekey[6]);
uint num8 = (uint)((((int)indata[28] << 24) | ((int)indata[29] << 16) | ((int)indata[30] << 8) | (int)indata[31]) ^ (int)ekey[7]);
uint num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[8];
uint num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[9];
uint num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[10];
uint num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[11];
uint num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num)] ^ ekey[12];
uint num14 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[13];
uint num15 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[14];
uint num16 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[15];
num = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[16];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num14)] ^ ekey[17];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num15)] ^ ekey[18];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num16)] ^ ekey[19];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[20];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[21];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[22];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[23];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[24];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[25];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[26];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[27];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num)] ^ ekey[28];
num14 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[29];
num15 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[30];
num16 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[31];
num = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[32];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num14)] ^ ekey[33];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num15)] ^ ekey[34];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num16)] ^ ekey[35];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[36];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[37];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[38];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[39];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[40];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[41];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[42];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[43];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num)] ^ ekey[44];
num14 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[45];
num15 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[46];
num16 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[47];
num = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[48];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num14)] ^ ekey[49];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num15)] ^ ekey[50];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num16)] ^ ekey[51];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[52];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[53];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[54];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[55];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[56];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[57];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[58];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[59];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num)] ^ ekey[60];
num14 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[61];
num15 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[62];
num16 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[63];
num = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[64];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num14)] ^ ekey[65];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num15)] ^ ekey[66];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num16)] ^ ekey[67];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[68];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[69];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[70];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[71];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[72];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[73];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[74];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[75];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num)] ^ ekey[76];
num14 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[77];
num15 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[78];
num16 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[79];
num = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[80];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num14)] ^ ekey[81];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num15)] ^ ekey[82];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num16)] ^ ekey[83];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[84];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[85];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[86];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[87];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[88];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[89];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[90];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[91];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num)] ^ ekey[92];
num14 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[93];
num15 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[94];
num16 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[95];
num = RijndaelTransform.iT0[(int)((UIntPtr)(num9 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num16 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num14 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num13)] ^ ekey[96];
num2 = RijndaelTransform.iT0[(int)((UIntPtr)(num10 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num9 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num15 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num14)] ^ ekey[97];
num3 = RijndaelTransform.iT0[(int)((UIntPtr)(num11 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num10 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num16 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num15)] ^ ekey[98];
num4 = RijndaelTransform.iT0[(int)((UIntPtr)(num12 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num11 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num9 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num16)] ^ ekey[99];
num5 = RijndaelTransform.iT0[(int)((UIntPtr)(num13 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num12 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num10 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num9)] ^ ekey[100];
num6 = RijndaelTransform.iT0[(int)((UIntPtr)(num14 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num13 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num11 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num10)] ^ ekey[101];
num7 = RijndaelTransform.iT0[(int)((UIntPtr)(num15 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num14 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num12 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num11)] ^ ekey[102];
num8 = RijndaelTransform.iT0[(int)((UIntPtr)(num16 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num15 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num13 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num12)] ^ ekey[103];
num9 = RijndaelTransform.iT0[(int)((UIntPtr)(num >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num8 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num6 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num5)] ^ ekey[104];
num10 = RijndaelTransform.iT0[(int)((UIntPtr)(num2 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num7 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num6)] ^ ekey[105];
num11 = RijndaelTransform.iT0[(int)((UIntPtr)(num3 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num2 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num8 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num7)] ^ ekey[106];
num12 = RijndaelTransform.iT0[(int)((UIntPtr)(num4 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num3 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num8)] ^ ekey[107];
num13 = RijndaelTransform.iT0[(int)((UIntPtr)(num5 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num4 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num2 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num)] ^ ekey[108];
num14 = RijndaelTransform.iT0[(int)((UIntPtr)(num6 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num5 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num3 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num2)] ^ ekey[109];
num15 = RijndaelTransform.iT0[(int)((UIntPtr)(num7 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num6 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num4 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num3)] ^ ekey[110];
num16 = RijndaelTransform.iT0[(int)((UIntPtr)(num8 >> 24))] ^ RijndaelTransform.iT1[(int)((byte)(num7 >> 16))] ^ RijndaelTransform.iT2[(int)((byte)(num5 >> 8))] ^ RijndaelTransform.iT3[(int)((byte)num4)] ^ ekey[111];
outdata[0] = RijndaelTransform.iSBox[(int)((UIntPtr)(num9 >> 24))] ^ (byte)(ekey[112] >> 24);
outdata[1] = RijndaelTransform.iSBox[(int)((byte)(num16 >> 16))] ^ (byte)(ekey[112] >> 16);
outdata[2] = RijndaelTransform.iSBox[(int)((byte)(num14 >> 8))] ^ (byte)(ekey[112] >> 8);
outdata[3] = RijndaelTransform.iSBox[(int)((byte)num13)] ^ (byte)ekey[112];
outdata[4] = RijndaelTransform.iSBox[(int)((UIntPtr)(num10 >> 24))] ^ (byte)(ekey[113] >> 24);
outdata[5] = RijndaelTransform.iSBox[(int)((byte)(num9 >> 16))] ^ (byte)(ekey[113] >> 16);
outdata[6] = RijndaelTransform.iSBox[(int)((byte)(num15 >> 8))] ^ (byte)(ekey[113] >> 8);
outdata[7] = RijndaelTransform.iSBox[(int)((byte)num14)] ^ (byte)ekey[113];
outdata[8] = RijndaelTransform.iSBox[(int)((UIntPtr)(num11 >> 24))] ^ (byte)(ekey[114] >> 24);
outdata[9] = RijndaelTransform.iSBox[(int)((byte)(num10 >> 16))] ^ (byte)(ekey[114] >> 16);
outdata[10] = RijndaelTransform.iSBox[(int)((byte)(num16 >> 8))] ^ (byte)(ekey[114] >> 8);
outdata[11] = RijndaelTransform.iSBox[(int)((byte)num15)] ^ (byte)ekey[114];
outdata[12] = RijndaelTransform.iSBox[(int)((UIntPtr)(num12 >> 24))] ^ (byte)(ekey[115] >> 24);
outdata[13] = RijndaelTransform.iSBox[(int)((byte)(num11 >> 16))] ^ (byte)(ekey[115] >> 16);
outdata[14] = RijndaelTransform.iSBox[(int)((byte)(num9 >> 8))] ^ (byte)(ekey[115] >> 8);
outdata[15] = RijndaelTransform.iSBox[(int)((byte)num16)] ^ (byte)ekey[115];
outdata[16] = RijndaelTransform.iSBox[(int)((UIntPtr)(num13 >> 24))] ^ (byte)(ekey[116] >> 24);
outdata[17] = RijndaelTransform.iSBox[(int)((byte)(num12 >> 16))] ^ (byte)(ekey[116] >> 16);
outdata[18] = RijndaelTransform.iSBox[(int)((byte)(num10 >> 8))] ^ (byte)(ekey[116] >> 8);
outdata[19] = RijndaelTransform.iSBox[(int)((byte)num9)] ^ (byte)ekey[116];
outdata[20] = RijndaelTransform.iSBox[(int)((UIntPtr)(num14 >> 24))] ^ (byte)(ekey[117] >> 24);
outdata[21] = RijndaelTransform.iSBox[(int)((byte)(num13 >> 16))] ^ (byte)(ekey[117] >> 16);
outdata[22] = RijndaelTransform.iSBox[(int)((byte)(num11 >> 8))] ^ (byte)(ekey[117] >> 8);
outdata[23] = RijndaelTransform.iSBox[(int)((byte)num10)] ^ (byte)ekey[117];
outdata[24] = RijndaelTransform.iSBox[(int)((UIntPtr)(num15 >> 24))] ^ (byte)(ekey[118] >> 24);
outdata[25] = RijndaelTransform.iSBox[(int)((byte)(num14 >> 16))] ^ (byte)(ekey[118] >> 16);
outdata[26] = RijndaelTransform.iSBox[(int)((byte)(num12 >> 8))] ^ (byte)(ekey[118] >> 8);
outdata[27] = RijndaelTransform.iSBox[(int)((byte)num11)] ^ (byte)ekey[118];
outdata[28] = RijndaelTransform.iSBox[(int)((UIntPtr)(num16 >> 24))] ^ (byte)(ekey[119] >> 24);
outdata[29] = RijndaelTransform.iSBox[(int)((byte)(num15 >> 16))] ^ (byte)(ekey[119] >> 16);
outdata[30] = RijndaelTransform.iSBox[(int)((byte)(num13 >> 8))] ^ (byte)(ekey[119] >> 8);
outdata[31] = RijndaelTransform.iSBox[(int)((byte)num12)] ^ (byte)ekey[119];
}
// Token: 0x040013B6 RID: 5046
private uint[] expandedKey;
// Token: 0x040013B7 RID: 5047
private int Nb;
// Token: 0x040013B8 RID: 5048
private int Nk;
// Token: 0x040013B9 RID: 5049
private int Nr;
// Token: 0x040013BA RID: 5050
private static readonly uint[] Rcon = new uint[]
{
0U, 16777216U, 33554432U, 67108864U, 134217728U, 268435456U, 536870912U, 1073741824U, 2147483648U, 452984832U,
905969664U, 1811939328U, 3623878656U, 2868903936U, 1291845632U, 2583691264U, 788529152U, 1577058304U, 3154116608U, 1660944384U,
3321888768U, 2533359616U, 889192448U, 1778384896U, 3556769792U, 3003121664U, 2097152000U, 4194304000U, 4009754624U, 3305111552U
};
// Token: 0x040013BB RID: 5051
private static readonly byte[] SBox = new byte[]
{
99, 124, 119, 123, 242, 107, 111, 197, 48, 1,
103, 43, 254, 215, 171, 118, 202, 130, 201, 125,
250, 89, 71, 240, 173, 212, 162, 175, 156, 164,
114, 192, 183, 253, 147, 38, 54, 63, 247, 204,
52, 165, 229, 241, 113, 216, 49, 21, 4, 199,
35, 195, 24, 150, 5, 154, 7, 18, 128, 226,
235, 39, 178, 117, 9, 131, 44, 26, 27, 110,
90, 160, 82, 59, 214, 179, 41, 227, 47, 132,
83, 209, 0, 237, 32, 252, 177, 91, 106, 203,
190, 57, 74, 76, 88, 207, 208, 239, 170, 251,
67, 77, 51, 133, 69, 249, 2, 127, 80, 60,
159, 168, 81, 163, 64, 143, 146, 157, 56, 245,
188, 182, 218, 33, 16, byte.MaxValue, 243, 210, 205, 12,
19, 236, 95, 151, 68, 23, 196, 167, 126, 61,
100, 93, 25, 115, 96, 129, 79, 220, 34, 42,
144, 136, 70, 238, 184, 20, 222, 94, 11, 219,
224, 50, 58, 10, 73, 6, 36, 92, 194, 211,
172, 98, 145, 149, 228, 121, 231, 200, 55, 109,
141, 213, 78, 169, 108, 86, 244, 234, 101, 122,
174, 8, 186, 120, 37, 46, 28, 166, 180, 198,
232, 221, 116, 31, 75, 189, 139, 138, 112, 62,
181, 102, 72, 3, 246, 14, 97, 53, 87, 185,
134, 193, 29, 158, 225, 248, 152, 17, 105, 217,
142, 148, 155, 30, 135, 233, 206, 85, 40, 223,
140, 161, 137, 13, 191, 230, 66, 104, 65, 153,
45, 15, 176, 84, 187, 22
};
// Token: 0x040013BC RID: 5052
private static readonly byte[] iSBox = new byte[]
{
82, 9, 106, 213, 48, 54, 165, 56, 191, 64,
163, 158, 129, 243, 215, 251, 124, 227, 57, 130,
155, 47, byte.MaxValue, 135, 52, 142, 67, 68, 196, 222,
233, 203, 84, 123, 148, 50, 166, 194, 35, 61,
238, 76, 149, 11, 66, 250, 195, 78, 8, 46,
161, 102, 40, 217, 36, 178, 118, 91, 162, 73,
109, 139, 209, 37, 114, 248, 246, 100, 134, 104,
152, 22, 212, 164, 92, 204, 93, 101, 182, 146,
108, 112, 72, 80, 253, 237, 185, 218, 94, 21,
70, 87, 167, 141, 157, 132, 144, 216, 171, 0,
140, 188, 211, 10, 247, 228, 88, 5, 184, 179,
69, 6, 208, 44, 30, 143, 202, 63, 15, 2,
193, 175, 189, 3, 1, 19, 138, 107, 58, 145,
17, 65, 79, 103, 220, 234, 151, 242, 207, 206,
240, 180, 230, 115, 150, 172, 116, 34, 231, 173,
53, 133, 226, 249, 55, 232, 28, 117, 223, 110,
71, 241, 26, 113, 29, 41, 197, 137, 111, 183,
98, 14, 170, 24, 190, 27, 252, 86, 62, 75,
198, 210, 121, 32, 154, 219, 192, 254, 120, 205,
90, 244, 31, 221, 168, 51, 136, 7, 199, 49,
177, 18, 16, 89, 39, 128, 236, 95, 96, 81,
127, 169, 25, 181, 74, 13, 45, 229, 122, 159,
147, 201, 156, 239, 160, 224, 59, 77, 174, 42,
245, 176, 200, 235, 187, 60, 131, 83, 153, 97,
23, 43, 4, 126, 186, 119, 214, 38, 225, 105,
20, 99, 85, 33, 12, 125
};
// Token: 0x040013BD RID: 5053
private static readonly uint[] T0 = new uint[]
{
3328402341U, 4168907908U, 4000806809U, 4135287693U, 4294111757U, 3597364157U, 3731845041U, 2445657428U, 1613770832U, 33620227U,
3462883241U, 1445669757U, 3892248089U, 3050821474U, 1303096294U, 3967186586U, 2412431941U, 528646813U, 2311702848U, 4202528135U,
4026202645U, 2992200171U, 2387036105U, 4226871307U, 1101901292U, 3017069671U, 1604494077U, 1169141738U, 597466303U, 1403299063U,
3832705686U, 2613100635U, 1974974402U, 3791519004U, 1033081774U, 1277568618U, 1815492186U, 2118074177U, 4126668546U, 2211236943U,
1748251740U, 1369810420U, 3521504564U, 4193382664U, 3799085459U, 2883115123U, 1647391059U, 706024767U, 134480908U, 2512897874U,
1176707941U, 2646852446U, 806885416U, 932615841U, 168101135U, 798661301U, 235341577U, 605164086U, 461406363U, 3756188221U,
3454790438U, 1311188841U, 2142417613U, 3933566367U, 302582043U, 495158174U, 1479289972U, 874125870U, 907746093U, 3698224818U,
3025820398U, 1537253627U, 2756858614U, 1983593293U, 3084310113U, 2108928974U, 1378429307U, 3722699582U, 1580150641U, 327451799U,
2790478837U, 3117535592U, 0U, 3253595436U, 1075847264U, 3825007647U, 2041688520U, 3059440621U, 3563743934U, 2378943302U,
1740553945U, 1916352843U, 2487896798U, 2555137236U, 2958579944U, 2244988746U, 3151024235U, 3320835882U, 1336584933U, 3992714006U,
2252555205U, 2588757463U, 1714631509U, 293963156U, 2319795663U, 3925473552U, 67240454U, 4269768577U, 2689618160U, 2017213508U,
631218106U, 1269344483U, 2723238387U, 1571005438U, 2151694528U, 93294474U, 1066570413U, 563977660U, 1882732616U, 4059428100U,
1673313503U, 2008463041U, 2950355573U, 1109467491U, 537923632U, 3858759450U, 4260623118U, 3218264685U, 2177748300U, 403442708U,
638784309U, 3287084079U, 3193921505U, 899127202U, 2286175436U, 773265209U, 2479146071U, 1437050866U, 4236148354U, 2050833735U,
3362022572U, 3126681063U, 840505643U, 3866325909U, 3227541664U, 427917720U, 2655997905U, 2749160575U, 1143087718U, 1412049534U,
999329963U, 193497219U, 2353415882U, 3354324521U, 1807268051U, 672404540U, 2816401017U, 3160301282U, 369822493U, 2916866934U,
3688947771U, 1681011286U, 1949973070U, 336202270U, 2454276571U, 201721354U, 1210328172U, 3093060836U, 2680341085U, 3184776046U,
1135389935U, 3294782118U, 965841320U, 831886756U, 3554993207U, 4068047243U, 3588745010U, 2345191491U, 1849112409U, 3664604599U,
26054028U, 2983581028U, 2622377682U, 1235855840U, 3630984372U, 2891339514U, 4092916743U, 3488279077U, 3395642799U, 4101667470U,
1202630377U, 268961816U, 1874508501U, 4034427016U, 1243948399U, 1546530418U, 941366308U, 1470539505U, 1941222599U, 2546386513U,
3421038627U, 2715671932U, 3899946140U, 1042226977U, 2521517021U, 1639824860U, 227249030U, 260737669U, 3765465232U, 2084453954U,
1907733956U, 3429263018U, 2420656344U, 100860677U, 4160157185U, 470683154U, 3261161891U, 1781871967U, 2924959737U, 1773779408U,
394692241U, 2579611992U, 974986535U, 664706745U, 3655459128U, 3958962195U, 731420851U, 571543859U, 3530123707U, 2849626480U,
126783113U, 865375399U, 765172662U, 1008606754U, 361203602U, 3387549984U, 2278477385U, 2857719295U, 1344809080U, 2782912378U,
59542671U, 1503764984U, 160008576U, 437062935U, 1707065306U, 3622233649U, 2218934982U, 3496503480U, 2185314755U, 697932208U,
1512910199U, 504303377U, 2075177163U, 2824099068U, 1841019862U, 739644986U
};
// Token: 0x040013BE RID: 5054
private static readonly uint[] T1 = new uint[]
{
2781242211U, 2230877308U, 2582542199U, 2381740923U, 234877682U, 3184946027U, 2984144751U, 1418839493U, 1348481072U, 50462977U,
2848876391U, 2102799147U, 434634494U, 1656084439U, 3863849899U, 2599188086U, 1167051466U, 2636087938U, 1082771913U, 2281340285U,
368048890U, 3954334041U, 3381544775U, 201060592U, 3963727277U, 1739838676U, 4250903202U, 3930435503U, 3206782108U, 4149453988U,
2531553906U, 1536934080U, 3262494647U, 484572669U, 2923271059U, 1783375398U, 1517041206U, 1098792767U, 49674231U, 1334037708U,
1550332980U, 4098991525U, 886171109U, 150598129U, 2481090929U, 1940642008U, 1398944049U, 1059722517U, 201851908U, 1385547719U,
1699095331U, 1587397571U, 674240536U, 2704774806U, 252314885U, 3039795866U, 151914247U, 908333586U, 2602270848U, 1038082786U,
651029483U, 1766729511U, 3447698098U, 2682942837U, 454166793U, 2652734339U, 1951935532U, 775166490U, 758520603U, 3000790638U,
4004797018U, 4217086112U, 4137964114U, 1299594043U, 1639438038U, 3464344499U, 2068982057U, 1054729187U, 1901997871U, 2534638724U,
4121318227U, 1757008337U, 0U, 750906861U, 1614815264U, 535035132U, 3363418545U, 3988151131U, 3201591914U, 1183697867U,
3647454910U, 1265776953U, 3734260298U, 3566750796U, 3903871064U, 1250283471U, 1807470800U, 717615087U, 3847203498U, 384695291U,
3313910595U, 3617213773U, 1432761139U, 2484176261U, 3481945413U, 283769337U, 100925954U, 2180939647U, 4037038160U, 1148730428U,
3123027871U, 3813386408U, 4087501137U, 4267549603U, 3229630528U, 2315620239U, 2906624658U, 3156319645U, 1215313976U, 82966005U,
3747855548U, 3245848246U, 1974459098U, 1665278241U, 807407632U, 451280895U, 251524083U, 1841287890U, 1283575245U, 337120268U,
891687699U, 801369324U, 3787349855U, 2721421207U, 3431482436U, 959321879U, 1469301956U, 4065699751U, 2197585534U, 1199193405U,
2898814052U, 3887750493U, 724703513U, 2514908019U, 2696962144U, 2551808385U, 3516813135U, 2141445340U, 1715741218U, 2119445034U,
2872807568U, 2198571144U, 3398190662U, 700968686U, 3547052216U, 1009259540U, 2041044702U, 3803995742U, 487983883U, 1991105499U,
1004265696U, 1449407026U, 1316239930U, 504629770U, 3683797321U, 168560134U, 1816667172U, 3837287516U, 1570751170U, 1857934291U,
4014189740U, 2797888098U, 2822345105U, 2754712981U, 936633572U, 2347923833U, 852879335U, 1133234376U, 1500395319U, 3084545389U,
2348912013U, 1689376213U, 3533459022U, 3762923945U, 3034082412U, 4205598294U, 133428468U, 634383082U, 2949277029U, 2398386810U,
3913789102U, 403703816U, 3580869306U, 2297460856U, 1867130149U, 1918643758U, 607656988U, 4049053350U, 3346248884U, 1368901318U,
600565992U, 2090982877U, 2632479860U, 557719327U, 3717614411U, 3697393085U, 2249034635U, 2232388234U, 2430627952U, 1115438654U,
3295786421U, 2865522278U, 3633334344U, 84280067U, 33027830U, 303828494U, 2747425121U, 1600795957U, 4188952407U, 3496589753U,
2434238086U, 1486471617U, 658119965U, 3106381470U, 953803233U, 334231800U, 3005978776U, 857870609U, 3151128937U, 1890179545U,
2298973838U, 2805175444U, 3056442267U, 574365214U, 2450884487U, 550103529U, 1233637070U, 4289353045U, 2018519080U, 2057691103U,
2399374476U, 4166623649U, 2148108681U, 387583245U, 3664101311U, 836232934U, 3330556482U, 3100665960U, 3280093505U, 2955516313U,
2002398509U, 287182607U, 3413881008U, 4238890068U, 3597515707U, 975967766U
};
// Token: 0x040013BF RID: 5055
private static readonly uint[] T2 = new uint[]
{
1671808611U, 2089089148U, 2006576759U, 2072901243U, 4061003762U, 1807603307U, 1873927791U, 3310653893U, 810573872U, 16974337U,
1739181671U, 729634347U, 4263110654U, 3613570519U, 2883997099U, 1989864566U, 3393556426U, 2191335298U, 3376449993U, 2106063485U,
4195741690U, 1508618841U, 1204391495U, 4027317232U, 2917941677U, 3563566036U, 2734514082U, 2951366063U, 2629772188U, 2767672228U,
1922491506U, 3227229120U, 3082974647U, 4246528509U, 2477669779U, 644500518U, 911895606U, 1061256767U, 4144166391U, 3427763148U,
878471220U, 2784252325U, 3845444069U, 4043897329U, 1905517169U, 3631459288U, 827548209U, 356461077U, 67897348U, 3344078279U,
593839651U, 3277757891U, 405286936U, 2527147926U, 84871685U, 2595565466U, 118033927U, 305538066U, 2157648768U, 3795705826U,
3945188843U, 661212711U, 2999812018U, 1973414517U, 152769033U, 2208177539U, 745822252U, 439235610U, 455947803U, 1857215598U,
1525593178U, 2700827552U, 1391895634U, 994932283U, 3596728278U, 3016654259U, 695947817U, 3812548067U, 795958831U, 2224493444U,
1408607827U, 3513301457U, 0U, 3979133421U, 543178784U, 4229948412U, 2982705585U, 1542305371U, 1790891114U, 3410398667U,
3201918910U, 961245753U, 1256100938U, 1289001036U, 1491644504U, 3477767631U, 3496721360U, 4012557807U, 2867154858U, 4212583931U,
1137018435U, 1305975373U, 861234739U, 2241073541U, 1171229253U, 4178635257U, 33948674U, 2139225727U, 1357946960U, 1011120188U,
2679776671U, 2833468328U, 1374921297U, 2751356323U, 1086357568U, 2408187279U, 2460827538U, 2646352285U, 944271416U, 4110742005U,
3168756668U, 3066132406U, 3665145818U, 560153121U, 271589392U, 4279952895U, 4077846003U, 3530407890U, 3444343245U, 202643468U,
322250259U, 3962553324U, 1608629855U, 2543990167U, 1154254916U, 389623319U, 3294073796U, 2817676711U, 2122513534U, 1028094525U,
1689045092U, 1575467613U, 422261273U, 1939203699U, 1621147744U, 2174228865U, 1339137615U, 3699352540U, 577127458U, 712922154U,
2427141008U, 2290289544U, 1187679302U, 3995715566U, 3100863416U, 339486740U, 3732514782U, 1591917662U, 186455563U, 3681988059U,
3762019296U, 844522546U, 978220090U, 169743370U, 1239126601U, 101321734U, 611076132U, 1558493276U, 3260915650U, 3547250131U,
2901361580U, 1655096418U, 2443721105U, 2510565781U, 3828863972U, 2039214713U, 3878868455U, 3359869896U, 928607799U, 1840765549U,
2374762893U, 3580146133U, 1322425422U, 2850048425U, 1823791212U, 1459268694U, 4094161908U, 3928346602U, 1706019429U, 2056189050U,
2934523822U, 135794696U, 3134549946U, 2022240376U, 628050469U, 779246638U, 472135708U, 2800834470U, 3032970164U, 3327236038U,
3894660072U, 3715932637U, 1956440180U, 522272287U, 1272813131U, 3185336765U, 2340818315U, 2323976074U, 1888542832U, 1044544574U,
3049550261U, 1722469478U, 1222152264U, 50660867U, 4127324150U, 236067854U, 1638122081U, 895445557U, 1475980887U, 3117443513U,
2257655686U, 3243809217U, 489110045U, 2662934430U, 3778599393U, 4162055160U, 2561878936U, 288563729U, 1773916777U, 3648039385U,
2391345038U, 2493985684U, 2612407707U, 505560094U, 2274497927U, 3911240169U, 3460925390U, 1442818645U, 678973480U, 3749357023U,
2358182796U, 2717407649U, 2306869641U, 219617805U, 3218761151U, 3862026214U, 1120306242U, 1756942440U, 1103331905U, 2578459033U,
762796589U, 252780047U, 2966125488U, 1425844308U, 3151392187U, 372911126U
};
// Token: 0x040013C0 RID: 5056
private static readonly uint[] T3 = new uint[]
{
1667474886U, 2088535288U, 2004326894U, 2071694838U, 4075949567U, 1802223062U, 1869591006U, 3318043793U, 808472672U, 16843522U,
1734846926U, 724270422U, 4278065639U, 3621216949U, 2880169549U, 1987484396U, 3402253711U, 2189597983U, 3385409673U, 2105378810U,
4210693615U, 1499065266U, 1195886990U, 4042263547U, 2913856577U, 3570689971U, 2728590687U, 2947541573U, 2627518243U, 2762274643U,
1920112356U, 3233831835U, 3082273397U, 4261223649U, 2475929149U, 640051788U, 909531756U, 1061110142U, 4160160501U, 3435941763U,
875846760U, 2779116625U, 3857003729U, 4059105529U, 1903268834U, 3638064043U, 825316194U, 353713962U, 67374088U, 3351728789U,
589522246U, 3284360861U, 404236336U, 2526454071U, 84217610U, 2593830191U, 117901582U, 303183396U, 2155911963U, 3806477791U,
3958056653U, 656894286U, 2998062463U, 1970642922U, 151591698U, 2206440989U, 741110872U, 437923380U, 454765878U, 1852748508U,
1515908788U, 2694904667U, 1381168804U, 993742198U, 3604373943U, 3014905469U, 690584402U, 3823320797U, 791638366U, 2223281939U,
1398011302U, 3520161977U, 0U, 3991743681U, 538992704U, 4244381667U, 2981218425U, 1532751286U, 1785380564U, 3419096717U,
3200178535U, 960056178U, 1246420628U, 1280103576U, 1482221744U, 3486468741U, 3503319995U, 4025428677U, 2863326543U, 4227536621U,
1128514950U, 1296947098U, 859002214U, 2240123921U, 1162203018U, 4193849577U, 33687044U, 2139062782U, 1347481760U, 1010582648U,
2678045221U, 2829640523U, 1364325282U, 2745433693U, 1077985408U, 2408548869U, 2459086143U, 2644360225U, 943212656U, 4126475505U,
3166494563U, 3065430391U, 3671750063U, 555836226U, 269496352U, 4294908645U, 4092792573U, 3537006015U, 3452783745U, 202118168U,
320025894U, 3974901699U, 1600119230U, 2543297077U, 1145359496U, 387397934U, 3301201811U, 2812801621U, 2122220284U, 1027426170U,
1684319432U, 1566435258U, 421079858U, 1936954854U, 1616945344U, 2172753945U, 1330631070U, 3705438115U, 572679748U, 707427924U,
2425400123U, 2290647819U, 1179044492U, 4008585671U, 3099120491U, 336870440U, 3739122087U, 1583276732U, 185277718U, 3688593069U,
3772791771U, 842159716U, 976899700U, 168435220U, 1229577106U, 101059084U, 606366792U, 1549591736U, 3267517855U, 3553849021U,
2897014595U, 1650632388U, 2442242105U, 2509612081U, 3840161747U, 2038008818U, 3890688725U, 3368567691U, 926374254U, 1835907034U,
2374863873U, 3587531953U, 1313788572U, 2846482505U, 1819063512U, 1448540844U, 4109633523U, 3941213647U, 1701162954U, 2054852340U,
2930698567U, 134748176U, 3132806511U, 2021165296U, 623210314U, 774795868U, 471606328U, 2795958615U, 3031746419U, 3334885783U,
3907527627U, 3722280097U, 1953799400U, 522133822U, 1263263126U, 3183336545U, 2341176845U, 2324333839U, 1886425312U, 1044267644U,
3048588401U, 1718004428U, 1212733584U, 50529542U, 4143317495U, 235803164U, 1633788866U, 892690282U, 1465383342U, 3115962473U,
2256965911U, 3250673817U, 488449850U, 2661202215U, 3789633753U, 4177007595U, 2560144171U, 286339874U, 1768537042U, 3654906025U,
2391705863U, 2492770099U, 2610673197U, 505291324U, 2273808917U, 3924369609U, 3469625735U, 1431699370U, 673740880U, 3755965093U,
2358021891U, 2711746649U, 2307489801U, 218961690U, 3217021541U, 3873845719U, 1111672452U, 1751693520U, 1094828930U, 2576986153U,
757954394U, 252645662U, 2964376443U, 1414855848U, 3149649517U, 370555436U
};
// Token: 0x040013C1 RID: 5057
private static readonly uint[] iT0 = new uint[]
{
1374988112U, 2118214995U, 437757123U, 975658646U, 1001089995U, 530400753U, 2902087851U, 1273168787U, 540080725U, 2910219766U,
2295101073U, 4110568485U, 1340463100U, 3307916247U, 641025152U, 3043140495U, 3736164937U, 632953703U, 1172967064U, 1576976609U,
3274667266U, 2169303058U, 2370213795U, 1809054150U, 59727847U, 361929877U, 3211623147U, 2505202138U, 3569255213U, 1484005843U,
1239443753U, 2395588676U, 1975683434U, 4102977912U, 2572697195U, 666464733U, 3202437046U, 4035489047U, 3374361702U, 2110667444U,
1675577880U, 3843699074U, 2538681184U, 1649639237U, 2976151520U, 3144396420U, 4269907996U, 4178062228U, 1883793496U, 2403728665U,
2497604743U, 1383856311U, 2876494627U, 1917518562U, 3810496343U, 1716890410U, 3001755655U, 800440835U, 2261089178U, 3543599269U,
807962610U, 599762354U, 33778362U, 3977675356U, 2328828971U, 2809771154U, 4077384432U, 1315562145U, 1708848333U, 101039829U,
3509871135U, 3299278474U, 875451293U, 2733856160U, 92987698U, 2767645557U, 193195065U, 1080094634U, 1584504582U, 3178106961U,
1042385657U, 2531067453U, 3711829422U, 1306967366U, 2438237621U, 1908694277U, 67556463U, 1615861247U, 429456164U, 3602770327U,
2302690252U, 1742315127U, 2968011453U, 126454664U, 3877198648U, 2043211483U, 2709260871U, 2084704233U, 4169408201U, 0U,
159417987U, 841739592U, 504459436U, 1817866830U, 4245618683U, 260388950U, 1034867998U, 908933415U, 168810852U, 1750902305U,
2606453969U, 607530554U, 202008497U, 2472011535U, 3035535058U, 463180190U, 2160117071U, 1641816226U, 1517767529U, 470948374U,
3801332234U, 3231722213U, 1008918595U, 303765277U, 235474187U, 4069246893U, 766945465U, 337553864U, 1475418501U, 2943682380U,
4003061179U, 2743034109U, 4144047775U, 1551037884U, 1147550661U, 1543208500U, 2336434550U, 3408119516U, 3069049960U, 3102011747U,
3610369226U, 1113818384U, 328671808U, 2227573024U, 2236228733U, 3535486456U, 2935566865U, 3341394285U, 496906059U, 3702665459U,
226906860U, 2009195472U, 733156972U, 2842737049U, 294930682U, 1206477858U, 2835123396U, 2700099354U, 1451044056U, 573804783U,
2269728455U, 3644379585U, 2362090238U, 2564033334U, 2801107407U, 2776292904U, 3669462566U, 1068351396U, 742039012U, 1350078989U,
1784663195U, 1417561698U, 4136440770U, 2430122216U, 775550814U, 2193862645U, 2673705150U, 1775276924U, 1876241833U, 3475313331U,
3366754619U, 270040487U, 3902563182U, 3678124923U, 3441850377U, 1851332852U, 3969562369U, 2203032232U, 3868552805U, 2868897406U,
566021896U, 4011190502U, 3135740889U, 1248802510U, 3936291284U, 699432150U, 832877231U, 708780849U, 3332740144U, 899835584U,
1951317047U, 4236429990U, 3767586992U, 866637845U, 4043610186U, 1106041591U, 2144161806U, 395441711U, 1984812685U, 1139781709U,
3433712980U, 3835036895U, 2664543715U, 1282050075U, 3240894392U, 1181045119U, 2640243204U, 25965917U, 4203181171U, 4211818798U,
3009879386U, 2463879762U, 3910161971U, 1842759443U, 2597806476U, 933301370U, 1509430414U, 3943906441U, 3467192302U, 3076639029U,
3776767469U, 2051518780U, 2631065433U, 1441952575U, 404016761U, 1942435775U, 1408749034U, 1610459739U, 3745345300U, 2017778566U,
3400528769U, 3110650942U, 941896748U, 3265478751U, 371049330U, 3168937228U, 675039627U, 4279080257U, 967311729U, 135050206U,
3635733660U, 1683407248U, 2076935265U, 3576870512U, 1215061108U, 3501741890U
};
// Token: 0x040013C2 RID: 5058
private static readonly uint[] iT1 = new uint[]
{
1347548327U, 1400783205U, 3273267108U, 2520393566U, 3409685355U, 4045380933U, 2880240216U, 2471224067U, 1428173050U, 4138563181U,
2441661558U, 636813900U, 4233094615U, 3620022987U, 2149987652U, 2411029155U, 1239331162U, 1730525723U, 2554718734U, 3781033664U,
46346101U, 310463728U, 2743944855U, 3328955385U, 3875770207U, 2501218972U, 3955191162U, 3667219033U, 768917123U, 3545789473U,
692707433U, 1150208456U, 1786102409U, 2029293177U, 1805211710U, 3710368113U, 3065962831U, 401639597U, 1724457132U, 3028143674U,
409198410U, 2196052529U, 1620529459U, 1164071807U, 3769721975U, 2226875310U, 486441376U, 2499348523U, 1483753576U, 428819965U,
2274680428U, 3075636216U, 598438867U, 3799141122U, 1474502543U, 711349675U, 129166120U, 53458370U, 2592523643U, 2782082824U,
4063242375U, 2988687269U, 3120694122U, 1559041666U, 730517276U, 2460449204U, 4042459122U, 2706270690U, 3446004468U, 3573941694U,
533804130U, 2328143614U, 2637442643U, 2695033685U, 839224033U, 1973745387U, 957055980U, 2856345839U, 106852767U, 1371368976U,
4181598602U, 1033297158U, 2933734917U, 1179510461U, 3046200461U, 91341917U, 1862534868U, 4284502037U, 605657339U, 2547432937U,
3431546947U, 2003294622U, 3182487618U, 2282195339U, 954669403U, 3682191598U, 1201765386U, 3917234703U, 3388507166U, 0U,
2198438022U, 1211247597U, 2887651696U, 1315723890U, 4227665663U, 1443857720U, 507358933U, 657861945U, 1678381017U, 560487590U,
3516619604U, 975451694U, 2970356327U, 261314535U, 3535072918U, 2652609425U, 1333838021U, 2724322336U, 1767536459U, 370938394U,
182621114U, 3854606378U, 1128014560U, 487725847U, 185469197U, 2918353863U, 3106780840U, 3356761769U, 2237133081U, 1286567175U,
3152976349U, 4255350624U, 2683765030U, 3160175349U, 3309594171U, 878443390U, 1988838185U, 3704300486U, 1756818940U, 1673061617U,
3403100636U, 272786309U, 1075025698U, 545572369U, 2105887268U, 4174560061U, 296679730U, 1841768865U, 1260232239U, 4091327024U,
3960309330U, 3497509347U, 1814803222U, 2578018489U, 4195456072U, 575138148U, 3299409036U, 446754879U, 3629546796U, 4011996048U,
3347532110U, 3252238545U, 4270639778U, 915985419U, 3483825537U, 681933534U, 651868046U, 2755636671U, 3828103837U, 223377554U,
2607439820U, 1649704518U, 3270937875U, 3901806776U, 1580087799U, 4118987695U, 3198115200U, 2087309459U, 2842678573U, 3016697106U,
1003007129U, 2802849917U, 1860738147U, 2077965243U, 164439672U, 4100872472U, 32283319U, 2827177882U, 1709610350U, 2125135846U,
136428751U, 3874428392U, 3652904859U, 3460984630U, 3572145929U, 3593056380U, 2939266226U, 824852259U, 818324884U, 3224740454U,
930369212U, 2801566410U, 2967507152U, 355706840U, 1257309336U, 4148292826U, 243256656U, 790073846U, 2373340630U, 1296297904U,
1422699085U, 3756299780U, 3818836405U, 457992840U, 3099667487U, 2135319889U, 77422314U, 1560382517U, 1945798516U, 788204353U,
1521706781U, 1385356242U, 870912086U, 325965383U, 2358957921U, 2050466060U, 2388260884U, 2313884476U, 4006521127U, 901210569U,
3990953189U, 1014646705U, 1503449823U, 1062597235U, 2031621326U, 3212035895U, 3931371469U, 1533017514U, 350174575U, 2256028891U,
2177544179U, 1052338372U, 741876788U, 1606591296U, 1914052035U, 213705253U, 2334669897U, 1107234197U, 1899603969U, 3725069491U,
2631447780U, 2422494913U, 1635502980U, 1893020342U, 1950903388U, 1120974935U
};
// Token: 0x040013C3 RID: 5059
private static readonly uint[] iT2 = new uint[]
{
2807058932U, 1699970625U, 2764249623U, 1586903591U, 1808481195U, 1173430173U, 1487645946U, 59984867U, 4199882800U, 1844882806U,
1989249228U, 1277555970U, 3623636965U, 3419915562U, 1149249077U, 2744104290U, 1514790577U, 459744698U, 244860394U, 3235995134U,
1963115311U, 4027744588U, 2544078150U, 4190530515U, 1608975247U, 2627016082U, 2062270317U, 1507497298U, 2200818878U, 567498868U,
1764313568U, 3359936201U, 2305455554U, 2037970062U, 1047239000U, 1910319033U, 1337376481U, 2904027272U, 2892417312U, 984907214U,
1243112415U, 830661914U, 861968209U, 2135253587U, 2011214180U, 2927934315U, 2686254721U, 731183368U, 1750626376U, 4246310725U,
1820824798U, 4172763771U, 3542330227U, 48394827U, 2404901663U, 2871682645U, 671593195U, 3254988725U, 2073724613U, 145085239U,
2280796200U, 2779915199U, 1790575107U, 2187128086U, 472615631U, 3029510009U, 4075877127U, 3802222185U, 4107101658U, 3201631749U,
1646252340U, 4270507174U, 1402811438U, 1436590835U, 3778151818U, 3950355702U, 3963161475U, 4020912224U, 2667994737U, 273792366U,
2331590177U, 104699613U, 95345982U, 3175501286U, 2377486676U, 1560637892U, 3564045318U, 369057872U, 4213447064U, 3919042237U,
1137477952U, 2658625497U, 1119727848U, 2340947849U, 1530455833U, 4007360968U, 172466556U, 266959938U, 516552836U, 0U,
2256734592U, 3980931627U, 1890328081U, 1917742170U, 4294704398U, 945164165U, 3575528878U, 958871085U, 3647212047U, 2787207260U,
1423022939U, 775562294U, 1739656202U, 3876557655U, 2530391278U, 2443058075U, 3310321856U, 547512796U, 1265195639U, 437656594U,
3121275539U, 719700128U, 3762502690U, 387781147U, 218828297U, 3350065803U, 2830708150U, 2848461854U, 428169201U, 122466165U,
3720081049U, 1627235199U, 648017665U, 4122762354U, 1002783846U, 2117360635U, 695634755U, 3336358691U, 4234721005U, 4049844452U,
3704280881U, 2232435299U, 574624663U, 287343814U, 612205898U, 1039717051U, 840019705U, 2708326185U, 793451934U, 821288114U,
1391201670U, 3822090177U, 376187827U, 3113855344U, 1224348052U, 1679968233U, 2361698556U, 1058709744U, 752375421U, 2431590963U,
1321699145U, 3519142200U, 2734591178U, 188127444U, 2177869557U, 3727205754U, 2384911031U, 3215212461U, 2648976442U, 2450346104U,
3432737375U, 1180849278U, 331544205U, 3102249176U, 4150144569U, 2952102595U, 2159976285U, 2474404304U, 766078933U, 313773861U,
2570832044U, 2108100632U, 1668212892U, 3145456443U, 2013908262U, 418672217U, 3070356634U, 2594734927U, 1852171925U, 3867060991U,
3473416636U, 3907448597U, 2614737639U, 919489135U, 164948639U, 2094410160U, 2997825956U, 590424639U, 2486224549U, 1723872674U,
3157750862U, 3399941250U, 3501252752U, 3625268135U, 2555048196U, 3673637356U, 1343127501U, 4130281361U, 3599595085U, 2957853679U,
1297403050U, 81781910U, 3051593425U, 2283490410U, 532201772U, 1367295589U, 3926170974U, 895287692U, 1953757831U, 1093597963U,
492483431U, 3528626907U, 1446242576U, 1192455638U, 1636604631U, 209336225U, 344873464U, 1015671571U, 669961897U, 3375740769U,
3857572124U, 2973530695U, 3747192018U, 1933530610U, 3464042516U, 935293895U, 3454686199U, 2858115069U, 1863638845U, 3683022916U,
4085369519U, 3292445032U, 875313188U, 1080017571U, 3279033885U, 621591778U, 1233856572U, 2504130317U, 24197544U, 3017672716U,
3835484340U, 3247465558U, 2220981195U, 3060847922U, 1551124588U, 1463996600U
};
// Token: 0x040013C4 RID: 5060
private static readonly uint[] iT3 = new uint[]
{
4104605777U, 1097159550U, 396673818U, 660510266U, 2875968315U, 2638606623U, 4200115116U, 3808662347U, 821712160U, 1986918061U,
3430322568U, 38544885U, 3856137295U, 718002117U, 893681702U, 1654886325U, 2975484382U, 3122358053U, 3926825029U, 4274053469U,
796197571U, 1290801793U, 1184342925U, 3556361835U, 2405426947U, 2459735317U, 1836772287U, 1381620373U, 3196267988U, 1948373848U,
3764988233U, 3385345166U, 3263785589U, 2390325492U, 1480485785U, 3111247143U, 3780097726U, 2293045232U, 548169417U, 3459953789U,
3746175075U, 439452389U, 1362321559U, 1400849762U, 1685577905U, 1806599355U, 2174754046U, 137073913U, 1214797936U, 1174215055U,
3731654548U, 2079897426U, 1943217067U, 1258480242U, 529487843U, 1437280870U, 3945269170U, 3049390895U, 3313212038U, 923313619U,
679998000U, 3215307299U, 57326082U, 377642221U, 3474729866U, 2041877159U, 133361907U, 1776460110U, 3673476453U, 96392454U,
878845905U, 2801699524U, 777231668U, 4082475170U, 2330014213U, 4142626212U, 2213296395U, 1626319424U, 1906247262U, 1846563261U,
562755902U, 3708173718U, 1040559837U, 3871163981U, 1418573201U, 3294430577U, 114585348U, 1343618912U, 2566595609U, 3186202582U,
1078185097U, 3651041127U, 3896688048U, 2307622919U, 425408743U, 3371096953U, 2081048481U, 1108339068U, 2216610296U, 0U,
2156299017U, 736970802U, 292596766U, 1517440620U, 251657213U, 2235061775U, 2933202493U, 758720310U, 265905162U, 1554391400U,
1532285339U, 908999204U, 174567692U, 1474760595U, 4002861748U, 2610011675U, 3234156416U, 3693126241U, 2001430874U, 303699484U,
2478443234U, 2687165888U, 585122620U, 454499602U, 151849742U, 2345119218U, 3064510765U, 514443284U, 4044981591U, 1963412655U,
2581445614U, 2137062819U, 19308535U, 1928707164U, 1715193156U, 4219352155U, 1126790795U, 600235211U, 3992742070U, 3841024952U,
836553431U, 1669664834U, 2535604243U, 3323011204U, 1243905413U, 3141400786U, 4180808110U, 698445255U, 2653899549U, 2989552604U,
2253581325U, 3252932727U, 3004591147U, 1891211689U, 2487810577U, 3915653703U, 4237083816U, 4030667424U, 2100090966U, 865136418U,
1229899655U, 953270745U, 3399679628U, 3557504664U, 4118925222U, 2061379749U, 3079546586U, 2915017791U, 983426092U, 2022837584U,
1607244650U, 2118541908U, 2366882550U, 3635996816U, 972512814U, 3283088770U, 1568718495U, 3499326569U, 3576539503U, 621982671U,
2895723464U, 410887952U, 2623762152U, 1002142683U, 645401037U, 1494807662U, 2595684844U, 1335535747U, 2507040230U, 4293295786U,
3167684641U, 367585007U, 3885750714U, 1865862730U, 2668221674U, 2960971305U, 2763173681U, 1059270954U, 2777952454U, 2724642869U,
1320957812U, 2194319100U, 2429595872U, 2815956275U, 77089521U, 3973773121U, 3444575871U, 2448830231U, 1305906550U, 4021308739U,
2857194700U, 2516901860U, 3518358430U, 1787304780U, 740276417U, 1699839814U, 1592394909U, 2352307457U, 2272556026U, 188821243U,
1729977011U, 3687994002U, 274084841U, 3594982253U, 3613494426U, 2701949495U, 4162096729U, 322734571U, 2837966542U, 1640576439U,
484830689U, 1202797690U, 3537852828U, 4067639125U, 349075736U, 3342319475U, 4157467219U, 4255800159U, 1030690015U, 1155237496U,
2951971274U, 1757691577U, 607398968U, 2738905026U, 499347990U, 3794078908U, 1011452712U, 227885567U, 2818666809U, 213114376U,
3034881240U, 1455525988U, 3414450555U, 850817237U, 1817998408U, 3092726480U
};
}
}
@@ -0,0 +1,39 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA1" /> hash for the input data.</summary>
// Token: 0x0200052A RID: 1322
[ComVisible(true)]
public abstract class SHA1 : HashAlgorithm
{
/// <summary>Initializes a new instance of <see cref="T:System.Security.Cryptography.SHA1" />.</summary>
/// <exception cref="T:System.InvalidOperationException">The policy on this object is not compliant with the FIPS algorithm.</exception>
// Token: 0x0600308A RID: 12426 RVA: 0x000A5E40 File Offset: 0x000A4040
protected SHA1()
{
this.HashSizeValue = 160;
}
/// <summary>Creates an instance of the default implementation of <see cref="T:System.Security.Cryptography.SHA1" />.</summary>
/// <returns>A new instance of <see cref="T:System.Security.Cryptography.SHA1" />.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x0600308B RID: 12427 RVA: 0x000A5E54 File Offset: 0x000A4054
public new static SHA1 Create()
{
return SHA1.Create("System.Security.Cryptography.SHA1");
}
/// <summary>Creates an instance of the specified implementation of <see cref="T:System.Security.Cryptography.SHA1" />.</summary>
/// <returns>A new instance of <see cref="T:System.Security.Cryptography.SHA1" /> using the specified implementation.</returns>
/// <param name="hashName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.SHA1" /> to be used. </param>
// Token: 0x0600308C RID: 12428 RVA: 0x000A5E60 File Offset: 0x000A4060
public new static SHA1 Create(string hashName)
{
return (SHA1)CryptoConfig.CreateFromName(hashName);
}
}
}
@@ -0,0 +1,57 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA1" /> hash value for the input data using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited. </summary>
// Token: 0x0200052C RID: 1324
[ComVisible(true)]
public sealed class SHA1CryptoServiceProvider : SHA1
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SHA1CryptoServiceProvider" /> class.</summary>
// Token: 0x06003096 RID: 12438 RVA: 0x000A69D4 File Offset: 0x000A4BD4
public SHA1CryptoServiceProvider()
{
this.sha = new SHA1Internal();
}
// Token: 0x06003097 RID: 12439 RVA: 0x000A69E8 File Offset: 0x000A4BE8
~SHA1CryptoServiceProvider()
{
this.Dispose(false);
}
// Token: 0x06003098 RID: 12440 RVA: 0x000A6A24 File Offset: 0x000A4C24
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
// Token: 0x06003099 RID: 12441 RVA: 0x000A6A30 File Offset: 0x000A4C30
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
this.State = 1;
this.sha.HashCore(rgb, ibStart, cbSize);
}
// Token: 0x0600309A RID: 12442 RVA: 0x000A6A48 File Offset: 0x000A4C48
protected override byte[] HashFinal()
{
this.State = 0;
return this.sha.HashFinal();
}
/// <summary>Initializes an instance of <see cref="T:System.Security.Cryptography.SHA1CryptoServiceProvider" />.</summary>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600309B RID: 12443 RVA: 0x000A6A5C File Offset: 0x000A4C5C
public override void Initialize()
{
this.sha.Initialize();
}
// Token: 0x040013CE RID: 5070
private SHA1Internal sha;
}
}
@@ -0,0 +1,257 @@
using System;
namespace System.Security.Cryptography
{
// Token: 0x0200052B RID: 1323
internal class SHA1Internal
{
// Token: 0x0600308D RID: 12429 RVA: 0x000A5E70 File Offset: 0x000A4070
public SHA1Internal()
{
this._H = new uint[5];
this._ProcessingBuffer = new byte[64];
this.buff = new uint[80];
this.Initialize();
}
// Token: 0x0600308E RID: 12430 RVA: 0x000A5EB0 File Offset: 0x000A40B0
public void HashCore(byte[] rgb, int ibStart, int cbSize)
{
if (this._ProcessingBufferCount != 0)
{
if (cbSize < 64 - this._ProcessingBufferCount)
{
Buffer.BlockCopy(rgb, ibStart, this._ProcessingBuffer, this._ProcessingBufferCount, cbSize);
this._ProcessingBufferCount += cbSize;
return;
}
int i = 64 - this._ProcessingBufferCount;
Buffer.BlockCopy(rgb, ibStart, this._ProcessingBuffer, this._ProcessingBufferCount, i);
this.ProcessBlock(this._ProcessingBuffer, 0U);
this._ProcessingBufferCount = 0;
ibStart += i;
cbSize -= i;
}
for (int i = 0; i < cbSize - cbSize % 64; i += 64)
{
this.ProcessBlock(rgb, (uint)(ibStart + i));
}
if (cbSize % 64 != 0)
{
Buffer.BlockCopy(rgb, cbSize - cbSize % 64 + ibStart, this._ProcessingBuffer, 0, cbSize % 64);
this._ProcessingBufferCount = cbSize % 64;
}
}
// Token: 0x0600308F RID: 12431 RVA: 0x000A5F84 File Offset: 0x000A4184
public byte[] HashFinal()
{
byte[] array = new byte[20];
this.ProcessFinalBlock(this._ProcessingBuffer, 0, this._ProcessingBufferCount);
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 4; j++)
{
array[i * 4 + j] = (byte)(this._H[i] >> 8 * (3 - j));
}
}
return array;
}
// Token: 0x06003090 RID: 12432 RVA: 0x000A5FEC File Offset: 0x000A41EC
public void Initialize()
{
this.count = 0UL;
this._ProcessingBufferCount = 0;
this._H[0] = 1732584193U;
this._H[1] = 4023233417U;
this._H[2] = 2562383102U;
this._H[3] = 271733878U;
this._H[4] = 3285377520U;
}
// Token: 0x06003091 RID: 12433 RVA: 0x000A604C File Offset: 0x000A424C
private void ProcessBlock(byte[] inputBuffer, uint inputOffset)
{
this.count += 64UL;
uint[] h = this._H;
uint[] array = this.buff;
SHA1Internal.InitialiseBuff(array, inputBuffer, inputOffset);
SHA1Internal.FillBuff(array);
uint num = h[0];
uint num2 = h[1];
uint num3 = h[2];
uint num4 = h[3];
uint num5 = h[4];
int i;
for (i = 0; i < 20; i += 5)
{
num5 += ((num << 5) | (num >> 27)) + (((num3 ^ num4) & num2) ^ num4) + 1518500249U + array[i];
num2 = (num2 << 30) | (num2 >> 2);
num4 += ((num5 << 5) | (num5 >> 27)) + (((num2 ^ num3) & num) ^ num3) + 1518500249U + array[i + 1];
num = (num << 30) | (num >> 2);
num3 += ((num4 << 5) | (num4 >> 27)) + (((num ^ num2) & num5) ^ num2) + 1518500249U + array[i + 2];
num5 = (num5 << 30) | (num5 >> 2);
num2 += ((num3 << 5) | (num3 >> 27)) + (((num5 ^ num) & num4) ^ num) + 1518500249U + array[i + 3];
num4 = (num4 << 30) | (num4 >> 2);
num += ((num2 << 5) | (num2 >> 27)) + (((num4 ^ num5) & num3) ^ num5) + 1518500249U + array[i + 4];
num3 = (num3 << 30) | (num3 >> 2);
}
while (i < 40)
{
num5 += ((num << 5) | (num >> 27)) + (num2 ^ num3 ^ num4) + 1859775393U + array[i];
num2 = (num2 << 30) | (num2 >> 2);
num4 += ((num5 << 5) | (num5 >> 27)) + (num ^ num2 ^ num3) + 1859775393U + array[i + 1];
num = (num << 30) | (num >> 2);
num3 += ((num4 << 5) | (num4 >> 27)) + (num5 ^ num ^ num2) + 1859775393U + array[i + 2];
num5 = (num5 << 30) | (num5 >> 2);
num2 += ((num3 << 5) | (num3 >> 27)) + (num4 ^ num5 ^ num) + 1859775393U + array[i + 3];
num4 = (num4 << 30) | (num4 >> 2);
num += ((num2 << 5) | (num2 >> 27)) + (num3 ^ num4 ^ num5) + 1859775393U + array[i + 4];
num3 = (num3 << 30) | (num3 >> 2);
i += 5;
}
while (i < 60)
{
num5 += ((num << 5) | (num >> 27)) + ((num2 & num3) | (num2 & num4) | (num3 & num4)) + 2400959708U + array[i];
num2 = (num2 << 30) | (num2 >> 2);
num4 += ((num5 << 5) | (num5 >> 27)) + ((num & num2) | (num & num3) | (num2 & num3)) + 2400959708U + array[i + 1];
num = (num << 30) | (num >> 2);
num3 += ((num4 << 5) | (num4 >> 27)) + ((num5 & num) | (num5 & num2) | (num & num2)) + 2400959708U + array[i + 2];
num5 = (num5 << 30) | (num5 >> 2);
num2 += ((num3 << 5) | (num3 >> 27)) + ((num4 & num5) | (num4 & num) | (num5 & num)) + 2400959708U + array[i + 3];
num4 = (num4 << 30) | (num4 >> 2);
num += ((num2 << 5) | (num2 >> 27)) + ((num3 & num4) | (num3 & num5) | (num4 & num5)) + 2400959708U + array[i + 4];
num3 = (num3 << 30) | (num3 >> 2);
i += 5;
}
while (i < 80)
{
num5 += ((num << 5) | (num >> 27)) + (num2 ^ num3 ^ num4) + 3395469782U + array[i];
num2 = (num2 << 30) | (num2 >> 2);
num4 += ((num5 << 5) | (num5 >> 27)) + (num ^ num2 ^ num3) + 3395469782U + array[i + 1];
num = (num << 30) | (num >> 2);
num3 += ((num4 << 5) | (num4 >> 27)) + (num5 ^ num ^ num2) + 3395469782U + array[i + 2];
num5 = (num5 << 30) | (num5 >> 2);
num2 += ((num3 << 5) | (num3 >> 27)) + (num4 ^ num5 ^ num) + 3395469782U + array[i + 3];
num4 = (num4 << 30) | (num4 >> 2);
num += ((num2 << 5) | (num2 >> 27)) + (num3 ^ num4 ^ num5) + 3395469782U + array[i + 4];
num3 = (num3 << 30) | (num3 >> 2);
i += 5;
}
h[0] += num;
h[1] += num2;
h[2] += num3;
h[3] += num4;
h[4] += num5;
}
// Token: 0x06003092 RID: 12434 RVA: 0x000A64A4 File Offset: 0x000A46A4
private static void InitialiseBuff(uint[] buff, byte[] input, uint inputOffset)
{
buff[0] = (uint)(((int)input[(int)((UIntPtr)inputOffset)] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 1U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 2U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 3U))]);
buff[1] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 4U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 5U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 6U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 7U))]);
buff[2] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 8U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 9U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 10U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 11U))]);
buff[3] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 12U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 13U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 14U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 15U))]);
buff[4] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 16U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 17U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 18U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 19U))]);
buff[5] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 20U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 21U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 22U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 23U))]);
buff[6] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 24U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 25U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 26U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 27U))]);
buff[7] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 28U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 29U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 30U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 31U))]);
buff[8] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 32U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 33U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 34U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 35U))]);
buff[9] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 36U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 37U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 38U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 39U))]);
buff[10] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 40U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 41U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 42U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 43U))]);
buff[11] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 44U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 45U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 46U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 47U))]);
buff[12] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 48U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 49U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 50U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 51U))]);
buff[13] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 52U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 53U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 54U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 55U))]);
buff[14] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 56U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 57U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 58U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 59U))]);
buff[15] = (uint)(((int)input[(int)((UIntPtr)(inputOffset + 60U))] << 24) | ((int)input[(int)((UIntPtr)(inputOffset + 61U))] << 16) | ((int)input[(int)((UIntPtr)(inputOffset + 62U))] << 8) | (int)input[(int)((UIntPtr)(inputOffset + 63U))]);
}
// Token: 0x06003093 RID: 12435 RVA: 0x000A6750 File Offset: 0x000A4950
private static void FillBuff(uint[] buff)
{
for (int i = 16; i < 80; i += 8)
{
uint num = buff[i - 3] ^ buff[i - 8] ^ buff[i - 14] ^ buff[i - 16];
buff[i] = (num << 1) | (num >> 31);
num = buff[i - 2] ^ buff[i - 7] ^ buff[i - 13] ^ buff[i - 15];
buff[i + 1] = (num << 1) | (num >> 31);
num = buff[i - 1] ^ buff[i - 6] ^ buff[i - 12] ^ buff[i - 14];
buff[i + 2] = (num << 1) | (num >> 31);
num = buff[i] ^ buff[i - 5] ^ buff[i - 11] ^ buff[i - 13];
buff[i + 3] = (num << 1) | (num >> 31);
num = buff[i + 1] ^ buff[i - 4] ^ buff[i - 10] ^ buff[i - 12];
buff[i + 4] = (num << 1) | (num >> 31);
num = buff[i + 2] ^ buff[i - 3] ^ buff[i - 9] ^ buff[i - 11];
buff[i + 5] = (num << 1) | (num >> 31);
num = buff[i + 3] ^ buff[i - 2] ^ buff[i - 8] ^ buff[i - 10];
buff[i + 6] = (num << 1) | (num >> 31);
num = buff[i + 4] ^ buff[i - 1] ^ buff[i - 7] ^ buff[i - 9];
buff[i + 7] = (num << 1) | (num >> 31);
}
}
// Token: 0x06003094 RID: 12436 RVA: 0x000A68A4 File Offset: 0x000A4AA4
private void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
ulong num = this.count + (ulong)((long)inputCount);
int num2 = 56 - (int)(num % 64UL);
if (num2 < 1)
{
num2 += 64;
}
int num3 = inputCount + num2 + 8;
byte[] array = ((num3 != 64) ? new byte[num3] : this._ProcessingBuffer);
for (int i = 0; i < inputCount; i++)
{
array[i] = inputBuffer[i + inputOffset];
}
array[inputCount] = 128;
for (int j = inputCount + 1; j < inputCount + num2; j++)
{
array[j] = 0;
}
ulong num4 = num << 3;
this.AddLength(num4, array, inputCount + num2);
this.ProcessBlock(array, 0U);
if (num3 == 128)
{
this.ProcessBlock(array, 64U);
}
}
// Token: 0x06003095 RID: 12437 RVA: 0x000A6968 File Offset: 0x000A4B68
internal void AddLength(ulong length, byte[] buffer, int position)
{
buffer[position++] = (byte)(length >> 56);
buffer[position++] = (byte)(length >> 48);
buffer[position++] = (byte)(length >> 40);
buffer[position++] = (byte)(length >> 32);
buffer[position++] = (byte)(length >> 24);
buffer[position++] = (byte)(length >> 16);
buffer[position++] = (byte)(length >> 8);
buffer[position] = (byte)length;
}
// Token: 0x040013C7 RID: 5063
private const int BLOCK_SIZE_BYTES = 64;
// Token: 0x040013C8 RID: 5064
private const int HASH_SIZE_BYTES = 20;
// Token: 0x040013C9 RID: 5065
private uint[] _H;
// Token: 0x040013CA RID: 5066
private ulong count;
// Token: 0x040013CB RID: 5067
private byte[] _ProcessingBuffer;
// Token: 0x040013CC RID: 5068
private int _ProcessingBufferCount;
// Token: 0x040013CD RID: 5069
private uint[] buff;
}
}
@@ -0,0 +1,49 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA1" /> hash for the input data using the managed library. </summary>
// Token: 0x0200052D RID: 1325
[ComVisible(true)]
public class SHA1Managed : SHA1
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SHA1Managed" /> class.</summary>
/// <exception cref="T:System.InvalidOperationException">This class is not compliant with the FIPS algorithm.</exception>
// Token: 0x0600309C RID: 12444 RVA: 0x000A6A6C File Offset: 0x000A4C6C
public SHA1Managed()
{
this.sha = new SHA1Internal();
}
/// <summary>Routes data written to the object into the <see cref="T:System.Security.Cryptography.SHA1Managed" /> hash algorithm for computing the hash.</summary>
/// <param name="rgb">The input data. </param>
/// <param name="ibStart">The offset into the byte array from which to begin using data. </param>
/// <param name="cbSize">The number of bytes in the array to use as data. </param>
// Token: 0x0600309D RID: 12445 RVA: 0x000A6A80 File Offset: 0x000A4C80
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
this.State = 1;
this.sha.HashCore(rgb, ibStart, cbSize);
}
/// <summary>Returns the computed <see cref="T:System.Security.Cryptography.SHA1" /> hash value after all data has been written to the object.</summary>
/// <returns>The computed hash code.</returns>
// Token: 0x0600309E RID: 12446 RVA: 0x000A6A98 File Offset: 0x000A4C98
protected override byte[] HashFinal()
{
this.State = 0;
return this.sha.HashFinal();
}
/// <summary>Initializes an instance of <see cref="T:System.Security.Cryptography.SHA1Managed" />.</summary>
// Token: 0x0600309F RID: 12447 RVA: 0x000A6AAC File Offset: 0x000A4CAC
public override void Initialize()
{
this.sha.Initialize();
}
// Token: 0x040013CF RID: 5071
private SHA1Internal sha;
}
}
@@ -0,0 +1,40 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA256" /> hash for the input data. </summary>
// Token: 0x0200052E RID: 1326
[ComVisible(true)]
public abstract class SHA256 : HashAlgorithm
{
/// <summary>Initializes a new instance of <see cref="T:System.Security.Cryptography.SHA256" />.</summary>
// Token: 0x060030A0 RID: 12448 RVA: 0x000A6ABC File Offset: 0x000A4CBC
protected SHA256()
{
this.HashSizeValue = 256;
}
/// <summary>Creates an instance of the default implementation of <see cref="T:System.Security.Cryptography.SHA256" />.</summary>
/// <returns>A new instance of <see cref="T:System.Security.Cryptography.SHA256" />.</returns>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060030A1 RID: 12449 RVA: 0x000A6AD0 File Offset: 0x000A4CD0
public new static SHA256 Create()
{
return SHA256.Create("System.Security.Cryptography.SHA256");
}
/// <summary>Creates an instance of a specified implementation of <see cref="T:System.Security.Cryptography.SHA256" />.</summary>
/// <returns>A new instance of <see cref="T:System.Security.Cryptography.SHA256" /> using the specified implementation.</returns>
/// <param name="hashName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.SHA256" /> to be used. </param>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="hashName" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
// Token: 0x060030A2 RID: 12450 RVA: 0x000A6ADC File Offset: 0x000A4CDC
public new static SHA256 Create(string hashName)
{
return (SHA256)CryptoConfig.CreateFromName(hashName);
}
}
}
@@ -0,0 +1,202 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA256" /> hash for the input data using the managed library. </summary>
// Token: 0x0200052F RID: 1327
[ComVisible(true)]
public class SHA256Managed : SHA256
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SHA256Managed" /> class using the managed library.</summary>
/// <exception cref="T:System.InvalidOperationException">The Federal Information Processing Standards (FIPS) security setting is enabled. This implementation is not part of the Windows Platform FIPS-validated cryptographic algorithms.</exception>
// Token: 0x060030A3 RID: 12451 RVA: 0x000A6AEC File Offset: 0x000A4CEC
public SHA256Managed()
{
this._H = new uint[8];
this._ProcessingBuffer = new byte[64];
this.buff = new uint[64];
this.Initialize();
}
/// <summary>When overridden in a derived class, routes data written to the object into the <see cref="T:System.Security.Cryptography.SHA256" /> hash algorithm for computing the hash.</summary>
/// <param name="rgb">The input data. </param>
/// <param name="ibStart">The offset into the byte array from which to begin using data. </param>
/// <param name="cbSize">The number of bytes in the array to use as data. </param>
// Token: 0x060030A4 RID: 12452 RVA: 0x000A6B2C File Offset: 0x000A4D2C
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
this.State = 1;
if (this._ProcessingBufferCount != 0)
{
if (cbSize < 64 - this._ProcessingBufferCount)
{
Buffer.BlockCopy(rgb, ibStart, this._ProcessingBuffer, this._ProcessingBufferCount, cbSize);
this._ProcessingBufferCount += cbSize;
return;
}
int i = 64 - this._ProcessingBufferCount;
Buffer.BlockCopy(rgb, ibStart, this._ProcessingBuffer, this._ProcessingBufferCount, i);
this.ProcessBlock(this._ProcessingBuffer, 0);
this._ProcessingBufferCount = 0;
ibStart += i;
cbSize -= i;
}
for (int i = 0; i < cbSize - cbSize % 64; i += 64)
{
this.ProcessBlock(rgb, ibStart + i);
}
if (cbSize % 64 != 0)
{
Buffer.BlockCopy(rgb, cbSize - cbSize % 64 + ibStart, this._ProcessingBuffer, 0, cbSize % 64);
this._ProcessingBufferCount = cbSize % 64;
}
}
/// <summary>When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object.</summary>
/// <returns>The computed hash code.</returns>
// Token: 0x060030A5 RID: 12453 RVA: 0x000A6C08 File Offset: 0x000A4E08
protected override byte[] HashFinal()
{
byte[] array = new byte[32];
this.ProcessFinalBlock(this._ProcessingBuffer, 0, this._ProcessingBufferCount);
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 4; j++)
{
array[i * 4 + j] = (byte)(this._H[i] >> 24 - j * 8);
}
}
this.State = 0;
return array;
}
/// <summary>Initializes an instance of <see cref="T:System.Security.Cryptography.SHA256Managed" />.</summary>
// Token: 0x060030A6 RID: 12454 RVA: 0x000A6C78 File Offset: 0x000A4E78
public override void Initialize()
{
this.count = 0UL;
this._ProcessingBufferCount = 0;
this._H[0] = 1779033703U;
this._H[1] = 3144134277U;
this._H[2] = 1013904242U;
this._H[3] = 2773480762U;
this._H[4] = 1359893119U;
this._H[5] = 2600822924U;
this._H[6] = 528734635U;
this._H[7] = 1541459225U;
}
// Token: 0x060030A7 RID: 12455 RVA: 0x000A6CFC File Offset: 0x000A4EFC
private void ProcessBlock(byte[] inputBuffer, int inputOffset)
{
uint[] k = SHAConstants.K1;
uint[] array = this.buff;
this.count += 64UL;
for (int i = 0; i < 16; i++)
{
array[i] = (uint)(((int)inputBuffer[inputOffset + 4 * i] << 24) | ((int)inputBuffer[inputOffset + 4 * i + 1] << 16) | ((int)inputBuffer[inputOffset + 4 * i + 2] << 8) | (int)inputBuffer[inputOffset + 4 * i + 3]);
}
for (int i = 16; i < 64; i++)
{
uint num = array[i - 15];
num = ((num >> 7) | (num << 25)) ^ ((num >> 18) | (num << 14)) ^ (num >> 3);
uint num2 = array[i - 2];
num2 = ((num2 >> 17) | (num2 << 15)) ^ ((num2 >> 19) | (num2 << 13)) ^ (num2 >> 10);
array[i] = num2 + array[i - 7] + num + array[i - 16];
}
uint num3 = this._H[0];
uint num4 = this._H[1];
uint num5 = this._H[2];
uint num6 = this._H[3];
uint num7 = this._H[4];
uint num8 = this._H[5];
uint num9 = this._H[6];
uint num10 = this._H[7];
for (int i = 0; i < 64; i++)
{
uint num = num10 + (((num7 >> 6) | (num7 << 26)) ^ ((num7 >> 11) | (num7 << 21)) ^ ((num7 >> 25) | (num7 << 7))) + ((num7 & num8) ^ (~num7 & num9)) + k[i] + array[i];
uint num2 = ((num3 >> 2) | (num3 << 30)) ^ ((num3 >> 13) | (num3 << 19)) ^ ((num3 >> 22) | (num3 << 10));
num2 += (num3 & num4) ^ (num3 & num5) ^ (num4 & num5);
num10 = num9;
num9 = num8;
num8 = num7;
num7 = num6 + num;
num6 = num5;
num5 = num4;
num4 = num3;
num3 = num + num2;
}
this._H[0] += num3;
this._H[1] += num4;
this._H[2] += num5;
this._H[3] += num6;
this._H[4] += num7;
this._H[5] += num8;
this._H[6] += num9;
this._H[7] += num10;
}
// Token: 0x060030A8 RID: 12456 RVA: 0x000A6F74 File Offset: 0x000A5174
private void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
ulong num = this.count + (ulong)((long)inputCount);
int num2 = 56 - (int)(num % 64UL);
if (num2 < 1)
{
num2 += 64;
}
byte[] array = new byte[inputCount + num2 + 8];
for (int i = 0; i < inputCount; i++)
{
array[i] = inputBuffer[i + inputOffset];
}
array[inputCount] = 128;
for (int j = inputCount + 1; j < inputCount + num2; j++)
{
array[j] = 0;
}
ulong num3 = num << 3;
this.AddLength(num3, array, inputCount + num2);
this.ProcessBlock(array, 0);
if (inputCount + num2 + 8 == 128)
{
this.ProcessBlock(array, 64);
}
}
// Token: 0x060030A9 RID: 12457 RVA: 0x000A7020 File Offset: 0x000A5220
internal void AddLength(ulong length, byte[] buffer, int position)
{
buffer[position++] = (byte)(length >> 56);
buffer[position++] = (byte)(length >> 48);
buffer[position++] = (byte)(length >> 40);
buffer[position++] = (byte)(length >> 32);
buffer[position++] = (byte)(length >> 24);
buffer[position++] = (byte)(length >> 16);
buffer[position++] = (byte)(length >> 8);
buffer[position] = (byte)length;
}
// Token: 0x040013D0 RID: 5072
private const int BLOCK_SIZE_BYTES = 64;
// Token: 0x040013D1 RID: 5073
private const int HASH_SIZE_BYTES = 32;
// Token: 0x040013D2 RID: 5074
private uint[] _H;
// Token: 0x040013D3 RID: 5075
private ulong count;
// Token: 0x040013D4 RID: 5076
private byte[] _ProcessingBuffer;
// Token: 0x040013D5 RID: 5077
private int _ProcessingBufferCount;
// Token: 0x040013D6 RID: 5078
private uint[] buff;
}
}
@@ -0,0 +1,40 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA384" /> hash for the input data.</summary>
// Token: 0x02000530 RID: 1328
[ComVisible(true)]
public abstract class SHA384 : HashAlgorithm
{
/// <summary>Initializes a new instance of <see cref="T:System.Security.Cryptography.SHA384" />.</summary>
// Token: 0x060030AA RID: 12458 RVA: 0x000A708C File Offset: 0x000A528C
protected SHA384()
{
this.HashSizeValue = 384;
}
/// <summary>Creates an instance of the default implementation of <see cref="T:System.Security.Cryptography.SHA384" />.</summary>
/// <returns>A new instance of <see cref="T:System.Security.Cryptography.SHA384" />.</returns>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060030AB RID: 12459 RVA: 0x000A70A0 File Offset: 0x000A52A0
public new static SHA384 Create()
{
return SHA384.Create("System.Security.Cryptography.SHA384");
}
/// <summary>Creates an instance of a specified implementation of <see cref="T:System.Security.Cryptography.SHA384" />.</summary>
/// <returns>A new instance of <see cref="T:System.Security.Cryptography.SHA384" /> using the specified implementation.</returns>
/// <param name="hashName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.SHA384" /> to be used. </param>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="hashName" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
// Token: 0x060030AC RID: 12460 RVA: 0x000A70AC File Offset: 0x000A52AC
public new static SHA384 Create(string hashName)
{
return (SHA384)CryptoConfig.CreateFromName(hashName);
}
}
}
@@ -0,0 +1,262 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA384" /> hash for the input data using the managed library. </summary>
// Token: 0x02000531 RID: 1329
[ComVisible(true)]
public class SHA384Managed : SHA384
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SHA384Managed" /> class.</summary>
/// <exception cref="T:System.InvalidOperationException">The Federal Information Processing Standards (FIPS) security setting is enabled. This implementation is not part of the Windows Platform FIPS-validated cryptographic algorithms.</exception>
// Token: 0x060030AD RID: 12461 RVA: 0x000A70BC File Offset: 0x000A52BC
public SHA384Managed()
{
this.xBuf = new byte[8];
this.W = new ulong[80];
this.Initialize(false);
}
// Token: 0x060030AE RID: 12462 RVA: 0x000A70F0 File Offset: 0x000A52F0
private void Initialize(bool reuse)
{
this.H1 = 14680500436340154072UL;
this.H2 = 7105036623409894663UL;
this.H3 = 10473403895298186519UL;
this.H4 = 1526699215303891257UL;
this.H5 = 7436329637833083697UL;
this.H6 = 10282925794625328401UL;
this.H7 = 15784041429090275239UL;
this.H8 = 5167115440072839076UL;
if (reuse)
{
this.byteCount1 = 0UL;
this.byteCount2 = 0UL;
this.xBufOff = 0;
for (int i = 0; i < this.xBuf.Length; i++)
{
this.xBuf[i] = 0;
}
this.wOff = 0;
for (int num = 0; num != this.W.Length; num++)
{
this.W[num] = 0UL;
}
}
}
/// <summary>Initializes an instance of <see cref="T:System.Security.Cryptography.SHA384Managed" />.</summary>
// Token: 0x060030AF RID: 12463 RVA: 0x000A71E0 File Offset: 0x000A53E0
public override void Initialize()
{
this.Initialize(true);
}
/// <summary>When overridden in a derived class, routes data written to the object into the <see cref="T:System.Security.Cryptography.SHA384Managed" /> hash algorithm for computing the hash.</summary>
/// <param name="rgb">The input data. </param>
/// <param name="ibStart">The offset into the byte array from which to begin using data. </param>
/// <param name="cbSize">The number of bytes in the array to use as data. </param>
// Token: 0x060030B0 RID: 12464 RVA: 0x000A71EC File Offset: 0x000A53EC
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
while (this.xBufOff != 0 && cbSize > 0)
{
this.update(rgb[ibStart]);
ibStart++;
cbSize--;
}
while (cbSize > this.xBuf.Length)
{
this.processWord(rgb, ibStart);
ibStart += this.xBuf.Length;
cbSize -= this.xBuf.Length;
this.byteCount1 += (ulong)((long)this.xBuf.Length);
}
while (cbSize > 0)
{
this.update(rgb[ibStart]);
ibStart++;
cbSize--;
}
}
/// <summary>When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object.</summary>
/// <returns>The computed hash code.</returns>
// Token: 0x060030B1 RID: 12465 RVA: 0x000A728C File Offset: 0x000A548C
protected override byte[] HashFinal()
{
this.adjustByteCounts();
ulong num = this.byteCount1 << 3;
ulong num2 = this.byteCount2;
this.update(128);
while (this.xBufOff != 0)
{
this.update(0);
}
this.processLength(num, num2);
this.processBlock();
byte[] array = new byte[48];
this.unpackWord(this.H1, array, 0);
this.unpackWord(this.H2, array, 8);
this.unpackWord(this.H3, array, 16);
this.unpackWord(this.H4, array, 24);
this.unpackWord(this.H5, array, 32);
this.unpackWord(this.H6, array, 40);
this.Initialize();
return array;
}
// Token: 0x060030B2 RID: 12466 RVA: 0x000A7348 File Offset: 0x000A5548
private void update(byte input)
{
this.xBuf[this.xBufOff++] = input;
if (this.xBufOff == this.xBuf.Length)
{
this.processWord(this.xBuf, 0);
this.xBufOff = 0;
}
this.byteCount1 += 1UL;
}
// Token: 0x060030B3 RID: 12467 RVA: 0x000A73A4 File Offset: 0x000A55A4
private void processWord(byte[] input, int inOff)
{
this.W[this.wOff++] = ((ulong)input[inOff] << 56) | ((ulong)input[inOff + 1] << 48) | ((ulong)input[inOff + 2] << 40) | ((ulong)input[inOff + 3] << 32) | ((ulong)input[inOff + 4] << 24) | ((ulong)input[inOff + 5] << 16) | ((ulong)input[inOff + 6] << 8) | (ulong)input[inOff + 7];
if (this.wOff == 16)
{
this.processBlock();
}
}
// Token: 0x060030B4 RID: 12468 RVA: 0x000A7428 File Offset: 0x000A5628
private void unpackWord(ulong word, byte[] output, int outOff)
{
output[outOff] = (byte)(word >> 56);
output[outOff + 1] = (byte)(word >> 48);
output[outOff + 2] = (byte)(word >> 40);
output[outOff + 3] = (byte)(word >> 32);
output[outOff + 4] = (byte)(word >> 24);
output[outOff + 5] = (byte)(word >> 16);
output[outOff + 6] = (byte)(word >> 8);
output[outOff + 7] = (byte)word;
}
// Token: 0x060030B5 RID: 12469 RVA: 0x000A7480 File Offset: 0x000A5680
private void adjustByteCounts()
{
if (this.byteCount1 > 2305843009213693951UL)
{
this.byteCount2 += this.byteCount1 >> 61;
this.byteCount1 &= 2305843009213693951UL;
}
}
// Token: 0x060030B6 RID: 12470 RVA: 0x000A74D0 File Offset: 0x000A56D0
private void processLength(ulong lowW, ulong hiW)
{
if (this.wOff > 14)
{
this.processBlock();
}
this.W[14] = hiW;
this.W[15] = lowW;
}
// Token: 0x060030B7 RID: 12471 RVA: 0x000A74FC File Offset: 0x000A56FC
private void processBlock()
{
ulong[] w = this.W;
ulong[] k = SHAConstants.K2;
this.adjustByteCounts();
ulong num;
ulong num2;
for (int i = 16; i <= 79; i++)
{
num = w[i - 15];
num = ((num >> 1) | (num << 63)) ^ ((num >> 8) | (num << 56)) ^ (num >> 7);
num2 = w[i - 2];
num2 = ((num2 >> 19) | (num2 << 45)) ^ ((num2 >> 61) | (num2 << 3)) ^ (num2 >> 6);
w[i] = num2 + w[i - 7] + num + w[i - 16];
}
num = this.H1;
num2 = this.H2;
ulong num3 = this.H3;
ulong num4 = this.H4;
ulong num5 = this.H5;
ulong num6 = this.H6;
ulong num7 = this.H7;
ulong num8 = this.H8;
for (int j = 0; j <= 79; j++)
{
ulong num9 = ((num5 >> 14) | (num5 << 50)) ^ ((num5 >> 18) | (num5 << 46)) ^ ((num5 >> 41) | (num5 << 23));
num9 += num8 + ((num5 & num6) ^ (~num5 & num7)) + k[j] + w[j];
ulong num10 = ((num >> 28) | (num << 36)) ^ ((num >> 34) | (num << 30)) ^ ((num >> 39) | (num << 25));
num10 += (num & num2) ^ (num & num3) ^ (num2 & num3);
num8 = num7;
num7 = num6;
num6 = num5;
num5 = num4 + num9;
num4 = num3;
num3 = num2;
num2 = num;
num = num9 + num10;
}
this.H1 += num;
this.H2 += num2;
this.H3 += num3;
this.H4 += num4;
this.H5 += num5;
this.H6 += num6;
this.H7 += num7;
this.H8 += num8;
this.wOff = 0;
for (int num11 = 0; num11 != w.Length; num11++)
{
w[num11] = 0UL;
}
}
// Token: 0x040013D7 RID: 5079
private byte[] xBuf;
// Token: 0x040013D8 RID: 5080
private int xBufOff;
// Token: 0x040013D9 RID: 5081
private ulong byteCount1;
// Token: 0x040013DA RID: 5082
private ulong byteCount2;
// Token: 0x040013DB RID: 5083
private ulong H1;
// Token: 0x040013DC RID: 5084
private ulong H2;
// Token: 0x040013DD RID: 5085
private ulong H3;
// Token: 0x040013DE RID: 5086
private ulong H4;
// Token: 0x040013DF RID: 5087
private ulong H5;
// Token: 0x040013E0 RID: 5088
private ulong H6;
// Token: 0x040013E1 RID: 5089
private ulong H7;
// Token: 0x040013E2 RID: 5090
private ulong H8;
// Token: 0x040013E3 RID: 5091
private ulong[] W;
// Token: 0x040013E4 RID: 5092
private int wOff;
}
}
@@ -0,0 +1,40 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA512" /> hash for the input data. </summary>
// Token: 0x02000532 RID: 1330
[ComVisible(true)]
public abstract class SHA512 : HashAlgorithm
{
/// <summary>Initializes a new instance of <see cref="T:System.Security.Cryptography.SHA512" />.</summary>
// Token: 0x060030B8 RID: 12472 RVA: 0x000A7710 File Offset: 0x000A5910
protected SHA512()
{
this.HashSizeValue = 512;
}
/// <summary>Creates an instance of the default implementation of <see cref="T:System.Security.Cryptography.SHA512" />.</summary>
/// <returns>A new instance of <see cref="T:System.Security.Cryptography.SHA512" />.</returns>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060030B9 RID: 12473 RVA: 0x000A7724 File Offset: 0x000A5924
public new static SHA512 Create()
{
return SHA512.Create("System.Security.Cryptography.SHA512");
}
/// <summary>Creates an instance of a specified implementation of <see cref="T:System.Security.Cryptography.SHA512" />.</summary>
/// <returns>A new instance of <see cref="T:System.Security.Cryptography.SHA512" /> using the specified implementation.</returns>
/// <param name="hashName">The name of the specific implementation of <see cref="T:System.Security.Cryptography.SHA512" /> to be used. </param>
/// <exception cref="T:System.Reflection.TargetInvocationException">The algorithm described by the <paramref name="hashName" /> parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.</exception>
// Token: 0x060030BA RID: 12474 RVA: 0x000A7730 File Offset: 0x000A5930
public new static SHA512 Create(string hashName)
{
return (SHA512)CryptoConfig.CreateFromName(hashName);
}
}
}
@@ -0,0 +1,296 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Computes the <see cref="T:System.Security.Cryptography.SHA512" /> hash algorithm for the input data using the managed library.</summary>
// Token: 0x02000533 RID: 1331
[ComVisible(true)]
public class SHA512Managed : SHA512
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SHA512Managed" /> class.</summary>
/// <exception cref="T:System.InvalidOperationException">The Federal Information Processing Standards (FIPS) security setting is enabled. This implementation is not part of the Windows Platform FIPS-validated cryptographic algorithms.</exception>
// Token: 0x060030BB RID: 12475 RVA: 0x000A7740 File Offset: 0x000A5940
public SHA512Managed()
{
this.xBuf = new byte[8];
this.W = new ulong[80];
this.Initialize(false);
}
// Token: 0x060030BC RID: 12476 RVA: 0x000A7774 File Offset: 0x000A5974
private void Initialize(bool reuse)
{
this.H1 = 7640891576956012808UL;
this.H2 = 13503953896175478587UL;
this.H3 = 4354685564936845355UL;
this.H4 = 11912009170470909681UL;
this.H5 = 5840696475078001361UL;
this.H6 = 11170449401992604703UL;
this.H7 = 2270897969802886507UL;
this.H8 = 6620516959819538809UL;
if (reuse)
{
this.byteCount1 = 0UL;
this.byteCount2 = 0UL;
this.xBufOff = 0;
for (int i = 0; i < this.xBuf.Length; i++)
{
this.xBuf[i] = 0;
}
this.wOff = 0;
for (int num = 0; num != this.W.Length; num++)
{
this.W[num] = 0UL;
}
}
}
/// <summary>Initializes an instance of the <see cref="T:System.Security.Cryptography.SHA512Managed" /> class using the managed library.</summary>
// Token: 0x060030BD RID: 12477 RVA: 0x000A7864 File Offset: 0x000A5A64
public override void Initialize()
{
this.Initialize(true);
}
/// <summary>When overridden in a derived class, routes data written to the object into the <see cref="T:System.Security.Cryptography.SHA512Managed" /> hash algorithm for computing the hash.</summary>
/// <param name="rgb">The input data. </param>
/// <param name="ibStart">The offset into the byte array from which to begin using data. </param>
/// <param name="cbSize">The number of bytes in the array to use as data. </param>
// Token: 0x060030BE RID: 12478 RVA: 0x000A7870 File Offset: 0x000A5A70
protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
{
while (this.xBufOff != 0 && cbSize > 0)
{
this.update(rgb[ibStart]);
ibStart++;
cbSize--;
}
while (cbSize > this.xBuf.Length)
{
this.processWord(rgb, ibStart);
ibStart += this.xBuf.Length;
cbSize -= this.xBuf.Length;
this.byteCount1 += (ulong)((long)this.xBuf.Length);
}
while (cbSize > 0)
{
this.update(rgb[ibStart]);
ibStart++;
cbSize--;
}
}
/// <summary>When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object.</summary>
/// <returns>The computed hash code.</returns>
// Token: 0x060030BF RID: 12479 RVA: 0x000A7910 File Offset: 0x000A5B10
protected override byte[] HashFinal()
{
this.adjustByteCounts();
ulong num = this.byteCount1 << 3;
ulong num2 = this.byteCount2;
this.update(128);
while (this.xBufOff != 0)
{
this.update(0);
}
this.processLength(num, num2);
this.processBlock();
byte[] array = new byte[64];
this.unpackWord(this.H1, array, 0);
this.unpackWord(this.H2, array, 8);
this.unpackWord(this.H3, array, 16);
this.unpackWord(this.H4, array, 24);
this.unpackWord(this.H5, array, 32);
this.unpackWord(this.H6, array, 40);
this.unpackWord(this.H7, array, 48);
this.unpackWord(this.H8, array, 56);
this.Initialize();
return array;
}
// Token: 0x060030C0 RID: 12480 RVA: 0x000A79E8 File Offset: 0x000A5BE8
private void update(byte input)
{
this.xBuf[this.xBufOff++] = input;
if (this.xBufOff == this.xBuf.Length)
{
this.processWord(this.xBuf, 0);
this.xBufOff = 0;
}
this.byteCount1 += 1UL;
}
// Token: 0x060030C1 RID: 12481 RVA: 0x000A7A44 File Offset: 0x000A5C44
private void processWord(byte[] input, int inOff)
{
this.W[this.wOff++] = ((ulong)input[inOff] << 56) | ((ulong)input[inOff + 1] << 48) | ((ulong)input[inOff + 2] << 40) | ((ulong)input[inOff + 3] << 32) | ((ulong)input[inOff + 4] << 24) | ((ulong)input[inOff + 5] << 16) | ((ulong)input[inOff + 6] << 8) | (ulong)input[inOff + 7];
if (this.wOff == 16)
{
this.processBlock();
}
}
// Token: 0x060030C2 RID: 12482 RVA: 0x000A7AC8 File Offset: 0x000A5CC8
private void unpackWord(ulong word, byte[] output, int outOff)
{
output[outOff] = (byte)(word >> 56);
output[outOff + 1] = (byte)(word >> 48);
output[outOff + 2] = (byte)(word >> 40);
output[outOff + 3] = (byte)(word >> 32);
output[outOff + 4] = (byte)(word >> 24);
output[outOff + 5] = (byte)(word >> 16);
output[outOff + 6] = (byte)(word >> 8);
output[outOff + 7] = (byte)word;
}
// Token: 0x060030C3 RID: 12483 RVA: 0x000A7B20 File Offset: 0x000A5D20
private void adjustByteCounts()
{
if (this.byteCount1 > 2305843009213693951UL)
{
this.byteCount2 += this.byteCount1 >> 61;
this.byteCount1 &= 2305843009213693951UL;
}
}
// Token: 0x060030C4 RID: 12484 RVA: 0x000A7B70 File Offset: 0x000A5D70
private void processLength(ulong lowW, ulong hiW)
{
if (this.wOff > 14)
{
this.processBlock();
}
this.W[14] = hiW;
this.W[15] = lowW;
}
// Token: 0x060030C5 RID: 12485 RVA: 0x000A7B9C File Offset: 0x000A5D9C
private void processBlock()
{
this.adjustByteCounts();
for (int i = 16; i <= 79; i++)
{
this.W[i] = this.Sigma1(this.W[i - 2]) + this.W[i - 7] + this.Sigma0(this.W[i - 15]) + this.W[i - 16];
}
ulong num = this.H1;
ulong num2 = this.H2;
ulong num3 = this.H3;
ulong num4 = this.H4;
ulong num5 = this.H5;
ulong num6 = this.H6;
ulong num7 = this.H7;
ulong num8 = this.H8;
for (int j = 0; j <= 79; j++)
{
ulong num9 = num8 + this.Sum1(num5) + this.Ch(num5, num6, num7) + SHAConstants.K2[j] + this.W[j];
ulong num10 = this.Sum0(num) + this.Maj(num, num2, num3);
num8 = num7;
num7 = num6;
num6 = num5;
num5 = num4 + num9;
num4 = num3;
num3 = num2;
num2 = num;
num = num9 + num10;
}
this.H1 += num;
this.H2 += num2;
this.H3 += num3;
this.H4 += num4;
this.H5 += num5;
this.H6 += num6;
this.H7 += num7;
this.H8 += num8;
this.wOff = 0;
for (int num11 = 0; num11 != this.W.Length; num11++)
{
this.W[num11] = 0UL;
}
}
// Token: 0x060030C6 RID: 12486 RVA: 0x000A7D5C File Offset: 0x000A5F5C
private ulong rotateRight(ulong x, int n)
{
return (x >> n) | (x << 64 - n);
}
// Token: 0x060030C7 RID: 12487 RVA: 0x000A7D70 File Offset: 0x000A5F70
private ulong Ch(ulong x, ulong y, ulong z)
{
return (x & y) ^ (~x & z);
}
// Token: 0x060030C8 RID: 12488 RVA: 0x000A7D7C File Offset: 0x000A5F7C
private ulong Maj(ulong x, ulong y, ulong z)
{
return (x & y) ^ (x & z) ^ (y & z);
}
// Token: 0x060030C9 RID: 12489 RVA: 0x000A7D8C File Offset: 0x000A5F8C
private ulong Sum0(ulong x)
{
return this.rotateRight(x, 28) ^ this.rotateRight(x, 34) ^ this.rotateRight(x, 39);
}
// Token: 0x060030CA RID: 12490 RVA: 0x000A7DB8 File Offset: 0x000A5FB8
private ulong Sum1(ulong x)
{
return this.rotateRight(x, 14) ^ this.rotateRight(x, 18) ^ this.rotateRight(x, 41);
}
// Token: 0x060030CB RID: 12491 RVA: 0x000A7DE4 File Offset: 0x000A5FE4
private ulong Sigma0(ulong x)
{
return this.rotateRight(x, 1) ^ this.rotateRight(x, 8) ^ (x >> 7);
}
// Token: 0x060030CC RID: 12492 RVA: 0x000A7DFC File Offset: 0x000A5FFC
private ulong Sigma1(ulong x)
{
return this.rotateRight(x, 19) ^ this.rotateRight(x, 61) ^ (x >> 6);
}
// Token: 0x040013E5 RID: 5093
private byte[] xBuf;
// Token: 0x040013E6 RID: 5094
private int xBufOff;
// Token: 0x040013E7 RID: 5095
private ulong byteCount1;
// Token: 0x040013E8 RID: 5096
private ulong byteCount2;
// Token: 0x040013E9 RID: 5097
private ulong H1;
// Token: 0x040013EA RID: 5098
private ulong H2;
// Token: 0x040013EB RID: 5099
private ulong H3;
// Token: 0x040013EC RID: 5100
private ulong H4;
// Token: 0x040013ED RID: 5101
private ulong H5;
// Token: 0x040013EE RID: 5102
private ulong H6;
// Token: 0x040013EF RID: 5103
private ulong H7;
// Token: 0x040013F0 RID: 5104
private ulong H8;
// Token: 0x040013F1 RID: 5105
private ulong[] W;
// Token: 0x040013F2 RID: 5106
private int wOff;
}
}
@@ -0,0 +1,33 @@
using System;
namespace System.Security.Cryptography
{
// Token: 0x02000534 RID: 1332
internal static class SHAConstants
{
// Token: 0x040013F3 RID: 5107
public static readonly uint[] K1 = new uint[]
{
1116352408U, 1899447441U, 3049323471U, 3921009573U, 961987163U, 1508970993U, 2453635748U, 2870763221U, 3624381080U, 310598401U,
607225278U, 1426881987U, 1925078388U, 2162078206U, 2614888103U, 3248222580U, 3835390401U, 4022224774U, 264347078U, 604807628U,
770255983U, 1249150122U, 1555081692U, 1996064986U, 2554220882U, 2821834349U, 2952996808U, 3210313671U, 3336571891U, 3584528711U,
113926993U, 338241895U, 666307205U, 773529912U, 1294757372U, 1396182291U, 1695183700U, 1986661051U, 2177026350U, 2456956037U,
2730485921U, 2820302411U, 3259730800U, 3345764771U, 3516065817U, 3600352804U, 4094571909U, 275423344U, 430227734U, 506948616U,
659060556U, 883997877U, 958139571U, 1322822218U, 1537002063U, 1747873779U, 1955562222U, 2024104815U, 2227730452U, 2361852424U,
2428436474U, 2756734187U, 3204031479U, 3329325298U
};
// Token: 0x040013F4 RID: 5108
public static readonly ulong[] K2 = new ulong[]
{
4794697086780616226UL, 8158064640168781261UL, 13096744586834688815UL, 16840607885511220156UL, 4131703408338449720UL, 6480981068601479193UL, 10538285296894168987UL, 12329834152419229976UL, 15566598209576043074UL, 1334009975649890238UL,
2608012711638119052UL, 6128411473006802146UL, 8268148722764581231UL, 9286055187155687089UL, 11230858885718282805UL, 13951009754708518548UL, 16472876342353939154UL, 17275323862435702243UL, 1135362057144423861UL, 2597628984639134821UL,
3308224258029322869UL, 5365058923640841347UL, 6679025012923562964UL, 8573033837759648693UL, 10970295158949994411UL, 12119686244451234320UL, 12683024718118986047UL, 13788192230050041572UL, 14330467153632333762UL, 15395433587784984357UL,
489312712824947311UL, 1452737877330783856UL, 2861767655752347644UL, 3322285676063803686UL, 5560940570517711597UL, 5996557281743188959UL, 7280758554555802590UL, 8532644243296465576UL, 9350256976987008742UL, 10552545826968843579UL,
11727347734174303076UL, 12113106623233404929UL, 14000437183269869457UL, 14369950271660146224UL, 15101387698204529176UL, 15463397548674623760UL, 17586052441742319658UL, 1182934255886127544UL, 1847814050463011016UL, 2177327727835720531UL,
2830643537854262169UL, 3796741975233480872UL, 4115178125766777443UL, 5681478168544905931UL, 6601373596472566643UL, 7507060721942968483UL, 8399075790359081724UL, 8693463985226723168UL, 9568029438360202098UL, 10144078919501101548UL,
10430055236837252648UL, 11840083180663258601UL, 13761210420658862357UL, 14299343276471374635UL, 14566680578165727644UL, 15097957966210449927UL, 16922976911328602910UL, 17689382322260857208UL, 500013540394364858UL, 748580250866718886UL,
1242879168328830382UL, 1977374033974150939UL, 2944078676154940804UL, 3659926193048069267UL, 4368137639120453308UL, 4836135668995329356UL, 5532061633213252278UL, 6448918945643986474UL, 6902733635092675308UL, 7801388544844847127UL
};
}
}
@@ -0,0 +1,170 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Contains information about the properties of a digital signature.</summary>
// Token: 0x02000535 RID: 1333
[ComVisible(true)]
public class SignatureDescription
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SignatureDescription" /> class.</summary>
// Token: 0x060030CE RID: 12494 RVA: 0x000A7E54 File Offset: 0x000A6054
public SignatureDescription()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SignatureDescription" /> class from the specified <see cref="T:System.Security.SecurityElement" />.</summary>
/// <param name="el">The <see cref="T:System.Security.SecurityElement" /> from which to get the algorithms for the signature description. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="el" /> parameter is null.</exception>
// Token: 0x060030CF RID: 12495 RVA: 0x000A7E5C File Offset: 0x000A605C
public SignatureDescription(SecurityElement el)
{
if (el == null)
{
throw new ArgumentNullException("el");
}
SecurityElement securityElement = el.SearchForChildByTag("Deformatter");
this._DeformatterAlgorithm = ((securityElement != null) ? securityElement.Text : null);
securityElement = el.SearchForChildByTag("Digest");
this._DigestAlgorithm = ((securityElement != null) ? securityElement.Text : null);
securityElement = el.SearchForChildByTag("Formatter");
this._FormatterAlgorithm = ((securityElement != null) ? securityElement.Text : null);
securityElement = el.SearchForChildByTag("Key");
this._KeyAlgorithm = ((securityElement != null) ? securityElement.Text : null);
}
/// <summary>Gets or sets the deformatter algorithm for the signature description.</summary>
/// <returns>The deformatter algorithm for the signature description.</returns>
// Token: 0x1700098B RID: 2443
// (get) Token: 0x060030D0 RID: 12496 RVA: 0x000A7F10 File Offset: 0x000A6110
// (set) Token: 0x060030D1 RID: 12497 RVA: 0x000A7F18 File Offset: 0x000A6118
public string DeformatterAlgorithm
{
get
{
return this._DeformatterAlgorithm;
}
set
{
this._DeformatterAlgorithm = value;
}
}
/// <summary>Gets or sets the digest algorithm for the signature description.</summary>
/// <returns>The digest algorithm for the signature description.</returns>
// Token: 0x1700098C RID: 2444
// (get) Token: 0x060030D2 RID: 12498 RVA: 0x000A7F24 File Offset: 0x000A6124
// (set) Token: 0x060030D3 RID: 12499 RVA: 0x000A7F2C File Offset: 0x000A612C
public string DigestAlgorithm
{
get
{
return this._DigestAlgorithm;
}
set
{
this._DigestAlgorithm = value;
}
}
/// <summary>Gets or sets the formatter algorithm for the signature description.</summary>
/// <returns>The formatter algorithm for the signature description.</returns>
// Token: 0x1700098D RID: 2445
// (get) Token: 0x060030D4 RID: 12500 RVA: 0x000A7F38 File Offset: 0x000A6138
// (set) Token: 0x060030D5 RID: 12501 RVA: 0x000A7F40 File Offset: 0x000A6140
public string FormatterAlgorithm
{
get
{
return this._FormatterAlgorithm;
}
set
{
this._FormatterAlgorithm = value;
}
}
/// <summary>Gets or sets the key algorithm for the signature description.</summary>
/// <returns>The key algorithm for the signature description.</returns>
// Token: 0x1700098E RID: 2446
// (get) Token: 0x060030D6 RID: 12502 RVA: 0x000A7F4C File Offset: 0x000A614C
// (set) Token: 0x060030D7 RID: 12503 RVA: 0x000A7F54 File Offset: 0x000A6154
public string KeyAlgorithm
{
get
{
return this._KeyAlgorithm;
}
set
{
this._KeyAlgorithm = value;
}
}
/// <summary>Creates an <see cref="T:System.Security.Cryptography.AsymmetricSignatureDeformatter" /> instance with the specified key using the <see cref="P:System.Security.Cryptography.SignatureDescription.DeformatterAlgorithm" /> property.</summary>
/// <returns>The newly created <see cref="T:System.Security.Cryptography.AsymmetricSignatureDeformatter" /> instance.</returns>
/// <param name="key">The key to use in the <see cref="T:System.Security.Cryptography.AsymmetricSignatureDeformatter" />. </param>
// Token: 0x060030D8 RID: 12504 RVA: 0x000A7F60 File Offset: 0x000A6160
public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
{
if (this._DeformatterAlgorithm == null)
{
throw new ArgumentNullException("DeformatterAlgorithm");
}
AsymmetricSignatureDeformatter asymmetricSignatureDeformatter = (AsymmetricSignatureDeformatter)CryptoConfig.CreateFromName(this._DeformatterAlgorithm);
if (this._KeyAlgorithm == null)
{
throw new NullReferenceException("KeyAlgorithm");
}
asymmetricSignatureDeformatter.SetKey(key);
return asymmetricSignatureDeformatter;
}
/// <summary>Creates a <see cref="T:System.Security.Cryptography.HashAlgorithm" /> instance using the <see cref="P:System.Security.Cryptography.SignatureDescription.DigestAlgorithm" /> property.</summary>
/// <returns>The newly created <see cref="T:System.Security.Cryptography.HashAlgorithm" /> instance.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060030D9 RID: 12505 RVA: 0x000A7FB4 File Offset: 0x000A61B4
public virtual HashAlgorithm CreateDigest()
{
if (this._DigestAlgorithm == null)
{
throw new ArgumentNullException("DigestAlgorithm");
}
return (HashAlgorithm)CryptoConfig.CreateFromName(this._DigestAlgorithm);
}
/// <summary>Creates an <see cref="T:System.Security.Cryptography.AsymmetricSignatureFormatter" /> instance with the specified key using the <see cref="P:System.Security.Cryptography.SignatureDescription.FormatterAlgorithm" /> property.</summary>
/// <returns>The newly created <see cref="T:System.Security.Cryptography.AsymmetricSignatureFormatter" /> instance.</returns>
/// <param name="key">The key to use in the <see cref="T:System.Security.Cryptography.AsymmetricSignatureFormatter" />. </param>
// Token: 0x060030DA RID: 12506 RVA: 0x000A7FE8 File Offset: 0x000A61E8
public virtual AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key)
{
if (this._FormatterAlgorithm == null)
{
throw new ArgumentNullException("FormatterAlgorithm");
}
AsymmetricSignatureFormatter asymmetricSignatureFormatter = (AsymmetricSignatureFormatter)CryptoConfig.CreateFromName(this._FormatterAlgorithm);
if (this._KeyAlgorithm == null)
{
throw new NullReferenceException("KeyAlgorithm");
}
asymmetricSignatureFormatter.SetKey(key);
return asymmetricSignatureFormatter;
}
// Token: 0x040013F5 RID: 5109
private string _DeformatterAlgorithm;
// Token: 0x040013F6 RID: 5110
private string _DigestAlgorithm;
// Token: 0x040013F7 RID: 5111
private string _FormatterAlgorithm;
// Token: 0x040013F8 RID: 5112
private string _KeyAlgorithm;
}
}
@@ -0,0 +1,370 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the abstract base class from which all implementations of symmetric algorithms must inherit.</summary>
// Token: 0x02000538 RID: 1336
[ComVisible(true)]
public abstract class SymmetricAlgorithm : IDisposable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SymmetricAlgorithm" /> class.</summary>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The implementation of the class derived from the symmetric algorithm is not valid.</exception>
// Token: 0x060030DE RID: 12510 RVA: 0x000A80C8 File Offset: 0x000A62C8
protected SymmetricAlgorithm()
{
this.ModeValue = CipherMode.CBC;
this.PaddingValue = PaddingMode.PKCS7;
this.m_disposed = false;
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.SymmetricAlgorithm" /> and optionally releases the managed resources. </summary>
// Token: 0x060030DF RID: 12511 RVA: 0x000A80E8 File Offset: 0x000A62E8
void IDisposable.Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
// Token: 0x060030E0 RID: 12512 RVA: 0x000A80F8 File Offset: 0x000A62F8
~SymmetricAlgorithm()
{
this.Dispose(false);
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.SymmetricAlgorithm" /> class.</summary>
// Token: 0x060030E1 RID: 12513 RVA: 0x000A8134 File Offset: 0x000A6334
public void Clear()
{
this.Dispose(true);
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.SymmetricAlgorithm" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x060030E2 RID: 12514 RVA: 0x000A8140 File Offset: 0x000A6340
protected virtual void Dispose(bool disposing)
{
if (!this.m_disposed)
{
if (this.KeyValue != null)
{
Array.Clear(this.KeyValue, 0, this.KeyValue.Length);
this.KeyValue = null;
}
if (disposing)
{
}
this.m_disposed = true;
}
}
/// <summary>Gets or sets the block size, in bits, of the cryptographic operation.</summary>
/// <returns>The block size, in bits.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The block size is invalid. </exception>
// Token: 0x1700098F RID: 2447
// (get) Token: 0x060030E3 RID: 12515 RVA: 0x000A818C File Offset: 0x000A638C
// (set) Token: 0x060030E4 RID: 12516 RVA: 0x000A8194 File Offset: 0x000A6394
public virtual int BlockSize
{
get
{
return this.BlockSizeValue;
}
set
{
if (!KeySizes.IsLegalKeySize(this.LegalBlockSizesValue, value))
{
throw new CryptographicException(Locale.GetText("block size not supported by algorithm"));
}
if (this.BlockSizeValue != value)
{
this.BlockSizeValue = value;
this.IVValue = null;
}
}
}
/// <summary>Gets or sets the feedback size, in bits, of the cryptographic operation.</summary>
/// <returns>The feedback size in bits.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The feedback size is larger than the block size. </exception>
// Token: 0x17000990 RID: 2448
// (get) Token: 0x060030E5 RID: 12517 RVA: 0x000A81D4 File Offset: 0x000A63D4
// (set) Token: 0x060030E6 RID: 12518 RVA: 0x000A81DC File Offset: 0x000A63DC
public virtual int FeedbackSize
{
get
{
return this.FeedbackSizeValue;
}
set
{
if (value <= 0 || value > this.BlockSizeValue)
{
throw new CryptographicException(Locale.GetText("feedback size larger than block size"));
}
this.FeedbackSizeValue = value;
}
}
/// <summary>Gets or sets the initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />) for the symmetric algorithm.</summary>
/// <returns>The initialization vector.</returns>
/// <exception cref="T:System.ArgumentNullException">An attempt was made to set the initialization vector to null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An attempt was made to set the initialization vector to an invalid size. </exception>
// Token: 0x17000991 RID: 2449
// (get) Token: 0x060030E7 RID: 12519 RVA: 0x000A8214 File Offset: 0x000A6414
// (set) Token: 0x060030E8 RID: 12520 RVA: 0x000A8238 File Offset: 0x000A6438
public virtual byte[] IV
{
get
{
if (this.IVValue == null)
{
this.GenerateIV();
}
return (byte[])this.IVValue.Clone();
}
set
{
if (value == null)
{
throw new ArgumentNullException("IV");
}
if (value.Length << 3 != this.BlockSizeValue)
{
throw new CryptographicException(Locale.GetText("IV length is different than block size"));
}
this.IVValue = (byte[])value.Clone();
}
}
/// <summary>Gets or sets the secret key for the symmetric algorithm.</summary>
/// <returns>The secret key to use for the symmetric algorithm.</returns>
/// <exception cref="T:System.ArgumentNullException">An attempt was made to set the key to null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key size is invalid.</exception>
// Token: 0x17000992 RID: 2450
// (get) Token: 0x060030E9 RID: 12521 RVA: 0x000A8288 File Offset: 0x000A6488
// (set) Token: 0x060030EA RID: 12522 RVA: 0x000A82AC File Offset: 0x000A64AC
public virtual byte[] Key
{
get
{
if (this.KeyValue == null)
{
this.GenerateKey();
}
return (byte[])this.KeyValue.Clone();
}
set
{
if (value == null)
{
throw new ArgumentNullException("Key");
}
int num = value.Length << 3;
if (!KeySizes.IsLegalKeySize(this.LegalKeySizesValue, num))
{
throw new CryptographicException(Locale.GetText("Key size not supported by algorithm"));
}
this.KeySizeValue = num;
this.KeyValue = (byte[])value.Clone();
}
}
/// <summary>Gets or sets the size, in bits, of the secret key used by the symmetric algorithm.</summary>
/// <returns>The size, in bits, of the secret key used by the symmetric algorithm.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key size is not valid. </exception>
// Token: 0x17000993 RID: 2451
// (get) Token: 0x060030EB RID: 12523 RVA: 0x000A830C File Offset: 0x000A650C
// (set) Token: 0x060030EC RID: 12524 RVA: 0x000A8314 File Offset: 0x000A6514
public virtual int KeySize
{
get
{
return this.KeySizeValue;
}
set
{
if (!KeySizes.IsLegalKeySize(this.LegalKeySizesValue, value))
{
throw new CryptographicException(Locale.GetText("Key size not supported by algorithm"));
}
this.KeySizeValue = value;
this.KeyValue = null;
}
}
/// <summary>Gets the block sizes, in bits, that are supported by the symmetric algorithm.</summary>
/// <returns>An array that contains the block sizes supported by the algorithm.</returns>
// Token: 0x17000994 RID: 2452
// (get) Token: 0x060030ED RID: 12525 RVA: 0x000A8348 File Offset: 0x000A6548
public virtual KeySizes[] LegalBlockSizes
{
get
{
return this.LegalBlockSizesValue;
}
}
/// <summary>Gets the key sizes, in bits, that are supported by the symmetric algorithm.</summary>
/// <returns>An array that contains the key sizes supported by the algorithm.</returns>
// Token: 0x17000995 RID: 2453
// (get) Token: 0x060030EE RID: 12526 RVA: 0x000A8350 File Offset: 0x000A6550
public virtual KeySizes[] LegalKeySizes
{
get
{
return this.LegalKeySizesValue;
}
}
/// <summary>Gets or sets the mode for operation of the symmetric algorithm.</summary>
/// <returns>The mode for operation of the symmetric algorithm. The default is <see cref="F:System.Security.Cryptography.CipherMode.CBC" />.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The cipher mode is not one of the <see cref="T:System.Security.Cryptography.CipherMode" /> values. </exception>
// Token: 0x17000996 RID: 2454
// (get) Token: 0x060030EF RID: 12527 RVA: 0x000A8358 File Offset: 0x000A6558
// (set) Token: 0x060030F0 RID: 12528 RVA: 0x000A8360 File Offset: 0x000A6560
public virtual CipherMode Mode
{
get
{
return this.ModeValue;
}
set
{
if (!Enum.IsDefined(this.ModeValue.GetType(), value))
{
throw new CryptographicException(Locale.GetText("Cipher mode not available"));
}
this.ModeValue = value;
}
}
/// <summary>Gets or sets the padding mode used in the symmetric algorithm.</summary>
/// <returns>The padding mode used in the symmetric algorithm. The default is <see cref="F:System.Security.Cryptography.PaddingMode.PKCS7" />.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The padding mode is not one of the <see cref="T:System.Security.Cryptography.PaddingMode" /> values. </exception>
// Token: 0x17000997 RID: 2455
// (get) Token: 0x060030F1 RID: 12529 RVA: 0x000A839C File Offset: 0x000A659C
// (set) Token: 0x060030F2 RID: 12530 RVA: 0x000A83A4 File Offset: 0x000A65A4
public virtual PaddingMode Padding
{
get
{
return this.PaddingValue;
}
set
{
if (!Enum.IsDefined(this.PaddingValue.GetType(), value))
{
throw new CryptographicException(Locale.GetText("Padding mode not available"));
}
this.PaddingValue = value;
}
}
/// <summary>Creates a symmetric decryptor object with the current <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" /> property and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric decryptor object.</returns>
// Token: 0x060030F3 RID: 12531 RVA: 0x000A83E0 File Offset: 0x000A65E0
public virtual ICryptoTransform CreateDecryptor()
{
return this.CreateDecryptor(this.Key, this.IV);
}
/// <summary>When overridden in a derived class, creates a symmetric decryptor object with the specified <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" /> property and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric decryptor object.</returns>
/// <param name="rgbKey">The secret key to use for the symmetric algorithm. </param>
/// <param name="rgbIV">The initialization vector to use for the symmetric algorithm. </param>
// Token: 0x060030F4 RID: 12532
public abstract ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV);
/// <summary>Creates a symmetric encryptor object with the current <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" /> property and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric encryptor object.</returns>
// Token: 0x060030F5 RID: 12533 RVA: 0x000A83F4 File Offset: 0x000A65F4
public virtual ICryptoTransform CreateEncryptor()
{
return this.CreateEncryptor(this.Key, this.IV);
}
/// <summary>When overridden in a derived class, creates a symmetric encryptor object with the specified <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" /> property and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric encryptor object.</returns>
/// <param name="rgbKey">The secret key to use for the symmetric algorithm. </param>
/// <param name="rgbIV">The initialization vector to use for the symmetric algorithm. </param>
// Token: 0x060030F6 RID: 12534
public abstract ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV);
/// <summary>When overridden in a derived class, generates a random initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />) to use for the algorithm.</summary>
// Token: 0x060030F7 RID: 12535
public abstract void GenerateIV();
/// <summary>When overridden in a derived class, generates a random key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />) to use for the algorithm.</summary>
// Token: 0x060030F8 RID: 12536
public abstract void GenerateKey();
/// <summary>Determines whether the specified key size is valid for the current algorithm.</summary>
/// <returns>true if the specified key size is valid for the current algorithm; otherwise, false.</returns>
/// <param name="bitLength">The length, in bits, to check for a valid key size. </param>
// Token: 0x060030F9 RID: 12537 RVA: 0x000A8408 File Offset: 0x000A6608
public bool ValidKeySize(int bitLength)
{
return KeySizes.IsLegalKeySize(this.LegalKeySizesValue, bitLength);
}
/// <summary>Creates a default cryptographic object used to perform the symmetric algorithm.</summary>
/// <returns>A default cryptographic object used to perform the symmetric algorithm.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060030FA RID: 12538 RVA: 0x000A8418 File Offset: 0x000A6618
public static SymmetricAlgorithm Create()
{
return SymmetricAlgorithm.Create("System.Security.Cryptography.SymmetricAlgorithm");
}
/// <summary>Creates the specified cryptographic object used to perform the symmetric algorithm.</summary>
/// <returns>A cryptographic object used to perform the symmetric algorithm.</returns>
/// <param name="algName">The name of the specific implementation of the <see cref="T:System.Security.Cryptography.SymmetricAlgorithm" /> class to use. </param>
// Token: 0x060030FB RID: 12539 RVA: 0x000A8424 File Offset: 0x000A6624
public static SymmetricAlgorithm Create(string algName)
{
return (SymmetricAlgorithm)CryptoConfig.CreateFromName(algName);
}
/// <summary>Represents the block size, in bits, of the cryptographic operation.</summary>
// Token: 0x040013F9 RID: 5113
protected int BlockSizeValue;
/// <summary>Represents the initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />) for the symmetric algorithm.</summary>
// Token: 0x040013FA RID: 5114
protected byte[] IVValue;
/// <summary>Represents the size, in bits, of the secret key used by the symmetric algorithm.</summary>
// Token: 0x040013FB RID: 5115
protected int KeySizeValue;
/// <summary>Represents the secret key for the symmetric algorithm.</summary>
// Token: 0x040013FC RID: 5116
protected byte[] KeyValue;
/// <summary>Specifies the block sizes, in bits, that are supported by the symmetric algorithm.</summary>
// Token: 0x040013FD RID: 5117
protected KeySizes[] LegalBlockSizesValue;
/// <summary>Specifies the key sizes, in bits, that are supported by the symmetric algorithm.</summary>
// Token: 0x040013FE RID: 5118
protected KeySizes[] LegalKeySizesValue;
/// <summary>Represents the feedback size, in bits, of the cryptographic operation.</summary>
// Token: 0x040013FF RID: 5119
protected int FeedbackSizeValue;
/// <summary>Represents the cipher mode used in the symmetric algorithm.</summary>
// Token: 0x04001400 RID: 5120
protected CipherMode ModeValue;
/// <summary>Represents the padding mode used in the symmetric algorithm.</summary>
// Token: 0x04001401 RID: 5121
protected PaddingMode PaddingValue;
// Token: 0x04001402 RID: 5122
private bool m_disposed;
}
}
@@ -0,0 +1,248 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Converts a <see cref="T:System.Security.Cryptography.CryptoStream" /> to base 64.</summary>
// Token: 0x02000539 RID: 1337
[ComVisible(true)]
public class ToBase64Transform : IDisposable, ICryptoTransform
{
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.ToBase64Transform" />.</summary>
// Token: 0x060030FD RID: 12541 RVA: 0x000A843C File Offset: 0x000A663C
void IDisposable.Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.ToBase64Transform" />.</summary>
// Token: 0x060030FE RID: 12542 RVA: 0x000A844C File Offset: 0x000A664C
~ToBase64Transform()
{
this.Dispose(false);
}
/// <summary>Gets a value that indicates whether multiple blocks can be transformed.</summary>
/// <returns>Always false.</returns>
// Token: 0x17000998 RID: 2456
// (get) Token: 0x060030FF RID: 12543 RVA: 0x000A8488 File Offset: 0x000A6688
public bool CanTransformMultipleBlocks
{
get
{
return false;
}
}
/// <summary>Gets a value indicating whether the current transform can be reused.</summary>
/// <returns>Always true.</returns>
// Token: 0x17000999 RID: 2457
// (get) Token: 0x06003100 RID: 12544 RVA: 0x000A848C File Offset: 0x000A668C
public virtual bool CanReuseTransform
{
get
{
return true;
}
}
/// <summary>Gets the input block size.</summary>
/// <returns>The size of the input data blocks in bytes.</returns>
// Token: 0x1700099A RID: 2458
// (get) Token: 0x06003101 RID: 12545 RVA: 0x000A8490 File Offset: 0x000A6690
public int InputBlockSize
{
get
{
return 3;
}
}
/// <summary>Gets the output block size.</summary>
/// <returns>The size of the output data blocks in bytes.</returns>
// Token: 0x1700099B RID: 2459
// (get) Token: 0x06003102 RID: 12546 RVA: 0x000A8494 File Offset: 0x000A6694
public int OutputBlockSize
{
get
{
return 4;
}
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Cryptography.ToBase64Transform" />.</summary>
// Token: 0x06003103 RID: 12547 RVA: 0x000A8498 File Offset: 0x000A6698
public void Clear()
{
this.Dispose(true);
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Cryptography.ToBase64Transform" /> and optionally releases the managed resources.</summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06003104 RID: 12548 RVA: 0x000A84A4 File Offset: 0x000A66A4
protected virtual void Dispose(bool disposing)
{
if (!this.m_disposed)
{
if (disposing)
{
}
this.m_disposed = true;
}
}
/// <summary>Converts the specified region of the input byte array to base 64 and copies the result to the specified region of the output byte array.</summary>
/// <returns>The number of bytes written.</returns>
/// <param name="inputBuffer">The input to compute to base 64. </param>
/// <param name="inputOffset">The offset into the input byte array from which to begin using data. </param>
/// <param name="inputCount">The number of bytes in the input byte array to use as data. </param>
/// <param name="outputBuffer">The output to which to write the result. </param>
/// <param name="outputOffset">The offset into the output byte array from which to begin writing data. </param>
/// <exception cref="T:System.ObjectDisposedException">The current <see cref="T:System.Security.Cryptography.ToBase64Transform" /> object has already been disposed. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The data size is not valid. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="inputBuffer" /> parameter contains an invalid offset length.-or-The <paramref name="inputCount" /> parameter contains an invalid value.</exception>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="inputBuffer" /> parameter is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="inputBuffer" /> parameter requires a non-negative number.</exception>
// Token: 0x06003105 RID: 12549 RVA: 0x000A84C0 File Offset: 0x000A66C0
public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
if (this.m_disposed)
{
throw new ObjectDisposedException("TransformBlock");
}
if (inputBuffer == null)
{
throw new ArgumentNullException("inputBuffer");
}
if (outputBuffer == null)
{
throw new ArgumentNullException("outputBuffer");
}
if (inputCount < 0)
{
throw new ArgumentException("inputCount", "< 0");
}
if (inputCount > inputBuffer.Length)
{
throw new ArgumentException("inputCount", Locale.GetText("Overflow"));
}
if (inputOffset < 0)
{
throw new ArgumentOutOfRangeException("inputOffset", "< 0");
}
if (inputOffset > inputBuffer.Length - inputCount)
{
throw new ArgumentException("inputOffset", Locale.GetText("Overflow"));
}
if (outputOffset < 0)
{
throw new ArgumentOutOfRangeException("outputOffset", "< 0");
}
if (outputOffset > outputBuffer.Length - inputCount)
{
throw new ArgumentException("outputOffset", Locale.GetText("Overflow"));
}
ToBase64Transform.InternalTransformBlock(inputBuffer, inputOffset, inputCount, outputBuffer, outputOffset);
return this.OutputBlockSize;
}
// Token: 0x06003106 RID: 12550 RVA: 0x000A85C0 File Offset: 0x000A67C0
internal static void InternalTransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
byte[] encodeTable = Base64Constants.EncodeTable;
int num = (int)inputBuffer[inputOffset];
int num2 = (int)inputBuffer[inputOffset + 1];
int num3 = (int)inputBuffer[inputOffset + 2];
outputBuffer[outputOffset] = encodeTable[num >> 2];
outputBuffer[outputOffset + 1] = encodeTable[((num << 4) & 48) | (num2 >> 4)];
outputBuffer[outputOffset + 2] = encodeTable[((num2 << 2) & 60) | (num3 >> 6)];
outputBuffer[outputOffset + 3] = encodeTable[num3 & 63];
}
/// <summary>Converts the specified region of the specified byte array to base 64.</summary>
/// <returns>The computed base 64 conversion.</returns>
/// <param name="inputBuffer">The input to convert to base 64. </param>
/// <param name="inputOffset">The offset into the byte array from which to begin using data. </param>
/// <param name="inputCount">The number of bytes in the byte array to use as data. </param>
/// <exception cref="T:System.ObjectDisposedException">The current <see cref="T:System.Security.Cryptography.ToBase64Transform" /> object has already been disposed. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="inputBuffer" /> parameter contains an invalid offset length.-or-The <paramref name="inputCount" /> parameter contains an invalid value.</exception>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="inputBuffer" /> parameter is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="inputBuffer" /> parameter requires a non-negative number.</exception>
// Token: 0x06003107 RID: 12551 RVA: 0x000A861C File Offset: 0x000A681C
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
if (this.m_disposed)
{
throw new ObjectDisposedException("TransformFinalBlock");
}
if (inputBuffer == null)
{
throw new ArgumentNullException("inputBuffer");
}
if (inputCount < 0)
{
throw new ArgumentException("inputCount", "< 0");
}
if (inputOffset > inputBuffer.Length - inputCount)
{
throw new ArgumentException("inputCount", Locale.GetText("Overflow"));
}
if (inputCount > this.InputBlockSize)
{
throw new ArgumentOutOfRangeException(Locale.GetText("Invalid input length"));
}
return ToBase64Transform.InternalTransformFinalBlock(inputBuffer, inputOffset, inputCount);
}
// Token: 0x06003108 RID: 12552 RVA: 0x000A86AC File Offset: 0x000A68AC
internal static byte[] InternalTransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
int num = 3;
int num2 = 4;
int num3 = inputCount / num;
int num4 = inputCount % num;
byte[] array = new byte[(inputCount == 0) ? 0 : ((inputCount + 2) / num * num2)];
int num5 = 0;
for (int i = 0; i < num3; i++)
{
ToBase64Transform.InternalTransformBlock(inputBuffer, inputOffset, num, array, num5);
inputOffset += num;
num5 += num2;
}
byte[] encodeTable = Base64Constants.EncodeTable;
switch (num4)
{
case 1:
{
int num6 = (int)inputBuffer[inputOffset];
array[num5] = encodeTable[num6 >> 2];
array[num5 + 1] = encodeTable[(num6 << 4) & 48];
array[num5 + 2] = 61;
array[num5 + 3] = 61;
break;
}
case 2:
{
int num6 = (int)inputBuffer[inputOffset];
int num7 = (int)inputBuffer[inputOffset + 1];
array[num5] = encodeTable[num6 >> 2];
array[num5 + 1] = encodeTable[((num6 << 4) & 48) | (num7 >> 4)];
array[num5 + 2] = encodeTable[(num7 << 2) & 60];
array[num5 + 3] = 61;
break;
}
}
return array;
}
// Token: 0x04001403 RID: 5123
private const int inputBlockSize = 3;
// Token: 0x04001404 RID: 5124
private const int outputBlockSize = 4;
// Token: 0x04001405 RID: 5125
private bool m_disposed;
}
}
@@ -0,0 +1,129 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// <summary>Represents the base class for Triple Data Encryption Standard algorithms from which all <see cref="T:System.Security.Cryptography.TripleDES" /> implementations must derive.</summary>
// Token: 0x0200053A RID: 1338
[ComVisible(true)]
public abstract class TripleDES : SymmetricAlgorithm
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.TripleDES" /> class.</summary>
// Token: 0x06003109 RID: 12553 RVA: 0x000A87C0 File Offset: 0x000A69C0
protected TripleDES()
{
this.KeySizeValue = 192;
this.BlockSizeValue = 64;
this.FeedbackSizeValue = 8;
this.LegalKeySizesValue = new KeySizes[1];
this.LegalKeySizesValue[0] = new KeySizes(128, 192, 64);
this.LegalBlockSizesValue = new KeySizes[1];
this.LegalBlockSizesValue[0] = new KeySizes(64, 64, 0);
}
/// <summary>Gets or sets the secret key for the <see cref="T:System.Security.Cryptography.TripleDES" /> algorithm.</summary>
/// <returns>The secret key for the <see cref="T:System.Security.Cryptography.TripleDES" /> algorithm.</returns>
/// <exception cref="T:System.ArgumentNullException">An attempt was made to set the key to null. </exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An attempt was made to set a key whose length is invalid.-or- An attempt was made to set a weak key (see <see cref="M:System.Security.Cryptography.TripleDES.IsWeakKey(System.Byte[])" />). </exception>
// Token: 0x1700099C RID: 2460
// (get) Token: 0x0600310A RID: 12554 RVA: 0x000A8830 File Offset: 0x000A6A30
// (set) Token: 0x0600310B RID: 12555 RVA: 0x000A887C File Offset: 0x000A6A7C
public override byte[] Key
{
get
{
if (this.KeyValue == null)
{
this.GenerateKey();
while (TripleDES.IsWeakKey(this.KeyValue))
{
this.GenerateKey();
}
}
return (byte[])this.KeyValue.Clone();
}
set
{
if (value == null)
{
throw new ArgumentNullException("Key");
}
if (TripleDES.IsWeakKey(value))
{
throw new CryptographicException(Locale.GetText("Weak Key"));
}
this.KeyValue = (byte[])value.Clone();
}
}
/// <summary>Determines whether the specified key is weak.</summary>
/// <returns>true if the key is weak; otherwise, false.</returns>
/// <param name="rgbKey">The secret key to test for weakness. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The size of the <paramref name="rgbKey" /> parameter is not valid. </exception>
// Token: 0x0600310C RID: 12556 RVA: 0x000A88BC File Offset: 0x000A6ABC
public static bool IsWeakKey(byte[] rgbKey)
{
if (rgbKey == null)
{
throw new CryptographicException(Locale.GetText("Null Key"));
}
if (rgbKey.Length == 16)
{
for (int i = 0; i < 8; i++)
{
if (rgbKey[i] != rgbKey[i + 8])
{
return false;
}
}
}
else
{
if (rgbKey.Length != 24)
{
throw new CryptographicException(Locale.GetText("Wrong Key Length"));
}
bool flag = true;
for (int j = 0; j < 8; j++)
{
if (rgbKey[j] != rgbKey[j + 8])
{
flag = false;
break;
}
}
if (!flag)
{
for (int k = 8; k < 16; k++)
{
if (rgbKey[k] != rgbKey[k + 8])
{
return false;
}
}
}
}
return true;
}
/// <summary>Creates an instance of a cryptographic object to perform the <see cref="T:System.Security.Cryptography.TripleDES" /> algorithm.</summary>
/// <returns>An instance of a cryptographic object.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x0600310D RID: 12557 RVA: 0x000A8980 File Offset: 0x000A6B80
public new static TripleDES Create()
{
return TripleDES.Create("System.Security.Cryptography.TripleDES");
}
/// <summary>Creates an instance of a cryptographic object to perform the specified implementation of the <see cref="T:System.Security.Cryptography.TripleDES" /> algorithm.</summary>
/// <returns>An instance of a cryptographic object.</returns>
/// <param name="str">The name of the specific implementation of <see cref="T:System.Security.Cryptography.TripleDES" /> to use. </param>
// Token: 0x0600310E RID: 12558 RVA: 0x000A898C File Offset: 0x000A6B8C
public new static TripleDES Create(string str)
{
return (TripleDES)CryptoConfig.CreateFromName(str);
}
}
}
@@ -0,0 +1,54 @@
using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Defines a wrapper object to access the cryptographic service provider (CSP) version of the <see cref="T:System.Security.Cryptography.TripleDES" /> algorithm. This class cannot be inherited.</summary>
// Token: 0x0200053B RID: 1339
[ComVisible(true)]
public sealed class TripleDESCryptoServiceProvider : TripleDES
{
/// <summary>Generates a random initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />) to use for the algorithm.</summary>
// Token: 0x06003110 RID: 12560 RVA: 0x000A89A4 File Offset: 0x000A6BA4
public override void GenerateIV()
{
this.IVValue = KeyBuilder.IV(this.BlockSizeValue >> 3);
}
/// <summary>Generates a random <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" /> to be used for the algorithm.</summary>
// Token: 0x06003111 RID: 12561 RVA: 0x000A89BC File Offset: 0x000A6BBC
public override void GenerateKey()
{
this.KeyValue = TripleDESTransform.GetStrongKey();
}
/// <summary>Creates a symmetric <see cref="T:System.Security.Cryptography.TripleDES" /> decryptor object with the specified key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />) and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric <see cref="T:System.Security.Cryptography.TripleDES" /> decryptor object.</returns>
/// <param name="rgbKey">The secret key to use for the symmetric algorithm. </param>
/// <param name="rgbIV">The initialization vector to use for the symmetric algorithm. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> property is <see cref="F:System.Security.Cryptography.CipherMode.OFB" />.-or-The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> property is <see cref="F:System.Security.Cryptography.CipherMode.CFB" />, and the value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.FeedbackSize" /> property is not 8.-or-An invalid key size was used.-or-The algorithm key size was not available.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003112 RID: 12562 RVA: 0x000A89CC File Offset: 0x000A6BCC
public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
{
return new TripleDESTransform(this, false, rgbKey, rgbIV);
}
/// <summary>Creates a symmetric <see cref="T:System.Security.Cryptography.TripleDES" /> encryptor object with the specified key (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Key" />) and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
/// <returns>A symmetric <see cref="T:System.Security.Cryptography.TripleDES" /> encryptor object.</returns>
/// <param name="rgbKey">The secret key to use for the symmetric algorithm. </param>
/// <param name="rgbIV">The initialization vector to use for the symmetric algorithm. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> property is <see cref="F:System.Security.Cryptography.CipherMode.OFB" />.-or-The value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.Mode" /> property is <see cref="F:System.Security.Cryptography.CipherMode.CFB" />, and the value of the <see cref="P:System.Security.Cryptography.SymmetricAlgorithm.FeedbackSize" /> property is not 8.-or-An invalid key size was used.-or-The algorithm key size was not available.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06003113 RID: 12563 RVA: 0x000A89D8 File Offset: 0x000A6BD8
public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
{
return new TripleDESTransform(this, true, rgbKey, rgbIV);
}
}
}
@@ -0,0 +1,99 @@
using System;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
// Token: 0x0200053C RID: 1340
internal class TripleDESTransform : SymmetricTransform
{
// Token: 0x06003114 RID: 12564 RVA: 0x000A89E4 File Offset: 0x000A6BE4
public TripleDESTransform(TripleDES algo, bool encryption, byte[] key, byte[] iv)
: base(algo, encryption, iv)
{
if (key == null)
{
key = TripleDESTransform.GetStrongKey();
}
if (TripleDES.IsWeakKey(key))
{
string text = Locale.GetText("This is a known weak key.");
throw new CryptographicException(text);
}
byte[] array = new byte[8];
byte[] array2 = new byte[8];
byte[] array3 = new byte[8];
DES des = DES.Create();
Buffer.BlockCopy(key, 0, array, 0, 8);
Buffer.BlockCopy(key, 8, array2, 0, 8);
if (key.Length == 16)
{
Buffer.BlockCopy(key, 0, array3, 0, 8);
}
else
{
Buffer.BlockCopy(key, 16, array3, 0, 8);
}
if (encryption || algo.Mode == CipherMode.CFB)
{
this.E1 = new DESTransform(des, true, array, iv);
this.D2 = new DESTransform(des, false, array2, iv);
this.E3 = new DESTransform(des, true, array3, iv);
}
else
{
this.D1 = new DESTransform(des, false, array3, iv);
this.E2 = new DESTransform(des, true, array2, iv);
this.D3 = new DESTransform(des, false, array, iv);
}
}
// Token: 0x06003115 RID: 12565 RVA: 0x000A8AF8 File Offset: 0x000A6CF8
protected override void ECB(byte[] input, byte[] output)
{
DESTransform.Permutation(input, output, DESTransform.ipTab, false);
if (this.encrypt)
{
this.E1.ProcessBlock(output, output);
this.D2.ProcessBlock(output, output);
this.E3.ProcessBlock(output, output);
}
else
{
this.D1.ProcessBlock(output, output);
this.E2.ProcessBlock(output, output);
this.D3.ProcessBlock(output, output);
}
DESTransform.Permutation(output, output, DESTransform.fpTab, true);
}
// Token: 0x06003116 RID: 12566 RVA: 0x000A8B80 File Offset: 0x000A6D80
internal static byte[] GetStrongKey()
{
int num = DESTransform.BLOCK_BYTE_SIZE * 3;
byte[] array = KeyBuilder.Key(num);
while (TripleDES.IsWeakKey(array))
{
array = KeyBuilder.Key(num);
}
return array;
}
// Token: 0x04001406 RID: 5126
private DESTransform E1;
// Token: 0x04001407 RID: 5127
private DESTransform D2;
// Token: 0x04001408 RID: 5128
private DESTransform E3;
// Token: 0x04001409 RID: 5129
private DESTransform D1;
// Token: 0x0400140A RID: 5130
private DESTransform E2;
// Token: 0x0400140B RID: 5131
private DESTransform D3;
}
}
@@ -0,0 +1,928 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Text;
using Mono.Security.Authenticode;
using Mono.Security.X509;
namespace System.Security.Cryptography.X509Certificates
{
/// <summary>Provides methods that help you use X.509 v.3 certificates.</summary>
// Token: 0x020004E1 RID: 1249
[MonoTODO("X509ContentType.SerializedCert isn't supported (anywhere in the class)")]
[ComVisible(true)]
[Serializable]
public class X509Certificate : ISerializable, IDeserializationCallback
{
// Token: 0x06002E42 RID: 11842 RVA: 0x0009442C File Offset: 0x0009262C
internal X509Certificate(byte[] data, bool dates)
{
if (data != null)
{
this.Import(data, null, X509KeyStorageFlags.DefaultKeySet);
this.hideDates = !dates;
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class defined from a sequence of bytes representing an X.509v3 certificate.</summary>
/// <param name="data">A byte array containing data from an X.509 certificate.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is null.-or-The length of the <paramref name="rawData" /> parameter is 0.</exception>
// Token: 0x06002E43 RID: 11843 RVA: 0x00094458 File Offset: 0x00092658
public X509Certificate(byte[] data)
: this(data, true)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a handle to an unmanaged PCCERT_CONTEXT structure.</summary>
/// <param name="handle">A handle to an unmanaged PCCERT_CONTEXT structure.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The handle parameter does not represent a valid PCCERT_CONTEXT structure.</exception>
// Token: 0x06002E44 RID: 11844 RVA: 0x00094464 File Offset: 0x00092664
public X509Certificate(IntPtr handle)
{
if (handle == IntPtr.Zero)
{
throw new ArgumentException("Invalid handle.");
}
throw new NotSupportedException();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using another <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class.</summary>
/// <param name="cert">A <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class from which to initialize this class. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentNullException">The value of the <paramref name="cert" /> parameter is null.</exception>
// Token: 0x06002E45 RID: 11845 RVA: 0x00094498 File Offset: 0x00092698
public X509Certificate(X509Certificate cert)
{
if (cert == null)
{
throw new ArgumentNullException("cert");
}
if (cert != null)
{
byte[] rawCertData = cert.GetRawCertData();
if (rawCertData != null)
{
this.x509 = new X509Certificate(rawCertData);
}
this.hideDates = false;
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class. </summary>
// Token: 0x06002E46 RID: 11846 RVA: 0x000944E4 File Offset: 0x000926E4
public X509Certificate()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a byte array and a password.</summary>
/// <param name="rawData">A byte array containing data from an X.509 certificate.</param>
/// <param name="password">The password required to access the X.509 certificate data.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is null.-or-The length of the <paramref name="rawData" /> parameter is 0.</exception>
// Token: 0x06002E47 RID: 11847 RVA: 0x000944EC File Offset: 0x000926EC
public X509Certificate(byte[] rawData, string password)
{
this.Import(rawData, password, X509KeyStorageFlags.DefaultKeySet);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a byte array and a password.</summary>
/// <param name="rawData">A byte array that contains data from an X.509 certificate.</param>
/// <param name="password">The password required to access the X.509 certificate data.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is null.-or-The length of the <paramref name="rawData" /> parameter is 0.</exception>
// Token: 0x06002E48 RID: 11848 RVA: 0x00094500 File Offset: 0x00092700
[MonoTODO("SecureString support is incomplete")]
public X509Certificate(byte[] rawData, SecureString password)
{
this.Import(rawData, password, X509KeyStorageFlags.DefaultKeySet);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a byte array, a password, and a key storage flag.</summary>
/// <param name="rawData">A byte array containing data from an X.509 certificate. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <param name="keyStorageFlags">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> values. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is null.-or-The length of the <paramref name="rawData" /> parameter is 0.</exception>
// Token: 0x06002E49 RID: 11849 RVA: 0x00094514 File Offset: 0x00092714
public X509Certificate(byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
{
this.Import(rawData, password, keyStorageFlags);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a byte array, a password, and a key storage flag.</summary>
/// <param name="rawData">A byte array that contains data from an X.509 certificate. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <param name="keyStorageFlags">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> values that controls where and how to import the private key. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is null.-or-The length of the <paramref name="rawData" /> parameter is 0.</exception>
// Token: 0x06002E4A RID: 11850 RVA: 0x00094528 File Offset: 0x00092728
[MonoTODO("SecureString support is incomplete")]
public X509Certificate(byte[] rawData, SecureString password, X509KeyStorageFlags keyStorageFlags)
{
this.Import(rawData, password, keyStorageFlags);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using the name of a PKCS7 signed file. </summary>
/// <param name="fileName">The name of a PKCS7 signed file.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is null.</exception>
// Token: 0x06002E4B RID: 11851 RVA: 0x0009453C File Offset: 0x0009273C
public X509Certificate(string fileName)
{
this.Import(fileName, null, X509KeyStorageFlags.DefaultKeySet);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using the name of a PKCS7 signed file and a password to access the certificate.</summary>
/// <param name="fileName">The name of a PKCS7 signed file. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is null.</exception>
// Token: 0x06002E4C RID: 11852 RVA: 0x00094550 File Offset: 0x00092750
public X509Certificate(string fileName, string password)
{
this.Import(fileName, password, X509KeyStorageFlags.DefaultKeySet);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a certificate file name and a password.</summary>
/// <param name="fileName">The name of a certificate file. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is null.</exception>
// Token: 0x06002E4D RID: 11853 RVA: 0x00094564 File Offset: 0x00092764
[MonoTODO("SecureString support is incomplete")]
public X509Certificate(string fileName, SecureString password)
{
this.Import(fileName, password, X509KeyStorageFlags.DefaultKeySet);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using the name of a PKCS7 signed file, a password to access the certificate, and a key storage flag. </summary>
/// <param name="fileName">The name of a PKCS7 signed file. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <param name="keyStorageFlags">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> values. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is null.</exception>
// Token: 0x06002E4E RID: 11854 RVA: 0x00094578 File Offset: 0x00092778
public X509Certificate(string fileName, string password, X509KeyStorageFlags keyStorageFlags)
{
this.Import(fileName, password, keyStorageFlags);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a certificate file name, a password, and a key storage flag. </summary>
/// <param name="fileName">The name of a certificate file. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <param name="keyStorageFlags">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> values that controls where and how to import the private key. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is null.</exception>
// Token: 0x06002E4F RID: 11855 RVA: 0x0009458C File Offset: 0x0009278C
[MonoTODO("SecureString support is incomplete")]
public X509Certificate(string fileName, SecureString password, X509KeyStorageFlags keyStorageFlags)
{
this.Import(fileName, password, keyStorageFlags);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object and a <see cref="T:System.Runtime.Serialization.StreamingContext" /> structure.</summary>
/// <param name="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that describes serialization information.</param>
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> structure that describes how serialization should be performed.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
// Token: 0x06002E50 RID: 11856 RVA: 0x000945A0 File Offset: 0x000927A0
public X509Certificate(SerializationInfo info, StreamingContext context)
{
byte[] array = (byte[])info.GetValue("RawData", typeof(byte[]));
this.Import(array, null, X509KeyStorageFlags.DefaultKeySet);
}
/// <summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and is called back by the deserialization event when deserialization is complete. </summary>
/// <param name="sender">The source of the deserialization event.</param>
// Token: 0x06002E51 RID: 11857 RVA: 0x000945D8 File Offset: 0x000927D8
void IDeserializationCallback.OnDeserialization(object sender)
{
}
/// <summary>Gets serialization information with all the data needed to recreate an instance of the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</summary>
/// <param name="info">The object to populate with serialization information.</param>
/// <param name="context">The destination context of the serialization.</param>
// Token: 0x06002E52 RID: 11858 RVA: 0x000945DC File Offset: 0x000927DC
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("RawData", this.x509.RawData);
}
// Token: 0x06002E53 RID: 11859 RVA: 0x000945F4 File Offset: 0x000927F4
private string tostr(byte[] data)
{
if (data != null)
{
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
stringBuilder.Append(data[i].ToString("X2"));
}
return stringBuilder.ToString();
}
return null;
}
/// <summary>Creates an X.509v3 certificate using the name of a PKCS7 signed file.</summary>
/// <returns>The newly created X.509 certificate.</returns>
/// <param name="filename">The path of the PKCS7 signed file from which to create the X.509 certificate. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="filename" /> parameter is null. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Create" />
/// </PermissionSet>
// Token: 0x06002E54 RID: 11860 RVA: 0x00094644 File Offset: 0x00092844
public static X509Certificate CreateFromCertFile(string filename)
{
byte[] array = X509Certificate.Load(filename);
return new X509Certificate(array);
}
/// <summary>Creates an X.509v3 certificate from the specified signed file.</summary>
/// <returns>The newly created X.509 certificate.</returns>
/// <param name="filename">The path of the signed file from which to create the X.509 certificate. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Create" />
/// </PermissionSet>
// Token: 0x06002E55 RID: 11861 RVA: 0x00094660 File Offset: 0x00092860
[MonoTODO("Incomplete - minimal validation in this version")]
public static X509Certificate CreateFromSignedFile(string filename)
{
try
{
AuthenticodeDeformatter authenticodeDeformatter = new AuthenticodeDeformatter(filename);
if (authenticodeDeformatter.SigningCertificate != null)
{
return new X509Certificate(authenticodeDeformatter.SigningCertificate.RawData);
}
}
catch (SecurityException)
{
throw;
}
catch (Exception ex)
{
string text = Locale.GetText("Couldn't extract digital signature from {0}.", new object[] { filename });
throw new COMException(text, ex);
}
throw new CryptographicException(Locale.GetText("{0} isn't signed.", new object[] { filename }));
}
// Token: 0x06002E56 RID: 11862 RVA: 0x00094714 File Offset: 0x00092914
private void InitFromHandle(IntPtr handle)
{
if (handle != IntPtr.Zero)
{
X509Certificate.CertificateContext certificateContext = (X509Certificate.CertificateContext)Marshal.PtrToStructure(handle, typeof(X509Certificate.CertificateContext));
byte[] array = new byte[certificateContext.cbCertEncoded];
Marshal.Copy(certificateContext.pbCertEncoded, array, 0, (int)certificateContext.cbCertEncoded);
this.x509 = new X509Certificate(array);
}
}
/// <summary>Compares two <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> objects for equality.</summary>
/// <returns>true if the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object is equal to the object specified by the <paramref name="other" /> parameter; otherwise, false.</returns>
/// <param name="other">An <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to compare to the current object.</param>
// Token: 0x06002E57 RID: 11863 RVA: 0x00094778 File Offset: 0x00092978
public virtual bool Equals(X509Certificate other)
{
if (other == null)
{
return false;
}
if (other.x509 == null)
{
if (this.x509 == null)
{
return true;
}
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
else
{
byte[] rawData = other.x509.RawData;
if (rawData == null)
{
return this.x509 == null || this.x509.RawData == null;
}
if (this.x509 == null)
{
return false;
}
if (this.x509.RawData == null)
{
return false;
}
if (rawData.Length == this.x509.RawData.Length)
{
for (int i = 0; i < rawData.Length; i++)
{
if (rawData[i] != this.x509.RawData[i])
{
return false;
}
}
return true;
}
return false;
}
}
/// <summary>Returns the hash value for the X.509v3 certificate as an array of bytes.</summary>
/// <returns>The hash value for the X.509 certificate.</returns>
// Token: 0x06002E58 RID: 11864 RVA: 0x00094848 File Offset: 0x00092A48
public virtual byte[] GetCertHash()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
if (this.cachedCertificateHash == null && this.x509 != null)
{
SHA1 sha = SHA1.Create();
this.cachedCertificateHash = sha.ComputeHash(this.x509.RawData);
}
return this.cachedCertificateHash;
}
/// <summary>Returns the hash value for the X.509v3 certificate as a hexadecimal string.</summary>
/// <returns>The hexadecimal string representation of the X.509 certificate hash value.</returns>
// Token: 0x06002E59 RID: 11865 RVA: 0x000948AC File Offset: 0x00092AAC
public virtual string GetCertHashString()
{
return this.tostr(this.GetCertHash());
}
/// <summary>Returns the effective date of this X.509v3 certificate.</summary>
/// <returns>The effective date for this X.509 certificate.</returns>
// Token: 0x06002E5A RID: 11866 RVA: 0x000948BC File Offset: 0x00092ABC
public virtual string GetEffectiveDateString()
{
if (this.hideDates)
{
return null;
}
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.x509.ValidFrom.ToLocalTime().ToString();
}
/// <summary>Returns the expiration date of this X.509v3 certificate.</summary>
/// <returns>The expiration date for this X.509 certificate.</returns>
// Token: 0x06002E5B RID: 11867 RVA: 0x0009490C File Offset: 0x00092B0C
public virtual string GetExpirationDateString()
{
if (this.hideDates)
{
return null;
}
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.x509.ValidUntil.ToLocalTime().ToString();
}
/// <summary>Returns the name of the format of this X.509v3 certificate.</summary>
/// <returns>The format of this X.509 certificate.</returns>
// Token: 0x06002E5C RID: 11868 RVA: 0x0009495C File Offset: 0x00092B5C
public virtual string GetFormat()
{
return "X509";
}
/// <summary>Returns the hash code for the X.509v3 certificate as an integer.</summary>
/// <returns>The hash code for the X.509 certificate as an integer.</returns>
// Token: 0x06002E5D RID: 11869 RVA: 0x00094964 File Offset: 0x00092B64
public override int GetHashCode()
{
if (this.x509 == null)
{
return 0;
}
if (this.cachedCertificateHash == null)
{
this.GetCertHash();
}
if (this.cachedCertificateHash != null && this.cachedCertificateHash.Length >= 4)
{
return ((int)this.cachedCertificateHash[0] << 24) | ((int)this.cachedCertificateHash[1] << 16) | ((int)this.cachedCertificateHash[2] << 8) | (int)this.cachedCertificateHash[3];
}
return 0;
}
/// <summary>Returns the name of the certification authority that issued the X.509v3 certificate.</summary>
/// <returns>The name of the certification authority that issued the X.509 certificate.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:The certificate file does not exist.The certificate is invalid.The certificate's password is incorrect.</exception>
// Token: 0x06002E5E RID: 11870 RVA: 0x000949D8 File Offset: 0x00092BD8
[Obsolete("Use the Issuer property.")]
public virtual string GetIssuerName()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.x509.IssuerName;
}
/// <summary>Returns the key algorithm information for this X.509v3 certificate.</summary>
/// <returns>The key algorithm information for this X.509 certificate as a string.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
// Token: 0x06002E5F RID: 11871 RVA: 0x00094A0C File Offset: 0x00092C0C
public virtual string GetKeyAlgorithm()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.x509.KeyAlgorithm;
}
/// <summary>Returns the key algorithm parameters for the X.509v3 certificate.</summary>
/// <returns>The key algorithm parameters for the X.509 certificate as an array of bytes.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
// Token: 0x06002E60 RID: 11872 RVA: 0x00094A40 File Offset: 0x00092C40
public virtual byte[] GetKeyAlgorithmParameters()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
byte[] keyAlgorithmParameters = this.x509.KeyAlgorithmParameters;
if (keyAlgorithmParameters == null)
{
throw new CryptographicException(Locale.GetText("Parameters not part of the certificate"));
}
return keyAlgorithmParameters;
}
/// <summary>Returns the key algorithm parameters for the X.509v3 certificate.</summary>
/// <returns>The key algorithm parameters for the X.509 certificate as a hexadecimal string.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
// Token: 0x06002E61 RID: 11873 RVA: 0x00094A8C File Offset: 0x00092C8C
public virtual string GetKeyAlgorithmParametersString()
{
return this.tostr(this.GetKeyAlgorithmParameters());
}
/// <summary>Returns the name of the principal to which the certificate was issued.</summary>
/// <returns>The name of the principal to which the certificate was issued.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
// Token: 0x06002E62 RID: 11874 RVA: 0x00094A9C File Offset: 0x00092C9C
[Obsolete("Use the Subject property.")]
public virtual string GetName()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.x509.SubjectName;
}
/// <summary>Returns the public key for the X.509v3 certificate.</summary>
/// <returns>The public key for the X.509 certificate as an array of bytes.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
// Token: 0x06002E63 RID: 11875 RVA: 0x00094AD0 File Offset: 0x00092CD0
public virtual byte[] GetPublicKey()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.x509.PublicKey;
}
/// <summary>Returns the public key for the X.509v3 certificate.</summary>
/// <returns>The public key for the X.509 certificate as a hexadecimal string.</returns>
// Token: 0x06002E64 RID: 11876 RVA: 0x00094B04 File Offset: 0x00092D04
public virtual string GetPublicKeyString()
{
return this.tostr(this.GetPublicKey());
}
/// <summary>Returns the raw data for the entire X.509v3 certificate.</summary>
/// <returns>A byte array containing the X.509 certificate data.</returns>
// Token: 0x06002E65 RID: 11877 RVA: 0x00094B14 File Offset: 0x00092D14
public virtual byte[] GetRawCertData()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.x509.RawData;
}
/// <summary>Returns the raw data for the entire X.509v3 certificate.</summary>
/// <returns>The X.509 certificate data as a hexadecimal string.</returns>
// Token: 0x06002E66 RID: 11878 RVA: 0x00094B48 File Offset: 0x00092D48
public virtual string GetRawCertDataString()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.tostr(this.x509.RawData);
}
/// <summary>Returns the serial number of the X.509v3 certificate.</summary>
/// <returns>The serial number of the X.509 certificate as an array of bytes.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
// Token: 0x06002E67 RID: 11879 RVA: 0x00094B84 File Offset: 0x00092D84
public virtual byte[] GetSerialNumber()
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
return this.x509.SerialNumber;
}
/// <summary>Returns the serial number of the X.509v3 certificate.</summary>
/// <returns>The serial number of the X.509 certificate as a hexadecimal string.</returns>
// Token: 0x06002E68 RID: 11880 RVA: 0x00094BB8 File Offset: 0x00092DB8
public virtual string GetSerialNumberString()
{
byte[] serialNumber = this.GetSerialNumber();
Array.Reverse(serialNumber);
return this.tostr(serialNumber);
}
/// <summary>Returns a string representation of the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</summary>
/// <returns>A string representation of the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</returns>
// Token: 0x06002E69 RID: 11881 RVA: 0x00094BDC File Offset: 0x00092DDC
public override string ToString()
{
return base.ToString();
}
/// <summary>Returns a string representation of the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object, with extra information, if specified.</summary>
/// <returns>A string representation of the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</returns>
/// <param name="fVerbose">true to produce the verbose form of the string representation; otherwise, false. </param>
// Token: 0x06002E6A RID: 11882 RVA: 0x00094BE4 File Offset: 0x00092DE4
public virtual string ToString(bool fVerbose)
{
if (!fVerbose || this.x509 == null)
{
return base.ToString();
}
string newLine = Environment.NewLine;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendFormat("[Subject]{0} {1}{0}{0}", newLine, this.Subject);
stringBuilder.AppendFormat("[Issuer]{0} {1}{0}{0}", newLine, this.Issuer);
stringBuilder.AppendFormat("[Not Before]{0} {1}{0}{0}", newLine, this.GetEffectiveDateString());
stringBuilder.AppendFormat("[Not After]{0} {1}{0}{0}", newLine, this.GetExpirationDateString());
stringBuilder.AppendFormat("[Thumbprint]{0} {1}{0}", newLine, this.GetCertHashString());
stringBuilder.Append(newLine);
return stringBuilder.ToString();
}
// Token: 0x06002E6B RID: 11883 RVA: 0x00094C84 File Offset: 0x00092E84
private static byte[] Load(string fileName)
{
byte[] array = null;
using (FileStream fileStream = File.OpenRead(fileName))
{
array = new byte[fileStream.Length];
fileStream.Read(array, 0, array.Length);
fileStream.Close();
}
return array;
}
/// <summary>Gets the name of the certificate authority that issued the X.509v3 certificate.</summary>
/// <returns>The name of the certificate authority that issued the X.509v3 certificate.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The certificate handle is invalid.</exception>
// Token: 0x17000927 RID: 2343
// (get) Token: 0x06002E6C RID: 11884 RVA: 0x00094CE8 File Offset: 0x00092EE8
public string Issuer
{
get
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
if (this.issuer_name == null)
{
this.issuer_name = X501.ToString(this.x509.GetIssuerName(), true, ", ", true);
}
return this.issuer_name;
}
}
/// <summary>Gets the subject distinguished name from the certificate.</summary>
/// <returns>The subject distinguished name from the certificate.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The certificate handle is invalid.</exception>
// Token: 0x17000928 RID: 2344
// (get) Token: 0x06002E6D RID: 11885 RVA: 0x00094D40 File Offset: 0x00092F40
public string Subject
{
get
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
if (this.subject_name == null)
{
this.subject_name = X501.ToString(this.x509.GetSubjectName(), true, ", ", true);
}
return this.subject_name;
}
}
/// <summary>Gets a handle to a Microsoft Cryptographic API certificate context described by an unmanaged PCCERT_CONTEXT structure. </summary>
/// <returns>An <see cref="T:System.IntPtr" /> structure that represents an unmanaged PCCERT_CONTEXT structure.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x17000929 RID: 2345
// (get) Token: 0x06002E6E RID: 11886 RVA: 0x00094D98 File Offset: 0x00092F98
[ComVisible(false)]
public IntPtr Handle
{
get
{
return IntPtr.Zero;
}
}
/// <summary>Compares two <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> objects for equality.</summary>
/// <returns>true if the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object is equal to the object specified by the <paramref name="other" /> parameter; otherwise, false.</returns>
/// <param name="obj">An <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to compare to the current object. </param>
// Token: 0x06002E6F RID: 11887 RVA: 0x00094DA0 File Offset: 0x00092FA0
[ComVisible(false)]
public override bool Equals(object obj)
{
X509Certificate x509Certificate = obj as X509Certificate;
return x509Certificate != null && this.Equals(x509Certificate);
}
/// <summary>Exports the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to a byte array in a format described by one of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values. </summary>
/// <returns>An array of bytes that represents the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</returns>
/// <param name="contentType">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values that describes how to format the output data. </param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">A value other than <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Cert" />, <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" />, or <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12" /> was passed to the <paramref name="contentType" /> parameter.-or-The certificate could not be exported.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Open, Export" />
/// </PermissionSet>
// Token: 0x06002E70 RID: 11888 RVA: 0x00094DC4 File Offset: 0x00092FC4
[ComVisible(false)]
[MonoTODO("X509ContentType.Pfx/Pkcs12 and SerializedCert are not supported")]
public virtual byte[] Export(X509ContentType contentType)
{
return this.Export(contentType, null);
}
/// <summary>Exports the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to a byte array in a format described by one of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values, and using the specified password.</summary>
/// <returns>An array of bytes that represents the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</returns>
/// <param name="contentType">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values that describes how to format the output data.</param>
/// <param name="password">The password required to access the X.509 certificate data.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">A value other than <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Cert" />, <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" />, or <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12" /> was passed to the <paramref name="contentType" /> parameter.-or-The certificate could not be exported.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Open, Export" />
/// </PermissionSet>
// Token: 0x06002E71 RID: 11889 RVA: 0x00094DD0 File Offset: 0x00092FD0
[ComVisible(false)]
[MonoTODO("X509ContentType.Pfx/Pkcs12 and SerializedCert are not supported")]
public virtual byte[] Export(X509ContentType contentType, string password)
{
byte[] array = ((password != null) ? Encoding.UTF8.GetBytes(password) : null);
return this.Export(contentType, array);
}
/// <summary>Exports the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to a byte array using the specified format and a password.</summary>
/// <returns>A byte array that represents the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</returns>
/// <param name="contentType">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values that describes how to format the output data.</param>
/// <param name="password">The password required to access the X.509 certificate data.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">A value other than <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Cert" />, <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" />, or <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12" /> was passed to the <paramref name="contentType" /> parameter.-or-The certificate could not be exported.</exception>
// Token: 0x06002E72 RID: 11890 RVA: 0x00094E00 File Offset: 0x00093000
[MonoTODO("X509ContentType.Pfx/Pkcs12 and SerializedCert are not supported. SecureString support is incomplete.")]
public virtual byte[] Export(X509ContentType contentType, SecureString password)
{
byte[] array = ((password != null) ? password.GetBuffer() : null);
return this.Export(contentType, array);
}
// Token: 0x06002E73 RID: 11891 RVA: 0x00094E28 File Offset: 0x00093028
internal byte[] Export(X509ContentType contentType, byte[] password)
{
if (this.x509 == null)
{
throw new CryptographicException(Locale.GetText("Certificate instance is empty."));
}
byte[] rawData;
try
{
switch (contentType)
{
case X509ContentType.Cert:
rawData = this.x509.RawData;
break;
case X509ContentType.SerializedCert:
throw new NotSupportedException();
case X509ContentType.Pfx:
throw new NotSupportedException();
default:
{
string text = Locale.GetText("This certificate format '{0}' cannot be exported.", new object[] { contentType });
throw new CryptographicException(text);
}
}
}
finally
{
if (password != null)
{
Array.Clear(password, 0, password.Length);
}
}
return rawData;
}
/// <summary>Populates the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object with data from a byte array.</summary>
/// <param name="rawData">A byte array containing data from an X.509 certificate. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is null.-or-The length of the <paramref name="rawData" /> parameter is 0.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Create" />
/// </PermissionSet>
// Token: 0x06002E74 RID: 11892 RVA: 0x00094EDC File Offset: 0x000930DC
[ComVisible(false)]
public virtual void Import(byte[] rawData)
{
this.Import(rawData, null, X509KeyStorageFlags.DefaultKeySet);
}
/// <summary>Populates the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object using data from a byte array, a password, and flags for determining how the private key is imported.</summary>
/// <param name="rawData">A byte array containing data from an X.509 certificate. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <param name="keyStorageFlags">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> values that controls where and how the private key is imported. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is null.-or-The length of the <paramref name="rawData" /> parameter is 0.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Create" />
/// </PermissionSet>
// Token: 0x06002E75 RID: 11893 RVA: 0x00094EE8 File Offset: 0x000930E8
[MonoTODO("missing KeyStorageFlags support")]
[ComVisible(false)]
public virtual void Import(byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
{
this.Reset();
if (password == null)
{
try
{
this.x509 = new X509Certificate(rawData);
}
catch (Exception ex)
{
try
{
PKCS12 pkcs = new PKCS12(rawData);
if (pkcs.Certificates.Count > 0)
{
this.x509 = pkcs.Certificates[0];
}
else
{
this.x509 = null;
}
}
catch
{
string text = Locale.GetText("Unable to decode certificate.");
throw new CryptographicException(text, ex);
}
}
}
else
{
try
{
PKCS12 pkcs2 = new PKCS12(rawData, password);
if (pkcs2.Certificates.Count > 0)
{
this.x509 = pkcs2.Certificates[0];
}
else
{
this.x509 = null;
}
}
catch
{
this.x509 = new X509Certificate(rawData);
}
}
}
/// <summary>Populates an <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object using data from a byte array, a password, and a key storage flag.</summary>
/// <param name="rawData">A byte array that contains data from an X.509 certificate. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <param name="keyStorageFlags">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> values that controls where and how to import the private key. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is null.-or-The length of the <paramref name="rawData" /> parameter is 0.</exception>
// Token: 0x06002E76 RID: 11894 RVA: 0x0009500C File Offset: 0x0009320C
[MonoTODO("SecureString support is incomplete")]
public virtual void Import(byte[] rawData, SecureString password, X509KeyStorageFlags keyStorageFlags)
{
this.Import(rawData, null, keyStorageFlags);
}
/// <summary>Populates the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object with information from a certificate file.</summary>
/// <param name="fileName">The name of a certificate file represented as a string. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is null.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Create" />
/// </PermissionSet>
// Token: 0x06002E77 RID: 11895 RVA: 0x00095018 File Offset: 0x00093218
[ComVisible(false)]
public virtual void Import(string fileName)
{
byte[] array = X509Certificate.Load(fileName);
this.Import(array, null, X509KeyStorageFlags.DefaultKeySet);
}
/// <summary>Populates the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object with information from a certificate file, a password, and a <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> value.</summary>
/// <param name="fileName">The name of a certificate file represented as a string. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <param name="keyStorageFlags">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> values that controls where and how the private key is imported. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is null.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Create" />
/// </PermissionSet>
// Token: 0x06002E78 RID: 11896 RVA: 0x00095038 File Offset: 0x00093238
[ComVisible(false)]
[MonoTODO("missing KeyStorageFlags support")]
public virtual void Import(string fileName, string password, X509KeyStorageFlags keyStorageFlags)
{
byte[] array = X509Certificate.Load(fileName);
this.Import(array, password, keyStorageFlags);
}
/// <summary>Populates an <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object with information from a certificate file, a password, and a key storage flag.</summary>
/// <param name="fileName">The name of a certificate file. </param>
/// <param name="password">The password required to access the X.509 certificate data. </param>
/// <param name="keyStorageFlags">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" /> values that controls where and how to import the private key. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is null.</exception>
// Token: 0x06002E79 RID: 11897 RVA: 0x00095058 File Offset: 0x00093258
[MonoTODO("SecureString support is incomplete, missing KeyStorageFlags support")]
public virtual void Import(string fileName, SecureString password, X509KeyStorageFlags keyStorageFlags)
{
byte[] array = X509Certificate.Load(fileName);
this.Import(array, null, keyStorageFlags);
}
/// <summary>Resets the state of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> object.</summary>
// Token: 0x06002E7A RID: 11898 RVA: 0x00095078 File Offset: 0x00093278
[ComVisible(false)]
public virtual void Reset()
{
this.x509 = null;
this.issuer_name = null;
this.subject_name = null;
this.hideDates = false;
this.cachedCertificateHash = null;
}
// Token: 0x0400124D RID: 4685
private X509Certificate x509;
// Token: 0x0400124E RID: 4686
private bool hideDates;
// Token: 0x0400124F RID: 4687
private byte[] cachedCertificateHash;
// Token: 0x04001250 RID: 4688
private string issuer_name;
// Token: 0x04001251 RID: 4689
private string subject_name;
// Token: 0x020004E2 RID: 1250
internal struct CertificateContext
{
// Token: 0x04001252 RID: 4690
public uint dwCertEncodingType;
// Token: 0x04001253 RID: 4691
public IntPtr pbCertEncoded;
// Token: 0x04001254 RID: 4692
public uint cbCertEncoded;
// Token: 0x04001255 RID: 4693
public IntPtr pCertInfo;
// Token: 0x04001256 RID: 4694
public IntPtr hCertStore;
}
}
}
@@ -0,0 +1,36 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography.X509Certificates
{
/// <summary>Specifies the format of an X.509 certificate. </summary>
// Token: 0x020004E3 RID: 1251
[ComVisible(true)]
public enum X509ContentType
{
/// <summary>An unknown X.509 certificate. </summary>
// Token: 0x04001258 RID: 4696
Unknown,
/// <summary>A single X.509 certificate.</summary>
// Token: 0x04001259 RID: 4697
Cert,
/// <summary>A single serialized X.509 certificate. </summary>
// Token: 0x0400125A RID: 4698
SerializedCert,
/// <summary>A PFX-formatted certificate. The Pfx value is identical to the Pkcs12 value.</summary>
// Token: 0x0400125B RID: 4699
Pfx,
/// <summary>A serialized store.</summary>
// Token: 0x0400125C RID: 4700
SerializedStore,
/// <summary>A PKCS #7–formatted certificate.</summary>
// Token: 0x0400125D RID: 4701
Pkcs7,
/// <summary>An Authenticode X.509 certificate. </summary>
// Token: 0x0400125E RID: 4702
Authenticode,
/// <summary>A PKCS #12–formatted certificate. The Pkcs12 value is identical to the Pfx value.</summary>
// Token: 0x0400125F RID: 4703
Pkcs12 = 3
}
}
@@ -0,0 +1,32 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography.X509Certificates
{
/// <summary>Defines where and how to export the private key of an X.509 certificate.</summary>
// Token: 0x020004E4 RID: 1252
[Flags]
[ComVisible(true)]
[Serializable]
public enum X509KeyStorageFlags
{
/// <summary>The default key set is used. The user key set is usually the default. </summary>
// Token: 0x04001261 RID: 4705
DefaultKeySet = 0,
/// <summary>Private keys are stored in the current user store rather than the local computer store. This occurs even if the certificate specifies that the keys should go in the local computer store. </summary>
// Token: 0x04001262 RID: 4706
UserKeySet = 1,
/// <summary>Private keys are stored in the local computer store rather than the current user store. </summary>
// Token: 0x04001263 RID: 4707
MachineKeySet = 2,
/// <summary>Imported keys are marked as exportable. .</summary>
// Token: 0x04001264 RID: 4708
Exportable = 4,
/// <summary>Notify the user through a dialog box or other method that the key is accessed. The Cryptographic Service Provider (CSP) in use defines the precise behavior.</summary>
// Token: 0x04001265 RID: 4709
UserProtected = 8,
/// <summary>The key associated with a PFX file is persisted when importing a certificate.</summary>
// Token: 0x04001266 RID: 4710
PersistKeySet = 16
}
}