mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
bb1b61b312
* no --encryption-algorithm option anymore * encrypt/decrypt methods in the encryption plugin * ecnrypt/decrypt methods in the encryption_km service * file_km plugin has --file-key-management-encryption-algorithm * debug_km always uses aes_cbc * example_km changes between aes_cbc and aes_ecb for different key versions
71 lines
2.9 KiB
C
71 lines
2.9 KiB
C
/*
|
|
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 MY_CRYPT_INCLUDED
|
|
#define MY_CRYPT_INCLUDED
|
|
|
|
#include <my_aes.h>
|
|
|
|
C_MODE_START
|
|
|
|
#ifdef HAVE_EncryptAes128Ctr
|
|
|
|
int my_aes_encrypt_ctr(const uchar* source, uint source_length,
|
|
uchar* dest, uint* dest_length,
|
|
const unsigned char* key, uint key_length,
|
|
const unsigned char* iv, uint iv_length,
|
|
int no_padding);
|
|
|
|
int my_aes_decrypt_ctr(const uchar* source, uint source_length,
|
|
uchar* dest, uint* dest_length,
|
|
const unsigned char* key, uint key_length,
|
|
const unsigned char* iv, uint iv_length,
|
|
int no_padding);
|
|
|
|
#endif
|
|
|
|
int my_aes_encrypt_cbc(const uchar* source, uint source_length,
|
|
uchar* dest, uint* dest_length,
|
|
const unsigned char* key, uint key_length,
|
|
const unsigned char* iv, uint iv_length,
|
|
int no_padding);
|
|
|
|
int my_aes_decrypt_cbc(const uchar* source, uint source_length,
|
|
uchar* dest, uint* dest_length,
|
|
const unsigned char* key, uint key_length,
|
|
const unsigned char* iv, uint iv_length,
|
|
int no_padding);
|
|
|
|
int my_aes_encrypt_ecb(const uchar* source, uint source_length,
|
|
uchar* dest, uint* dest_length,
|
|
const unsigned char* key, uint key_length,
|
|
const unsigned char* iv, uint iv_length,
|
|
int no_padding);
|
|
|
|
int my_aes_decrypt_ecb(const uchar* source, uint source_length,
|
|
uchar* dest, uint* dest_length,
|
|
const unsigned char* key, uint key_length,
|
|
const unsigned char* iv, uint iv_length,
|
|
int no_padding);
|
|
|
|
int my_random_bytes(uchar* buf, int num);
|
|
|
|
C_MODE_END
|
|
|
|
#endif /* MY_CRYPT_INCLUDED */
|