1
/* Copyright (C) 2002 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
/* Header file for my_aes.c */
18
/* Wrapper to give simple interface for MySQL to AES standard encryption */
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
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);