root/trunk/src/shared/Auth/AuthCrypt.h @ 58

Revision 44, 1.5 kB (checked in by yumileroy, 17 years ago)

[svn] * Merge Temp dev SVN with Assembla.
* Changes include:

  • Implementation of w12x's Outdoor PvP and Game Event Systems.
  • Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed).
  • All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql).
  • Improved Config cleanup.
  • And many more changes.

Original author: Seline
Date: 2008-10-14 11:57:03-05:00

Line 
1/*
2 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
3 *
4 * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _AUTHCRYPT_H
22#define _AUTHCRYPT_H
23
24#include <Common.h>
25#include <vector>
26
27class BigNumber;
28
29class AuthCrypt
30{
31    public:
32        AuthCrypt();
33        ~AuthCrypt();
34
35        const static size_t CRYPTED_SEND_LEN = 4;
36        const static size_t CRYPTED_RECV_LEN = 6;
37
38        void Init();
39
40        void SetKey(BigNumber *);
41
42        void DecryptRecv(uint8 *, size_t);
43        void EncryptSend(uint8 *, size_t);
44
45        bool IsInitialized() { return _initialized; }
46
47        static void GenerateKey(uint8 *, BigNumber *);
48
49    private:
50        std::vector<uint8> _key;
51        uint8 _send_i, _send_j, _recv_i, _recv_j;
52        bool _initialized;
53};
54#endif
Note: See TracBrowser for help on using the browser.