LoRaMAC
4.4.6
Documentation of the API
|
Data Structures | |
struct | SecureElementNvmData_t |
Macros | |
#define | SE_KEY_SIZE 16 |
#define | SE_EUI_SIZE 8 |
#define | SE_PIN_SIZE 4 |
struct SecureElementNvmData_t |
Data Fields | ||
---|---|---|
uint8_t | DevEui[SE_EUI_SIZE] |
DevEUI storage |
uint8_t | JoinEui[SE_EUI_SIZE] |
Join EUI storage |
uint8_t | Pin[SE_PIN_SIZE] |
Pin storage |
uint32_t | Crc32 |
CRC32 value of the SecureElement data structure. |
#define SE_KEY_SIZE 16 |
Secure-element keys size in bytes
#define SE_EUI_SIZE 8 |
Secure-element EUI size in bytes
#define SE_PIN_SIZE 4 |
Secure-element pin size in bytes
Return values.
SecureElementStatus_t SecureElementInit | ( | SecureElementNvmData_t * | nvm | ) |
Initialization of Secure Element driver
[IN] | nvm - Pointer to the non-volatile memory data structure. |
- | Status of the operation |
SecureElementStatus_t SecureElementSetKey | ( | KeyIdentifier_t | keyID, |
uint8_t * | key | ||
) |
Sets a key
[IN] | keyID - Key identifier |
[IN] | key - Key value |
- | Status of the operation |
SecureElementStatus_t SecureElementComputeAesCmac | ( | uint8_t * | micBxBuffer, |
uint8_t * | buffer, | ||
uint16_t | size, | ||
KeyIdentifier_t | keyID, | ||
uint32_t * | cmac | ||
) |
Computes a CMAC of a message using provided initial Bx block
[IN] | micBxBuffer - Buffer containing the initial Bx block |
[IN] | buffer - Data buffer |
[IN] | size - Data buffer size |
[IN] | keyID - Key identifier to determine the AES key to be used |
[OUT] | cmac - Computed cmac |
- | Status of the operation |
SecureElementStatus_t SecureElementVerifyAesCmac | ( | uint8_t * | buffer, |
uint16_t | size, | ||
uint32_t | expectedCmac, | ||
KeyIdentifier_t | keyID | ||
) |
Verifies a CMAC (computes and compare with expected cmac)
[IN] | buffer - Data buffer | |
[IN] | size - Data buffer size | |
[in] | expectedCmac | - Expected cmac |
[IN] | keyID - Key identifier to determine the AES key to be used |
- | Status of the operation |
SecureElementStatus_t SecureElementAesEncrypt | ( | uint8_t * | buffer, |
uint16_t | size, | ||
KeyIdentifier_t | keyID, | ||
uint8_t * | encBuffer | ||
) |
Encrypt a buffer
[IN] | buffer - Data buffer |
[IN] | size - Data buffer size |
[IN] | keyID - Key identifier to determine the AES key to be used |
[OUT] | encBuffer - Encrypted buffer |
- | Status of the operation |
SecureElementStatus_t SecureElementDeriveAndStoreKey | ( | uint8_t * | input, |
KeyIdentifier_t | rootKeyID, | ||
KeyIdentifier_t | targetKeyID | ||
) |
Derives and store a key
[IN] | input - Input data from which the key is derived ( 16 byte ) |
[IN] | rootKeyID - Key identifier of the root key to use to perform the derivation |
[IN] | targetKeyID - Key identifier of the key which will be derived |
- | Status of the operation |
SecureElementStatus_t SecureElementProcessJoinAccept | ( | JoinReqIdentifier_t | joinReqType, |
uint8_t * | joinEui, | ||
uint16_t | devNonce, | ||
uint8_t * | encJoinAccept, | ||
uint8_t | encJoinAcceptSize, | ||
uint8_t * | decJoinAccept, | ||
uint8_t * | versionMinor | ||
) |
Process JoinAccept message.
[IN] | encJoinAccept - Received encrypted JoinAccept message |
[IN] | encJoinAcceptSize - Received encrypted JoinAccept message Size |
[OUT] | decJoinAccept - Decrypted and validated JoinAccept message |
[OUT] | versionMinor - Detected LoRaWAN specification version minor field.
|
- | Status of the operation |
SecureElementStatus_t SecureElementRandomNumber | ( | uint32_t * | randomNum | ) |
Generates a random number
[OUT] | randomNum - 32 bit random number |
- | Status of the operation |
SecureElementStatus_t SecureElementSetDevEui | ( | uint8_t * | devEui | ) |
Sets the DevEUI
[IN] | devEui - Pointer to the 8-byte devEUI |
- | Status of the operation |
uint8_t* SecureElementGetDevEui | ( | void | ) |
Gets the DevEUI
- | Pointer to the 8-byte devEUI |
SecureElementStatus_t SecureElementSetJoinEui | ( | uint8_t * | joinEui | ) |
Sets the JoinEUI
[IN] | joinEui - Pointer to the 8-byte joinEui |
- | Status of the operation |
uint8_t* SecureElementGetJoinEui | ( | void | ) |
Gets the DevEUI
- | Pointer to the 8-byte joinEui |
SecureElementStatus_t SecureElementSetPin | ( | uint8_t * | pin | ) |
Sets the pin
[IN] | pin - Pointer to the 4-byte pin |
- | Status of the operation |
uint8_t* SecureElementGetPin | ( | void | ) |
Gets the Pin
- | Pointer to the 4-byte pin |