diff options
author | Monty <monty@mariadb.org> | 2014-12-22 16:53:17 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-02-10 10:21:17 +0100 |
commit | d7d589dc01f6d70d1518b74d46fd3b75e76267f5 (patch) | |
tree | f9df59951453660f0038ed78cf5ceadc852bf74c /include/my_crypt.h | |
parent | 3a3ec744b5a31318a00821dc0ed6da8af49fda25 (diff) | |
download | mariadb-git-d7d589dc01f6d70d1518b74d46fd3b75e76267f5.tar.gz |
Push for testing of encryption
Diffstat (limited to 'include/my_crypt.h')
-rw-r--r-- | include/my_crypt.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/my_crypt.h b/include/my_crypt.h new file mode 100644 index 00000000000..c6b5e734b5e --- /dev/null +++ b/include/my_crypt.h @@ -0,0 +1,42 @@ +// TODO: Add Windows support + +#ifndef MYSYS_MY_CRYPT_H_ +#define MYSYS_MY_CRYPT_H_ + +#include <my_aes.h> + +#if !defined(HAVE_YASSL) && defined(HAVE_OPENSSL) + +#define HAVE_EncryptAes128Ctr + +C_MODE_START +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); + +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 + +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 DecryptAes128Ctr(const uchar* key, + const uchar* iv, int iv_size, + const uchar* ciphertext, int ciphertext_size, + uchar* plaintext, int* plaintext_used); + +#endif /* !defined(HAVE_YASSL) && defined(HAVE_OPENSSL) */ + +C_MODE_START +Crypt_result my_random_bytes(uchar* buf, int num); +C_MODE_END + +#endif /* MYSYS_MY_CRYPT_H_ */ |