byte[] GenerateKey(IEnumerable <byte> seed) { var sha = new Primel.SHA256(); var hash = sha.ComputeHash(seed.ToArray()); var key = new byte[0x10]; for (int i = 0; i < hash.Length; ++i) { key[i & 0xF] ^= hash[i]; } return(key); }
protected virtual byte[] ComputeHash(byte[] seed) { var sha = new Primel.SHA256(); return(sha.ComputeHash(seed)); }