MySQL 8.0.40
Source Code Documentation
my_aes.cc File Reference
#include <sys/types.h>
#include "m_string.h"
#include "my_aes.h"
#include "my_inttypes.h"
#include "mysys/my_aes_impl.h"

Functions

void my_aes_create_key (const unsigned char *key, uint key_length, uint8 *rkey, enum my_aes_opmode opmode)
 Transforms an arbitrary long key into a fixed length AES key. More...
 

Function Documentation

◆ my_aes_create_key()

void my_aes_create_key ( const unsigned char *  key,
uint  key_length,
uint8 rkey,
enum my_aes_opmode  opmode 
)

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

AES keys are of fixed length. This routine takes an arbitrary long key iterates over it in AES key length increment and XORs the bytes with the AES key buffer being prepared. The bytes from the last incomplete iteration are XORed to the start of the key until their depletion. Needed since crypto function routines expect a fixed length key.

Parameters
[in]keyKey to use for real key creation
[in]key_lengthLength of the key
[out]rkeyReal key (used by OpenSSL)
[out]opmodeencryption mode