Пример #1
0
		/// <summary>
		/// Initializes a new instance of Crypto with the specified seed
		/// </summary>
		/// <param name="forServer">True if this instance will be responsible for packets
		/// sent by the server</param>
		public MabiCrypto(uint seed, bool forServer)
		{
			this.Seed = seed;
			this.ForServer = forServer;

			var keyGen = new MabiKeystreamGenerator(seed);
			_aesEngine = new MabiAesEngine(forServer, keyGen.AesKey);
			_mabiCipher = new MabiCipherEngine(keyGen);
		}
Пример #2
0
        /// <summary>
        /// Initializes a new instance of Crypto with the specified seed
        /// </summary>
        /// <param name="forServer">True if this instance will be responsible for packets
        /// sent by the server</param>
        public MabiCrypto(uint seed, bool forServer)
        {
            this.Seed      = seed;
            this.ForServer = forServer;

            var keyGen = new MabiKeystreamGenerator(seed);

            _aesEngine  = new MabiAesEngine(forServer, keyGen.AesKey);
            _mabiCipher = new MabiCipherEngine(keyGen);
        }