using System; using System.Runtime.InteropServices; using Mono.Security.Cryptography; namespace System.Security.Cryptography { /// Computes a Message Authentication Code (MAC) using for the input data . // Token: 0x0200050E RID: 1294 [ComVisible(true)] public class MACTripleDES : KeyedHashAlgorithm { /// Initializes a new instance of the class. // Token: 0x06002F9A RID: 12186 RVA: 0x000991BC File Offset: 0x000973BC public MACTripleDES() { this.Setup("TripleDES", null); } /// Initializes a new instance of the class with the specified key data. /// The secret key for encryption. /// The parameter is null. // Token: 0x06002F9B RID: 12187 RVA: 0x000991D0 File Offset: 0x000973D0 public MACTripleDES(byte[] rgbKey) { if (rgbKey == null) { throw new ArgumentNullException("rgbKey"); } this.Setup("TripleDES", rgbKey); } /// Initializes a new instance of the class with the specified key data using the specified implementation of . /// The name of the implementation to use. /// The secret key for encryption. /// The parameter is null. /// The parameter is not a valid name of a implementation. // 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; } /// Releases the unmanaged resources used by the . // Token: 0x06002F9E RID: 12190 RVA: 0x000992B0 File Offset: 0x000974B0 ~MACTripleDES() { this.Dispose(false); } /// Gets or sets the padding mode used in the hashing algorithm. /// The padding mode used in the hashing algorithm. /// The property cannot be set because the padding mode is invalid. // 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; } } /// Releases the unmanaged resources used by the and optionally releases the managed resources. /// true to release both managed and unmanaged resources; false to release only unmanaged resources. // 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; } } /// Initializes an instance of . // 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); } /// Routes data written to the object into the encryptor for computing the Message Authentication Code (MAC). /// The input data. /// The offset into the byte array from which to begin using data. /// The number of bytes in the array to use as data. // 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); } /// Returns the computed Message Authentication Code (MAC) after all data is written to the object. /// The computed MAC. // 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; } }