summaryrefslogtreecommitdiff
path: root/include/my_crypt.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-03-24 20:43:20 +0100
committerSergei Golubchik <serg@mariadb.org>2015-04-05 13:14:37 +0200
commit2f8d101f9eb5193a8a1d5ab5cc8e52d7b52007a4 (patch)
tree5dbab28b47eb9055efeec9a3b2c3cb9fb6bc711e /include/my_crypt.h
parent27cc252bb73436957120a964734a794ab3fd64ef (diff)
downloadmariadb-git-2f8d101f9eb5193a8a1d5ab5cc8e52d7b52007a4.tar.gz
unify my_{en|de}crypt_{cbc|ecb|ctr}. no yassl support yet.
Diffstat (limited to 'include/my_crypt.h')
-rw-r--r--include/my_crypt.h53
1 files changed, 42 insertions, 11 deletions
diff --git a/include/my_crypt.h b/include/my_crypt.h
index ea095e11fa9..db25b1f37af 100644
--- a/include/my_crypt.h
+++ b/include/my_crypt.h
@@ -1,3 +1,20 @@
+/*
+ Copyright (c) 2014 Google Inc.
+ Copyright (c) 2014, 2015 MariaDB Corporation
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
// TODO: Add Windows support
#ifndef MYSYS_MY_CRYPT_H_
@@ -12,24 +29,38 @@ Crypt_result my_aes_encrypt_ctr(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
- uint noPadding);
+ uint no_padding);
Crypt_result my_aes_decrypt_ctr(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
- uint noPadding);
-C_MODE_END
+ uint no_padding);
+
+Crypt_result my_aes_encrypt_cbc(const uchar* source, uint32 source_length,
+ uchar* dest, uint32* dest_length,
+ const unsigned char* key, uint8 key_length,
+ const unsigned char* iv, uint8 iv_length,
+ uint no_padding);
+
+Crypt_result my_aes_decrypt_cbc(const uchar* source, uint32 source_length,
+ uchar* dest, uint32* dest_length,
+ const unsigned char* key, uint8 key_length,
+ const unsigned char* iv, uint8 iv_length,
+ uint no_padding);
-Crypt_result EncryptAes128Ctr(const uchar* key,
- const uchar* iv, int iv_size,
- const uchar* plaintext, int plaintext_size,
- uchar* ciphertext, int* ciphertext_used);
+Crypt_result my_aes_encrypt_ecb(const uchar* source, uint32 source_length,
+ uchar* dest, uint32* dest_length,
+ const unsigned char* key, uint8 key_length,
+ const unsigned char* iv, uint8 iv_length,
+ uint no_padding);
-Crypt_result DecryptAes128Ctr(const uchar* key,
- const uchar* iv, int iv_size,
- const uchar* ciphertext, int ciphertext_size,
- uchar* plaintext, int* plaintext_used);
+Crypt_result my_aes_decrypt_ecb(const uchar* source, uint32 source_length,
+ uchar* dest, uint32* dest_length,
+ const unsigned char* key, uint8 key_length,
+ const unsigned char* iv, uint8 iv_length,
+ uint no_padding);
+C_MODE_END
#endif /* !defined(HAVE_YASSL) && defined(HAVE_OPENSSL) */