Beispiel #1
0
        /// <summary>
        /// Generates a key (Key) to use for the algorithm.
        /// </summary>
        public void GenerateKey(UInt32 Seed)
        {
            if (BufKey != null)
            {
                Kernel.free(BufKey);
            }

            BufKey = (Byte *)Kernel.malloc(COFAC_KEY);

            MSRandom Rand = new MSRandom(Seed);

            for (Int32 i = 0; i < COFAC_KEY; i++)
            {
                BufKey[i] = (Byte)(Rand.Next() % 0x100);
            }
        }
Beispiel #2
0
Datei: COFAC.cs Projekt: Pircs/Yi
        /// <summary>
        /// Generates a key (Key) to use for the algorithm.
        /// </summary>
        public void GenerateKey(uint seed)
        {
            if (_bufKey != null)
            {
                Kernel.free(_bufKey);
            }

            _bufKey = (byte *)Kernel.malloc(COFAC_KEY);

            var rand = new MSRandom(seed);

            for (var i = 0; i < COFAC_KEY; i++)
            {
                _bufKey[i] = (byte)(rand.Next() % 0x100);
            }
        }