![]() |
LoRaMAC
4.4.5
Documentation of the API
|
Macros | |
#define | SE_KEY_SIZE 16 |
#define | SE_EUI_SIZE 8 |
#define | SE_PIN_SIZE 4 |
Typedefs | |
typedef void(* | SecureElementNvmEvent) (void) |
#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
typedef void( * SecureElementNvmEvent) (void) |
Signature of callback function to be called by the Secure Element driver when the non volatile context have to be stored.
Return values.
SecureElementStatus_t SecureElementInit | ( | SecureElementNvmEvent | seNvmCtxChanged | ) |
Initialization of Secure Element driver
[IN] | seNvmCtxChanged - Callback function which will be called when the non-volatile context have to be stored. |
- | Status of the operation |
SecureElementStatus_t SecureElementRestoreNvmCtx | ( | void * | seNvmCtx | ) |
Restores the internal nvm context from passed pointer.
[IN] | seNvmCtx - Pointer to non-volatile module context to be restored. |
- | Status of the operation |
void* SecureElementGetNvmCtx | ( | size_t * | seNvmCtxSize | ) |
Returns a pointer to the internal non-volatile context.
[IN] | seNvmCtxSize - Size of the module non volatile context |
- | Points to a structure where the module store its non volatile context |
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 |