Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_aes.h
1 #ifndef _BC_AES_H
2 #define _BC_AES_H
3 
4 #include <bc_common.h>
5 
9 
10 #define BC_AES_KEYLEN 128
11 #define BC_AES_IVLEN 128
12 
14 
15 typedef uint32_t bc_aes_key_t[BC_AES_KEYLEN/8/4];
16 
18 
19 typedef uint32_t bc_aes_iv_t[BC_AES_IVLEN/8/4];
20 
22 
23 void bc_aes_init(void);
24 
30 
31 bool bc_aes_key_derivation(bc_aes_key_t decryption_key, const bc_aes_key_t key);
32 
40 
41 bool bc_aes_ecb_encrypt(void *buffer_out, const void *buffer_in, const size_t length, const bc_aes_key_t key);
42 
50 
51 bool bc_aes_ecb_decrypt(void *buffer_out, const void *buffer_in, size_t length, bc_aes_key_t key);
52 
61 
62 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);
63 
72 
73 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);
74 
78 
79 void bc_aes_key_from_uint8(bc_aes_key_t key, const uint8_t *buffer);
80 
84 
85 void bc_aes_iv_from_uint8(bc_aes_iv_t iv, const uint8_t *buffer);
86 
88 
89 #endif // _BC_AES_H
uint32_t bc_aes_key_t[BC_AES_KEYLEN/8/4]
AES 128-bit Key.
Definition: bc_aes.h:15
bool bc_aes_key_derivation(bc_aes_key_t decryption_key, const bc_aes_key_t key)
AES derivation decryption key from encryption key.
Definition: bc_aes.c:19
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)
Definition: bc_aes.c:66
void bc_aes_init(void)
Initialize AES.
Definition: bc_aes.c:12
uint32_t bc_aes_iv_t[BC_AES_IVLEN/8/4]
AES 128-bit Initialization vector.
Definition: bc_aes.h:19
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)
Definition: bc_aes.c:96
void bc_aes_iv_from_uint8(bc_aes_iv_t iv, const uint8_t *buffer)
Create Initialization vector from uint8 array.
Definition: bc_aes.c:122
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)
Definition: bc_aes.c:80
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)
Definition: bc_aes.c:52
void bc_aes_key_from_uint8(bc_aes_key_t key, const uint8_t *buffer)
Create key from uint8 array.
Definition: bc_aes.c:112