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
ctxAES context
ivinitialization vector (updated after use)
inputbuffer holding the input data
outputbuffer 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
ctxAES context
input16-byte input block
output16-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
ctxAES context
ivinitialization vector (updated after use)
inputbuffer holding the input data
outputbuffer holding the output data

◆ 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
ctxAES context
input16-byte input block
output16-byte output block

◆ 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
ctxAES context to be initialized
keydecryption key
keysize_bitsmust 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
ctxAES context to be initialized
keyencryption key
keysize_bitsmust be 128, 192 or 256