ccm_security.c File Reference
CCM Library API. More...
Go to the source code of this file.
Functions | |
static void | ccm_generate_A0 (uint8_t *ptr) |
This function is used to create A0 which is actual init vector to be used to encrypt full rf message. | |
ccm_globals_t * | ccm_sec_init (uint8_t sec_level, const uint8_t *ccm_key, uint8_t mode, uint8_t ccm_l) |
A function to init CCM library. | |
int8_t | ccm_process_run (ccm_globals_t *ccm_params) |
A function to init CCM library. |
Detailed Description
CCM Library API.
CCM Library API:
- ccm_sec_init(), A function to init CCM library.
- ccm_process_run(), A function to run configured CCM process
CCM process sequency:
1. Init CCM library by , ccm key, ccm_sec_init()
- security level
- 128-bit ccm key
- mode: AES_CCM_ENCRYPT or AES_CCM_DECRYPT
- CCM L parameter: 2 or 3 depends nonce legth (802.15.4 use 2 and TLS security use 3) 2. Define ADATA pointer and length, if returned global structure mic_len field is > 0 3. Set Data pointer and length 4. Do configured CCM process ccm_process_run() 5. Check Return value: -If 0 Process ok -< 0 MIC fail or parameter fail
Definition in file ccm_security.c.
Function Documentation
static void ccm_generate_A0 | ( | uint8_t * | ptr ) | [static] |
This function is used to create A0 which is actual init vector to be used to encrypt full rf message.
Ai = 8-bit FLAGS | nonce | 16/24-bit counter. Si = E[key,Ai]
- Returns:
- none.
Definition at line 276 of file ccm_security.c.
int8_t ccm_process_run | ( | ccm_globals_t * | ccm_params ) |
A function to init CCM library.
A function to run the configured CCM process.
- Parameters:
-
sec_level Used CCM security level (0-7). ccm_key pointer to 128-key. mode AES_CCM_ENCRYPT or AES_CCM_DECRYPT ccm_l cuold be 2 or 3. 2 when NONCE length is 13 and 3 when length is 12. (NONCE Len= (15-ccm_l))
- Returns:
- 0 CCM process OK and when AES_CCM_DECRYPT mode was selectected also MIC was correct.
- -1 Init have not called or data or adata pointers or lengths are zero.
- -2 Null pointer given to function
Definition at line 107 of file ccm_security.c.
ccm_globals_t* ccm_sec_init | ( | uint8_t | sec_level, |
const uint8_t * | ccm_key, | ||
uint8_t | mode, | ||
uint8_t | ccm_l | ||
) |
A function to init CCM library.
A function to initialize the CCM library.
- Parameters:
-
sec_level Used CCM security level (0-7). ccm_key pointer to 128-key. mode AES_CCM_ENCRYPT or AES_CCM_DECRYPT ccm_l cuold be 2 or 3. 2 when NONCE length is 13 and 3 when length is 12. (NONCE Len= (15-ccm_l))
- Returns:
- Pointer to Global CCM paramameter buffer.
- 0 When parameter fail or CCM is Busy.
Definition at line 76 of file ccm_security.c.
Generated on Tue Jul 12 2022 12:22:30 by
