public override void Final(ArraySegment <byte> hash) { HashAlgorithm.Final(hash); HashAlgorithm.Reset(); HashAlgorithm.Update(_Outer); HashAlgorithm.Update(hash); HashAlgorithm.Final(hash); Reset(); }
private void Iterate(int index) { var indexbytes = new byte[4]; BitConverter.GetBytes(indexbytes, 0, index); BitConverter.SwapBigEndian(indexbytes); HashAlgorithm.Reset(); HashAlgorithm.Key = Password; HashAlgorithm.Update(Salt); HashAlgorithm.Update(indexbytes); HashAlgorithm.Final(Hash); var U = Hash; for (int u = 1; u < Iterations; ++u) { HashAlgorithm.ComputeHash(U, U); for (int k = 0; k < Hash.Length; ++k) { Hash[k] ^= U[k]; } } }
public override void Reset() { HashAlgorithm.Reset(); HashAlgorithm.Update(_Inner); }