public HMACSHA384(byte[] key) { this.HashName = HashAlgorithmNames.SHA384; _hMacCommon = new HMACCommon(HashAlgorithmNames.SHA384, key, BlockSize); base.Key = _hMacCommon.ActualKey; // change the default value of BlockSizeValue to 128 instead of 64 BlockSizeValue = BlockSize; }
private IncrementalHash(HashAlgorithmName name, HMACCommon hmac) { Debug.Assert(name != null); Debug.Assert(!string.IsNullOrEmpty(name.Name)); Debug.Assert(hmac != null); _algorithmName = new HashAlgorithmName("HMAC" + name.Name); _hmac = hmac; }
public HMACSHA256(byte[] key) { this.HashName = HashAlgorithmNames.SHA256; _hMacCommon = new HMACCommon(HashAlgorithmNames.SHA256, key, BlockSize); base.Key = _hMacCommon.ActualKey; // this not really needed as it'll initialize BlockSizeValue with same value it has which is 64. // we just want to be explicit in all HMAC extended classes BlockSizeValue = BlockSize; }
/// <summary> /// Release all resources used by the current instance of the /// <see cref="IncrementalHash"/> class. /// </summary> public void Dispose() { _disposed = true; if (_hash != null) { _hash.Dispose(); _hash = null; } if (_hmac != null) { _hmac.Dispose(true); _hmac = null; } }
public HMACSHA256(byte[] key) { this.HashName = HashAlgorithmNames.SHA256; _hMacCommon = new HMACCommon(HashAlgorithmNames.SHA256, key, BlockSize); base.Key = _hMacCommon.ActualKey; }
public HMACSHA256(byte[] key) { this.HashName = HashAlgorithmNames.SHA256; _hMacCommon = new HMACCommon(HashAlgorithmNames.SHA256, key); base.Key = key; }
protected override void Dispose(bool disposing) { if (disposing) { HMACCommon hMacCommon = _hMacCommon; _hMacCommon = null; if (hMacCommon != null) hMacCommon.Dispose(disposing); } base.Dispose(disposing); }
public HMACMD5(byte[] key) { this.HashName = HashAlgorithmNames.MD5; _hMacCommon = new HMACCommon(HashAlgorithmNames.MD5, key); base.Key = key; }