Пример #1
0
        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);
        }
Пример #2
0
        protected virtual byte[] ComputeHash(byte[] seed)
        {
            var sha = new Primel.SHA256();

            return(sha.ComputeHash(seed));
        }