private IEnumerable <byte> P_hash(byte[] secret, byte[] seed) { var hmac = new HMAC(_digest, secret); var a = seed; while (true) { hmac.Reset(); hmac.Update(a); a = hmac.DigestBuffer(); hmac.Reset(); hmac.Update(a); hmac.Update(seed); var b = hmac.DigestBuffer(); foreach (var x in b) { yield return(x); } } }