42#define MY_AES_IV_SIZE 16
45#define MY_AES_BLOCK_SIZE 16
69#define MY_AES_BEGIN my_aes_128_ecb
70#define MY_AES_END my_aes_256_ofb
73#define MY_AES_BAD_DATA -1
97 unsigned char *dest,
const unsigned char *
key,
99 const unsigned char *iv,
bool padding =
true,
100 vector<string> *kdf_options =
nullptr);
118 unsigned char *dest,
const unsigned char *
key,
120 const unsigned char *iv,
bool padding =
true,
121 vector<string> *kdf_options =
nullptr);
bool my_aes_needs_iv(my_aes_opmode opmode)
Return true if the AES cipher and block mode requires an IV.
Definition: my_aes_openssl.cc:256
int my_aes_encrypt(const unsigned char *source, uint32 source_length, unsigned char *dest, const unsigned char *key, uint32 key_length, enum my_aes_opmode mode, const unsigned char *iv, bool padding=true, vector< string > *kdf_options=nullptr)
Encrypt a buffer using AES.
Definition: my_aes_openssl.cc:147
my_aes_opmode
Supported AES cipher/block mode combos.
Definition: my_aes.h:48
@ my_aes_256_cbc
Definition: my_aes.h:54
@ my_aes_128_cbc
Definition: my_aes.h:52
@ my_aes_128_cfb128
Definition: my_aes.h:61
@ my_aes_128_ofb
Definition: my_aes.h:64
@ my_aes_256_cfb1
Definition: my_aes.h:57
@ my_aes_128_cfb1
Definition: my_aes.h:55
@ my_aes_192_cfb8
Definition: my_aes.h:59
@ my_aes_192_ofb
Definition: my_aes.h:65
@ my_aes_128_ecb
Definition: my_aes.h:49
@ my_aes_192_cfb1
Definition: my_aes.h:56
@ my_aes_256_ecb
Definition: my_aes.h:51
@ my_aes_192_ecb
Definition: my_aes.h:50
@ my_aes_128_cfb8
Definition: my_aes.h:58
@ my_aes_192_cfb128
Definition: my_aes.h:62
@ my_aes_256_cfb8
Definition: my_aes.h:60
@ my_aes_256_ofb
Definition: my_aes.h:66
@ my_aes_192_cbc
Definition: my_aes.h:53
@ my_aes_256_cfb128
Definition: my_aes.h:63
longlong my_aes_get_size(uint32 source_length, enum my_aes_opmode opmode)
Calculate the size of a buffer large enough for encrypted data.
Definition: my_aes_openssl.cc:245
const char * my_aes_opmode_names[]
String representations of the supported AES modes.
Definition: my_aes_openssl.cc:51
int my_aes_decrypt(const unsigned char *source, uint32 source_length, unsigned char *dest, const unsigned char *key, uint32 key_length, enum my_aes_opmode mode, const unsigned char *iv, bool padding=true, vector< string > *kdf_options=nullptr)
Decrypt an AES encrypted buffer.
Definition: my_aes_openssl.cc:194
Some integer typedefs for easier portability.
long long int longlong
Definition: my_inttypes.h:55
uint32_t uint32
Definition: my_inttypes.h:67
mode
Definition: file_handle.h:61
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2876
required string key
Definition: replication_asynchronous_connection_failover.proto:60
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42