LoRaMAC  4.6.0
Documentation of the API
secure-element.h
Go to the documentation of this file.
1 
38 #ifndef __SECURE_ELEMENT_H__
39 #define __SECURE_ELEMENT_H__
40 
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #endif
45 
46 #include <stdint.h>
47 #include "LoRaMacCrypto.h"
48 #include "secure-element-nvm.h"
49 
53 typedef enum eSecureElementStatus
54 {
88 
97 
106 
117 SecureElementStatus_t SecureElementComputeAesCmac( uint8_t* micBxBuffer, uint8_t* buffer, uint16_t size, KeyIdentifier_t keyID, uint32_t* cmac );
118 
128 SecureElementStatus_t SecureElementVerifyAesCmac( uint8_t* buffer, uint16_t size, uint32_t expectedCmac, KeyIdentifier_t keyID );
129 
139 SecureElementStatus_t SecureElementAesEncrypt( uint8_t* buffer, uint16_t size, KeyIdentifier_t keyID, uint8_t* encBuffer );
140 
150 
163  uint16_t devNonce, uint8_t* encJoinAccept,
164  uint8_t encJoinAcceptSize, uint8_t* decJoinAccept,
165  uint8_t* versionMinor );
166 
174 
180 uint8_t* SecureElementGetDevEui( void );
181 
189 
195 uint8_t* SecureElementGetJoinEui( void );
196 
204 
210 uint8_t* SecureElementGetPin( void );
211 
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif // __SECURE_ELEMENT_H__
SECURE_ELEMENT_ERROR_BUF_SIZE
Definition: secure-element.h:78
SecureElementDeriveAndStoreKey
SecureElementStatus_t SecureElementDeriveAndStoreKey(uint8_t *input, KeyIdentifier_t rootKeyID, KeyIdentifier_t targetKeyID)
SECURE_ELEMENT_ERROR
Definition: secure-element.h:82
SecureElementAesEncrypt
SecureElementStatus_t SecureElementAesEncrypt(uint8_t *buffer, uint16_t size, KeyIdentifier_t keyID, uint8_t *encBuffer)
SECURE_ELEMENT_ERROR_NPE
Definition: secure-element.h:66
secure-element-nvm.h
Secure Element non-volatile data.
SECURE_ELEMENT_ERROR_INVALID_LORAWAM_SPEC_VERSION
Definition: secure-element.h:74
JoinReqIdentifier_t
JoinReqIdentifier_t
Definition: LoRaMacTypes.h:951
SecureElementStatus_t
SecureElementStatus_t
Definition: secure-element.h:53
SECURE_ELEMENT_FAIL_ENCRYPT
Definition: secure-element.h:86
SecureElementSetJoinEui
SecureElementStatus_t SecureElementSetJoinEui(uint8_t *joinEui)
SecureElementGetPin
uint8_t * SecureElementGetPin(void)
SECURE_ELEMENT_SUCCESS
Definition: secure-element.h:58
SecureElementNvmData_t
Definition: secure-element-nvm.h:82
LoRaMacCrypto.h
LoRa MAC layer cryptographic functionality implementation.
SecureElementProcessJoinAccept
SecureElementStatus_t SecureElementProcessJoinAccept(JoinReqIdentifier_t joinReqType, uint8_t *joinEui, uint16_t devNonce, uint8_t *encJoinAccept, uint8_t encJoinAcceptSize, uint8_t *decJoinAccept, uint8_t *versionMinor)
SECURE_ELEMENT_FAIL_CMAC
Definition: secure-element.h:62
SecureElementGetJoinEui
uint8_t * SecureElementGetJoinEui(void)
SecureElementSetKey
SecureElementStatus_t SecureElementSetKey(KeyIdentifier_t keyID, uint8_t *key)
SecureElementSetDevEui
SecureElementStatus_t SecureElementSetDevEui(uint8_t *devEui)
KeyIdentifier_t
KeyIdentifier_t
Definition: LoRaMacTypes.h:680
SecureElementGetDevEui
uint8_t * SecureElementGetDevEui(void)
SecureElementComputeAesCmac
SecureElementStatus_t SecureElementComputeAesCmac(uint8_t *micBxBuffer, uint8_t *buffer, uint16_t size, KeyIdentifier_t keyID, uint32_t *cmac)
SecureElementInit
SecureElementStatus_t SecureElementInit(SecureElementNvmData_t *nvm)
SecureElementSetPin
SecureElementStatus_t SecureElementSetPin(uint8_t *pin)
SECURE_ELEMENT_ERROR_INVALID_KEY_ID
Definition: secure-element.h:70
SecureElementVerifyAesCmac
SecureElementStatus_t SecureElementVerifyAesCmac(uint8_t *buffer, uint16_t size, uint32_t expectedCmac, KeyIdentifier_t keyID)