/// <summary> /// Clears the hash in memory /// </summary> public void ClearHash() { if (_hash != null) { ByteHelper.ClearBytes(_hash); } _hash = null; }
/// <summary> /// Performs the hashing operation. The data is applied to the hash algorithm as they come in dataProviders. /// </summary> /// <param name="dataProviders"></param> public void Hash(byte[] buffer, int index, params HashDataProvider[] dataProviders) { Array.Copy(Hash(dataProviders), 0, buffer, index, HashBitSize / 8); ByteHelper.ClearBytes(_hashAlgorithm.Hash); _hashAlgorithm.Clear(); }
public void InjectHash(byte[] hash) { _injectedHash = new byte[hash.Length]; Array.Copy(hash, _injectedHash, hash.Length); ByteHelper.ClearBytes(hash); }