MySQL 9.1.0
Source Code Documentation
keyring_common::aes_encryption Namespace Reference

Classes

class  Aes_operation_context
 

Typedefs

using block_mode_key = std::pair< std::string, size_t >
 
using Known_block_mode_map = std::map< block_mode_key, Keyring_aes_opmode >
 

Enumerations

enum class  Keyring_aes_opmode {
  keyring_aes_256_cbc = 0 , keyring_aes_256_cfb1 , keyring_aes_256_cfb8 , keyring_aes_256_cfb128 ,
  keyring_aes_256_ofb , keyring_aes_opmode_invalid
}
 Supported AES cipher/block mode combos. More...
 
enum  aes_return_status {
  AES_OP_OK , AES_OUTPUT_SIZE_NULL , AES_KEY_TRANSFORMATION_ERROR , AES_CTX_ALLOCATION_ERROR ,
  AES_INVALID_BLOCK_MODE , AES_IV_EMPTY , AES_ENCRYPTION_ERROR , AES_DECRYPTION_ERROR
}
 

Functions

const EVP_CIPHER * aes_evp_type (const Keyring_aes_opmode mode)
 
bool aes_create_key (const unsigned char *key, unsigned int key_length, std::unique_ptr< unsigned char[]> &rkey, size_t *rkey_size, Keyring_aes_opmode opmode)
 Transforms an arbitrary long key into a fixed length AES key. More...
 
size_t get_ciphertext_size (size_t input_size, const Keyring_aes_opmode mode)
 
aes_return_status aes_encrypt (const unsigned char *source, unsigned int source_length, unsigned char *dest, const unsigned char *key, unsigned int key_length, Keyring_aes_opmode mode, const unsigned char *iv, bool padding, size_t *encrypted_length)
 
aes_return_status aes_decrypt (const unsigned char *source, unsigned int source_length, unsigned char *dest, const unsigned char *key, unsigned int key_length, enum Keyring_aes_opmode mode, const unsigned char *iv, bool padding, size_t *decrypted_length)
 

Variables

size_t aes_opmode_key_sizes []
 

Typedef Documentation

◆ block_mode_key

using keyring_common::aes_encryption::block_mode_key = typedef std::pair<std::string, size_t>

◆ Known_block_mode_map

Enumeration Type Documentation

◆ aes_return_status

Enumerator
AES_OP_OK 
AES_OUTPUT_SIZE_NULL 
AES_KEY_TRANSFORMATION_ERROR 
AES_CTX_ALLOCATION_ERROR 
AES_INVALID_BLOCK_MODE 
AES_IV_EMPTY 
AES_ENCRYPTION_ERROR 
AES_DECRYPTION_ERROR 

◆ Keyring_aes_opmode

Supported AES cipher/block mode combos.

Enumerator
keyring_aes_256_cbc 
keyring_aes_256_cfb1 
keyring_aes_256_cfb8 
keyring_aes_256_cfb128 
keyring_aes_256_ofb 
keyring_aes_opmode_invalid 

Function Documentation

◆ aes_create_key()

bool keyring_common::aes_encryption::aes_create_key ( const unsigned char *  key,
unsigned int  key_length,
std::unique_ptr< unsigned char[]> &  rkey,
size_t *  rkey_size,
Keyring_aes_opmode  opmode 
)

Transforms an arbitrary long key into a fixed length AES key.

Parameters
[in]keyKey to use for real key creation
[in]key_lengthLength of the key
[out]rkeyGenerated key
[out]rkey_sizeSize of generated key
[in]opmodeencryption mode
Returns
Key generation status
Return values
trueSuccess
falseError

◆ aes_decrypt()

aes_return_status keyring_common::aes_encryption::aes_decrypt ( const unsigned char *  source,
unsigned int  source_length,
unsigned char *  dest,
const unsigned char *  key,
unsigned int  key_length,
enum Keyring_aes_opmode  mode,
const unsigned char *  iv,
bool  padding,
size_t *  decrypted_length 
)

◆ aes_encrypt()

aes_return_status keyring_common::aes_encryption::aes_encrypt ( const unsigned char *  source,
unsigned int  source_length,
unsigned char *  dest,
const unsigned char *  key,
unsigned int  key_length,
Keyring_aes_opmode  mode,
const unsigned char *  iv,
bool  padding,
size_t *  encrypted_length 
)

◆ aes_evp_type()

const EVP_CIPHER * keyring_common::aes_encryption::aes_evp_type ( const Keyring_aes_opmode  mode)

◆ get_ciphertext_size()

size_t keyring_common::aes_encryption::get_ciphertext_size ( size_t  input_size,
const Keyring_aes_opmode  mode 
)

Variable Documentation

◆ aes_opmode_key_sizes

size_t keyring_common::aes_encryption::aes_opmode_key_sizes[]
Initial value:
= {
256 , 256 , 256 ,
256 , 256
}