AES utilities. More...

Modules

Types
AES data types.

Functions

void gos_aes128_buffer_encrypt_init ( gos_aes128_crypt_context_t *aes_context, const uint8_t *key)
void gos_aes128_buffer_decrypt_init ( gos_aes128_crypt_context_t *aes_context, uint8_t *iv, const uint8_t *key)
void gos_aes128_buffer_encrypt ( gos_aes128_crypt_context_t *aes_context, uint8_t *buffer, uint16_t length)
void gos_aes128_buffer_decrypt ( gos_aes128_crypt_context_t *aes_context, uint8_t *buffer, uint16_t length)
int gos_aes_setkey_enc ( gos_aes_context_t *ctx, const unsigned char *key, uint32_t keysize_bits)
AES key schedule (encryption) More...
int gos_aes_setkey_dec ( gos_aes_context_t *ctx, const unsigned char *key, uint32_t keysize_bits)
AES key schedule (decryption) More...
int gos_aes_encrypt_ecb ( gos_aes_context_t *ctx, const unsigned char input[16], unsigned char output[16])
AES-ECB block encryption. More...
int gos_aes_decrypt_ecb ( gos_aes_context_t *ctx, const unsigned char input[16], unsigned char output[16])
AES-ECB block decryption. More...
int gos_aes_encrypt_cbc ( gos_aes_context_t *ctx, unsigned char iv[16], const gos_buffer_t *input, gos_buffer_t *output)
AES-CBC buffer encryption. More...
int gos_aes_decrypt_cbc ( gos_aes_context_t *ctx, unsigned char iv[16], const gos_buffer_t *input, gos_buffer_t *output)
AES-CBC buffer encryption. More...

Detailed Description

AES utilities.

Function Documentation

gos_aes128_buffer_decrypt()

void gos_aes128_buffer_decrypt ( gos_aes128_crypt_context_t * aes_context,
uint8_t * buffer,
uint16_t length
)
Parameters
aes_context
buffer
length

gos_aes128_buffer_decrypt_init()

void gos_aes128_buffer_decrypt_init ( gos_aes128_crypt_context_t * aes_context,
uint8_t * iv,
const uint8_t * key
)
Parameters
aes_context
iv
key

gos_aes128_buffer_encrypt()

void gos_aes128_buffer_encrypt ( gos_aes128_crypt_context_t * aes_context,
uint8_t * buffer,
uint16_t length
)
Parameters
aes_context
buffer
length

gos_aes128_buffer_encrypt_init()

void gos_aes128_buffer_encrypt_init ( gos_aes128_crypt_context_t * aes_context,
const uint8_t * key
)
Parameters
aes_context
key

gos_aes_decrypt_cbc()

int gos_aes_decrypt_cbc ( gos_aes_context_t * ctx,
unsigned char iv[16],
const gos_buffer_t * input,
gos_buffer_t * output
)

AES-CBC buffer encryption.

Parameters
ctx AES context
iv initialization vector (updated after use)
input buffer holding the input data
output buffer holding the output data

gos_aes_decrypt_ecb()

int gos_aes_decrypt_ecb ( gos_aes_context_t * ctx,
const unsigned char input[16],
unsigned char output[16]
)

AES-ECB block decryption.

Parameters
ctx AES context
input 16-byte input block
output 16-byte output block

gos_aes_encrypt_cbc()

int gos_aes_encrypt_cbc ( gos_aes_context_t * ctx,
unsigned char iv[16],
const gos_buffer_t * input,
gos_buffer_t * output
)

AES-CBC buffer encryption.

Parameters
ctx AES context
iv initialization vector (updated after use)
input buffer holding the input data
output buffer holding the output data
Examples:
file/file_encrypt/crypto_utils.c , and file/log_file_encrypted/crypto_utils.c .

gos_aes_encrypt_ecb()

int gos_aes_encrypt_ecb ( gos_aes_context_t * ctx,
const unsigned char input[16],
unsigned char output[16]
)

AES-ECB block encryption.

Parameters
ctx AES context
input 16-byte input block
output 16-byte output block
Examples:
file/file_encrypt/crypto_utils.c , file/log_file_encrypted/crypto_utils.c , and security/aes_ctr/main.c .

gos_aes_setkey_dec()

int gos_aes_setkey_dec ( gos_aes_context_t * ctx,
const unsigned char * key,
uint32_t keysize_bits
)

AES key schedule (decryption)

Parameters
ctx AES context to be initialized
key decryption key
keysize_bits must be 128, 192 or 256

gos_aes_setkey_enc()

int gos_aes_setkey_enc ( gos_aes_context_t * ctx,
const unsigned char * key,
uint32_t keysize_bits
)

AES key schedule (encryption)

Parameters
ctx AES context to be initialized
key encryption key
keysize_bits must be 128, 192 or 256
Examples:
file/file_encrypt/crypto_utils.c , file/file_encrypt/decrypt.c , file/file_encrypt/encrypt.c , file/log_file_encrypted/crypto_utils.c , file/log_file_encrypted/main.c , and security/aes_ctr/main.c .