// Finalize the hash and return the final hash value. protected override byte[] HashFinal() { // Compute the final hash, which is "H(K, H(K, Data))". Prepare(); byte[] inner = alg.InternalHashFinal(); alg.Initialize(); if (KeyValue != null) { alg.InternalHashCore(KeyValue, 0, KeyValue.Length); } alg.InternalHashCore(inner, 0, inner.Length); Array.Clear(inner, 0, inner.Length); return(alg.InternalHashFinal()); }