Functions | |
SalStatus_t | SAL_AESCmac (uint8_t *key, salItems_t key_type, uint8_t *output, uint8_t *input, uint16_t size) |
This function calculates the CMAC value using the key specified. More... | |
SalStatus_t | SAL_AESEncode (unsigned char *buffer, salItems_t key_type, unsigned char *key) |
This function encrypts the given block of data with the key specified/the key stored in ECC608A. More... | |
SalStatus_t | SAL_DeriveSessionKey (unsigned char *block, salItems_t src_key, unsigned char *key, salItems_t target_key) |
This function derives the session key using the Block of data given as input. More... | |
static void | sal_FillSubKey (uint8_t *source, uint8_t *key, uint8_t size) |
static void | sal_GenerateSubkey (uint8_t *key, salItems_t key_type, uint8_t *k1, uint8_t *k2) |
SalStatus_t | SAL_Init (void) |
This function initializes the security modules like AES, ECC608 (If used) More... | |
SalStatus_t | SAL_Read (salItems_t key_type, uint8_t *key) |
This function reads back the keys from ECC608 device using Encrypted Read/Plain read based on key type. More... | |
SalStatus_t SAL_AESCmac | ( | uint8_t * | key, |
salItems_t | key_type, | ||
uint8_t * | output, | ||
uint8_t * | input, | ||
uint16_t | size | ||
) |
This function calculates the CMAC value using the key specified.
[in] | *key | - Pointer to the key which is used for calculating CMAC value for the given buffer (AppKey/NwkSKey/AppSKey) |
[in] | key_type | - value of type salItems_t - Name of the key which is used to calculate the CMAC (Note: This parameter is used when key is stored in ECC608) |
[out] | *output | - Pointer to the 16bytes CMAC value |
[in] | *input | - Pointer to the data for which CMAC value is being calculated |
[in] | size | - Length of the data for which CMAC value is being calculated |
References flag, i, j, NULL, ptr, SAL_AESEncode(), sal_GenerateSubkey(), and SAL_SUCCESS.
SalStatus_t SAL_AESEncode | ( | unsigned char * | buffer, |
salItems_t | key_type, | ||
unsigned char * | key | ||
) |
This function encrypts the given block of data with the key specified/the key stored in ECC608A.
[in] | *buffer | - pointer to block of data to be encrypted |
[in] | key_type | - Name of the key which is used to encrypt the data (Note: This parameter is used when Key is stored in ECC608) |
[in] | *key | - Pointer to the key used for Encryption (Note: This parameter is used when Key is provided by the upper layer) |
References AESEncode(), SAL_APP_KEY, SAL_APPS_KEY, SAL_FAILURE, SAL_INVALID_KEY_TYPE, SAL_MCAST_APPS_KEY, SAL_MCAST_NWKS_KEY, SAL_NWKS_KEY, and SAL_SUCCESS.
Referenced by SAL_AESCmac(), SAL_DeriveSessionKey(), and sal_GenerateSubkey().
SalStatus_t SAL_DeriveSessionKey | ( | unsigned char * | block, |
salItems_t | src_key, | ||
unsigned char * | key, | ||
salItems_t | target_key | ||
) |
This function derives the session key using the Block of data given as input.
[in] | *block | - pointer to block of data (16 Bytes) used for deriving the session key |
[in] | src_key | - value of type salItems_t - Name of the key which is used to derive the session key (Note: This parameter is used when src_key is stored in ECC608) |
[in] | target_key | - value of type salItems_t - Name of the Derived Session Key (NwkSKey/AppSKey) |
[out] | *key | - Pointer to the derived key (NwkSKey/AppSKey) (Note: Incase ECC608 is used as Keystorage device, Session keys will be directly stored in the memory slots and this pointer will be invalid in that case) |
References NULL, SAL_AESEncode(), SAL_APP_KEY, SAL_FAILURE, and SAL_SUCCESS.
|
static |
References i.
Referenced by sal_GenerateSubkey().
|
static |
References i, SAL_AESEncode(), and sal_FillSubKey().
Referenced by SAL_AESCmac().
SalStatus_t SAL_Init | ( | void | ) |
This function initializes the security modules like AES, ECC608 (If used)
References AESInit(), and SAL_SUCCESS.
SalStatus_t SAL_Read | ( | salItems_t | key_type, |
uint8_t * | key | ||
) |
This function reads back the keys from ECC608 device using Encrypted Read/Plain read based on key type.
This function reads back the keys from ECC608 device using Encrypted Read.
[in] | key_type | - value of type salItems_t - Name of the key which is being read back from ECC608 |
[in] | *key | - Pointer to the key which is read back from ECC608 |
References SAL_APPS_KEY, SAL_DEV_EUI, SAL_EUI_LEN, SAL_FAILURE, SAL_INVALID_KEY_TYPE, SAL_JOIN_EUI, SAL_MCAST_APPS_KEY, SAL_MCAST_NWKS_KEY, SAL_NWKS_KEY, and SAL_SUCCESS.