MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sql_crypt.h
1 #ifndef SQL_CRYPT_INCLUDED
2 #define SQL_CRYPT_INCLUDED
3 
4 /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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; version 2 of the License.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software Foundation,
17  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
18 
19 
20 #include "sql_alloc.h"
21 #include "mysql_com.h" /* rand_struct */
22 
23 class SQL_CRYPT :public Sql_alloc
24 {
25  struct rand_struct rand,org_rand;
26  char decode_buff[256],encode_buff[256];
27  uint shift;
28  public:
29  SQL_CRYPT() {}
30  SQL_CRYPT(ulong *seed)
31  {
32  init(seed);
33  }
34  ~SQL_CRYPT() {}
35  void init(ulong *seed);
36  void reinit() { shift=0; rand=org_rand; }
37  void encode(char *str, uint length);
38  void decode(char *str, uint length);
39 };
40 
41 #endif /* SQL_CRYPT_INCLUDED */