Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_aes

Driver for AES. More...

Macros

#define BC_AES_KEYLEN   128
 
#define BC_AES_IVLEN   128
 

Typedefs

typedef uint32_t bc_aes_key_t [BC_AES_KEYLEN/8/4]
 AES 128-bit Key.
 
typedef uint32_t bc_aes_iv_t [BC_AES_IVLEN/8/4]
 AES 128-bit Initialization vector.
 

Functions

void bc_aes_init (void)
 Initialize AES.
 
bool bc_aes_key_derivation (bc_aes_key_t decryption_key, const bc_aes_key_t key)
 AES derivation decryption key from encryption key. More...
 
bool bc_aes_ecb_encrypt (void *buffer_out, const void *buffer_in, const size_t length, const bc_aes_key_t key)
 AES encryption Electronic CodeBook (ECB) More...
 
bool bc_aes_ecb_decrypt (void *buffer_out, const void *buffer_in, size_t length, bc_aes_key_t key)
 AES decryption Electronic CodeBook (ECB) More...
 
bool bc_aes_cbc_encrypt (void *buffer_out, const void *buffer_in, size_t length, bc_aes_key_t key, bc_aes_iv_t iv)
 AES Cipher block chaining (CBC) More...
 
bool bc_aes_cbc_decrypt (void *buffer_out, const void *buffer_in, size_t length, bc_aes_key_t key, bc_aes_iv_t iv)
 AES Cipher block chaining (CBC) More...
 
void bc_aes_key_from_uint8 (bc_aes_key_t key, const uint8_t *buffer)
 Create key from uint8 array. More...
 
void bc_aes_iv_from_uint8 (bc_aes_iv_t iv, const uint8_t *buffer)
 Create Initialization vector from uint8 array. More...
 

Detailed Description

Driver for AES.

Function Documentation

bool bc_aes_cbc_decrypt ( void *  buffer_out,
const void *  buffer_in,
size_t  length,
bc_aes_key_t  key,
bc_aes_iv_t  iv 
)

AES Cipher block chaining (CBC)

Parameters
[out]buffer_outPointer to destination buffer
[in]buffer_inPointer to source buffer
[in]lengthNumber of bytes
[in]key128-bit decryption key
[in]iv128-bit Initialization vector
Returns
true On success
false On failure

Definition at line 96 of file bc_aes.c.

bool bc_aes_cbc_encrypt ( void *  buffer_out,
const void *  buffer_in,
size_t  length,
bc_aes_key_t  key,
bc_aes_iv_t  iv 
)

AES Cipher block chaining (CBC)

Parameters
[out]buffer_outPointer to destination buffer
[in]buffer_inPointer to source buffer
[in]lengthNumber of bytes
[in]key128-bit encryption key
[in]iv128-bit Initialization vector
Returns
true On success
false On failure

Definition at line 80 of file bc_aes.c.

bool bc_aes_ecb_decrypt ( void *  buffer_out,
const void *  buffer_in,
size_t  length,
bc_aes_key_t  key 
)

AES decryption Electronic CodeBook (ECB)

Parameters
[out]buffer_outPointer to destination buffer
[in]buffer_inPointer to source buffer
[in]lengthNumber of bytes
[in]key128-bit decryption key
Returns
true On success
false On failure

Definition at line 66 of file bc_aes.c.

bool bc_aes_ecb_encrypt ( void *  buffer_out,
const void *  buffer_in,
const size_t  length,
const bc_aes_key_t  key 
)

AES encryption Electronic CodeBook (ECB)

Parameters
[out]buffer_outPointer to destination buffer
[in]buffer_inPointer to source buffer
[in]lengthNumber of bytes
[in]key128-bit encryption key
Returns
true On success
false On failure

Definition at line 52 of file bc_aes.c.

void bc_aes_iv_from_uint8 ( bc_aes_iv_t  iv,
const uint8_t *  buffer 
)

Create Initialization vector from uint8 array.

Parameters
[out]iv128-bit Initialization vector
[in]bufferPointer to source buffer

Definition at line 122 of file bc_aes.c.

bool bc_aes_key_derivation ( bc_aes_key_t  decryption_key,
const bc_aes_key_t  key 
)

AES derivation decryption key from encryption key.

Parameters
[out]key128-bit decryption key
[in]key128-bit encryption key
Returns
true On success
false On failure

Definition at line 19 of file bc_aes.c.

Here is the call graph for this function:

void bc_aes_key_from_uint8 ( bc_aes_key_t  key,
const uint8_t *  buffer 
)

Create key from uint8 array.

Parameters
[out]keykey 128-bit encryption key
[in]bufferPointer to source buffer

Definition at line 112 of file bc_aes.c.