mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / include / my_aes.h
blob41b13569009ccf957eb939e0a2e6c18cbacdecf2
1 /* Copyright (c) 2002, 2006 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
17 /* Header file for my_aes.c */
18 /* Wrapper to give simple interface for MySQL to AES standard encryption */
20 #include "rijndael.h"
22 C_MODE_START
24 #define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */
27 my_aes_encrypt - Crypt buffer with AES encryption algorithm.
28 source - Pointer to data for encryption
29 source_length - size of encryption data
30 dest - buffer to place encrypted data (must be large enough)
31 key - Key to be used for encryption
32 kel_length - Length of the key. Will handle keys of any length
34 returns - size of encrypted data, or negative in case of error.
37 int my_aes_encrypt(const char *source, int source_length, char *dest,
38 const char *key, int key_length);
41 my_aes_decrypt - DeCrypt buffer with AES encryption algorithm.
42 source - Pointer to data for decryption
43 source_length - size of encrypted data
44 dest - buffer to place decrypted data (must be large enough)
45 key - Key to be used for decryption
46 kel_length - Length of the key. Will handle keys of any length
48 returns - size of original data, or negative in case of error.
52 int my_aes_decrypt(const char *source, int source_length, char *dest,
53 const char *key, int key_length);
56 my_aes_get_size - get size of buffer which will be large enough for encrypted
57 data
58 source_length - length of data to be encrypted
60 returns - size of buffer required to store encrypted data
63 int my_aes_get_size(int source_length);
65 C_MODE_END