Security#
This file describes the functions necessary to manage security for a regular device. These are the three major modes for security and applications, which should link in the appropriate library:
Residential security uses only network keys. This is the only supported option for ZigBee 2006 devices.
Standard security uses network keys with optional link keys. Ember strongly recommends using Link Keys. It is possible for 2006 devices to run on a network that uses Standard Security.
See security.h for source code.
This file describes the functions for performing an AES-MMO hash on a block of data. The block of data may be small and contiguous, in which case the emberAesHashSimple() routine can be used. Or large and discontiguous (such as a file stored in EEPROM), in which case the application must pass chunks to emberAesMmoHashUpdate() routine and use emberAesMmoHashFinal() on the last chunk.
This file describes routines for getting pseudo- and strong-random numbers.
Modules#
Variables#
The length of time, in seconds, that a trust center will store a transient link key that a device can use to join its network. A transient key is added with a call to sl_zb_sec_man_import_transient_key. After the transient key is added, it will be removed once this amount of time has passed. A joining device will not be able to use that key to join until it is added again on the trust center. The default value is 300 seconds, i.e., 5 minutes.
Functions#
Set the initial security state that will be used by the device when it forms or joins a network. If security is enabled, this function must be called prior to forming or joining the network. It must also be called if the device left the network and wishes to form or join another network.
Set the extended initial security bitmask.
Get the extended security bitmask that is used by a device.
Get the security state that is used by a device joined into the Network. We can still get current security state by calling this function and the return value can be EMBER_NOT_JOINED or EMBER_SUCCESS.
Generate a Random Key (link, network, or master) and returns the result.
Inform the application that the Network Key has been updated and the node has been switched over to use the new key. The actual key being used is not passed up, but the sequence number is.
Request a Link Key from the Trust Center with another device device on the Network (which could be the Trust Center). A Link Key with the Trust Center is possible but the requesting device can't be the Trust Center. Link Keys are optional in ZigBee Standard Security. Therefore, the stack can't know whether the other device supports them.
Request a new link link key from the Trust Center. This function starts by sending a Node Descriptor request to the Trust Center to verify its R21+ stack version compliance. A Request Key message will then be sent, followed by a Verify Key Confirm message.
Notify the application about the status of the request for a Link Key. The application should define EMBER_APPLICATION_HAS_ZIGBEE_KEY_ESTABLISHMENT_HANDLER to implement its own handler.
Search the key table to find an entry matching the specified IEEE address and key type.
Clear a single entry in the key table.
Clear the key table of the current network.
Suppress normal write operations of the stack tokens. This is only done in rare circumstances when the device already has network parameters but needs to conditionally rejoin a network in order to perform a security message exchange (i.e., key establishment). If the network is not authenticated properly, it needs to forget any stack data it used and return to the old network. By suppressing writing of the stack tokens the device will not have stored any persistent data about the network and a reboot will clear the RAM copies. The Smart Energy profile feature Trust Center Swap-out uses this to securely replace the Trust Center and re-authenticate to it.
Immediately write the value of stack tokens and then resume normal network operation by writing the stack tokens at appropriate intervals or changes in state. It has no effect unless a previous call was made to emberStopWritingStackTokens().
Determine whether stack tokens will be written to persistent storage when they change. By default, it is set to true meaning the stack will update its internal tokens via HAL calls when the associated RAM values change.
Perform APS encryption/decryption of messages directly. Normally, the stack handles all APS encryption/decryption automatically and there is no need to call this function. If APS data is sent or received via some other means (such as over interpan), APS encryption/decryption must be done manually. If the decryption is performed, the Auxiliary security header and MIC will be removed from the message. If encrypting, the auxiliary header and MIC will be added to the message. This is only available on SOC platforms.
Retrieve the security configuration stored in manufacturing tokens. It is only available on the 35x series. See emberSetMfgSecurityConfig() for more details.
Set the security configuration to be stored in manufacturing tokens. It is only available on the 35x series. This API must be called with care. Once set, a manufacturing token CANNOT BE UNSET without using the ISA3 tools and connecting the chip via JTAG. Additionally, a chip with read protection enabled cannot have its configuration changed without a full chip erase. Therefore, this provides a way to disallow access to the keys at runtime that cannot be undone.
Set the NWK layer outgoing frame counter (intended for device restoration purposes). Caveats:
Set the APS layer outgoing frame counter for Trust Center Link Key (intended for device restoration purposes). Caveats:
Clear all transient link keys from RAM.
This routine clears the passed context so that a new hash calculation can be performed.
This routine processes the passed chunk of data and updates the hash calculation based on it. The data passed in MUST have a length that is a multiple of 16.
This routine processes the passed chunk of data (if non-NULL) and update the hash context that is passed in. In then performs the final calculations on the hash and returns the final answer in the result parameter of the EmberAesMmoHashContext structure. The length of the data passed in may be any value, it does not have to be a multiple of 16.
This is a convenience method when the hash data is less than 255 bytes. It inits, updates, and finalizes the hash in one function call.
Get ::count number of true random numbers. The method of obtaining and quality of the random varies by chip family and the configuration used. For high security applications, please verify that that the generator's properties match your needs.
Return the entropy source used for true random number generation.
Macros#
The block size in bytes of the encryption cypher (AES-MMO-128).
A non-trust center device configuration bitmask example. There is no Preconfigured Link Key, so the NWK key is expected to be sent in-the-clear. The device will request a Trust Center Link key after getting the Network Key.
A non-trust center device configuration bitmask example. The device has a Preconfigured Link Key and expects to receive a NWK Key encrypted at the APS Layer. A NWK key sent in-the-clear will be rejected.
Wrapper for the HAL API to generate pseudo-random numbers.
Generate one true random number. For more info check emberGetStrongRandomNumberArray.
Variable Documentation#
emberTransientKeyTimeoutS#
uint16_t emberTransientKeyTimeoutS
The length of time, in seconds, that a trust center will store a transient link key that a device can use to join its network. A transient key is added with a call to sl_zb_sec_man_import_transient_key. After the transient key is added, it will be removed once this amount of time has passed. A joining device will not be able to use that key to join until it is added again on the trust center. The default value is 300 seconds, i.e., 5 minutes.
451
of file stack/include/security.h
Function Documentation#
emberSetInitialSecurityState#
EmberStatus emberSetInitialSecurityState (EmberInitialSecurityState * state)
Set the initial security state that will be used by the device when it forms or joins a network. If security is enabled, this function must be called prior to forming or joining the network. It must also be called if the device left the network and wishes to form or join another network.
N/A | state | The security configuration to be set. |
This call should not be used when restoring prior network operation from saved state via emberNetworkInit because this will cause saved security settings and keys table from the prior network to be erased, resulting in improper keys and/or frame counter values being used, which will prevent proper communication with other devices in the network. Calling emberNetworkInit is sufficient to restore all saved security settings after a reboot and re-enter the network.
The call may be used by either the Trust Center or non Trust Center devices, the options that are set are different depending on which role the device will assume. See the EmberInitialSecurityState structure for more explanation about the various security settings.
The function will return EMBER_SECURITY_CONFIGURATION_INVALID in the following cases:
Distributed Trust Center Mode was enabled with Hashed Link Keys.
Returns
An EmberStatus value. EMBER_SUCCESS if the security state has been set successfully. EMBER_INVALID_CALL if the device is not in the EMBER_NO_NETWORK state. The value EMBER_SECURITY_CONFIGURATION_INVALID is returned if the combination of security parameters is not valid. EMBER_KEY_INVALID is returned if a reserved or invalid key value was passed in the key structure for one of the keys.
80
of file stack/include/security.h
emberSetExtendedSecurityBitmask#
EmberStatus emberSetExtendedSecurityBitmask (EmberExtendedSecurityBitmask mask)
Set the extended initial security bitmask.
N/A | mask | An object of type EmberExtendedSecurityBitmask that indicates what the extended security bitmask should be set to. |
Returns
EMBER_SUCCESS if the security settings were successfully retrieved. EMBER_INVALID_CALL otherwise.
90
of file stack/include/security.h
emberGetExtendedSecurityBitmask#
EmberStatus emberGetExtendedSecurityBitmask (EmberExtendedSecurityBitmask * mask)
Get the extended security bitmask that is used by a device.
N/A | mask | A pointer to an EmberExtendedSecurityBitmask value into which the extended security bitmask will be copied. |
Returns
EMBER_SUCCESS if the security settings were successfully retrieved. EMBER_INVALID_CALL otherwise.
100
of file stack/include/security.h
emberGetCurrentSecurityState#
EmberStatus emberGetCurrentSecurityState (EmberCurrentSecurityState * state)
Get the security state that is used by a device joined into the Network. We can still get current security state by calling this function and the return value can be EMBER_NOT_JOINED or EMBER_SUCCESS.
N/A | state | A pointer to an EmberCurrentSecurityState value into which the security configuration will be copied. |
Returns
EMBER_SUCCESS if the security settings were successfully retrieved. EMBER_NOT_JOINED if the device is not currently joined in the network.
133
of file stack/include/security.h
emberGenerateRandomKey#
EmberStatus emberGenerateRandomKey (EmberKeyData * keyAddress)
Generate a Random Key (link, network, or master) and returns the result.
N/A | keyAddress | A pointer to the location in which to copy the generated key. |
It copies the key into the array that result
points to. This is an time-expensive operation as it needs to obtain truly random numbers.
Returns
EMBER_SUCCESS on success, EMBER_INSUFFICIENT_RANDOM_DATA on failure.
153
of file stack/include/security.h
emberSwitchNetworkKeyHandler#
void emberSwitchNetworkKeyHandler (uint8_t sequenceNumber)
Inform the application that the Network Key has been updated and the node has been switched over to use the new key. The actual key being used is not passed up, but the sequence number is.
N/A | sequenceNumber | The sequence number of the new network key. |
162
of file stack/include/security.h
emberRequestLinkKey#
EmberStatus emberRequestLinkKey (EmberEUI64 partner)
Request a Link Key from the Trust Center with another device device on the Network (which could be the Trust Center). A Link Key with the Trust Center is possible but the requesting device can't be the Trust Center. Link Keys are optional in ZigBee Standard Security. Therefore, the stack can't know whether the other device supports them.
N/A | partner | The IEEE address of the partner device. If NULL is passed in, the Trust Center IEEE Address is assumed. |
If the partner device is the Trust Center, only that device needs to request the key. The Trust Center will immediately respond to those requests and send the key back to the device.
If the partner device is not the Trust Center, both devices must request an Application Link Key with each other. The requests will be sent to the Trust Center for it to answer. The Trust Center will store the first request and wait EMBER_REQUEST_KEY_TIMEOUT for the second request to be received. The Trust Center only supports one outstanding Application key request at a time and therefore will ignore other requests that are not associated with the first request.
Sleepy devices should poll at a higher rate until a response is received or the request times out.
The success or failure of the request is returned via ::emberZigbeeKeyEstablishmentHandler(...)
Returns
EMBER_SUCCESS if the call succeeds, or EMBER_NO_BUFFERS.
193
of file stack/include/security.h
emberUpdateTcLinkKey#
EmberStatus emberUpdateTcLinkKey (uint8_t maxAttempts)
Request a new link link key from the Trust Center. This function starts by sending a Node Descriptor request to the Trust Center to verify its R21+ stack version compliance. A Request Key message will then be sent, followed by a Verify Key Confirm message.
N/A | maxAttempts | The maximum number of attempts a node should make when sending the Node Decriptor, Request Key, and Verify Key Confirm messages. The number of attempts resets for each message type sent (e.g., if maxAttempts is 3, up to 3 Node Descriptors are sent, up to 3 Request Keys, and up to 3 Verify Key Confirm messages are sent). |
Returns
EMBER_ERR_FATAL is the Security Core Library is not included. EMBER_INVALID_CALL if already requesting a key from TC, not on network, or if local node is Trust Center. EMBER_SECURITY_CONFIGURATION_INVALID if the Trust Center's EUI is unknown. Otherwise, the return status from sending the initial Node Descriptor is returned.
213
of file stack/include/security.h
emberZigbeeKeyEstablishmentHandler#
void emberZigbeeKeyEstablishmentHandler (EmberEUI64 partner, EmberKeyStatus status)
Notify the application about the status of the request for a Link Key. The application should define EMBER_APPLICATION_HAS_ZIGBEE_KEY_ESTABLISHMENT_HANDLER to implement its own handler.
N/A | partner | The IEEE address of the partner device or all zeros if the Key establishment failed. |
N/A | status | The status of the key establishment. |
224
of file stack/include/security.h
emberFindKeyTableEntry#
uint8_t emberFindKeyTableEntry (EmberEUI64 address, bool linkKey)
Search the key table to find an entry matching the specified IEEE address and key type.
N/A | address | The IEEE Address of the partner device that shares the key. To find the first empty entry, pass in an address of all zeros. |
N/A | linkKey | A bool indicating whether to search for an entry containing a Link or Master Key. |
Returns
The index that matches the search criteria, or 0xFF if no matching entry was found.
237
of file stack/include/security.h
emberEraseKeyTableEntry#
EmberStatus emberEraseKeyTableEntry (uint8_t index)
Clear a single entry in the key table.
N/A | index | The index in the key table of the entry to erase. |
Returns
EMBER_SUCCESS if the index is valid and the key data was erased. EMBER_KEY_INVALID if the index is out of range for the size of the key table.
248
of file stack/include/security.h
emberClearKeyTable#
EmberStatus emberClearKeyTable (void )
Clear the key table of the current network.
N/A |
Returns
EMBER_SUCCESS if the key table was successfully cleared. EMBER_INVALID_CALL otherwise.
256
of file stack/include/security.h
emberStopWritingStackTokens#
EmberStatus emberStopWritingStackTokens (void )
Suppress normal write operations of the stack tokens. This is only done in rare circumstances when the device already has network parameters but needs to conditionally rejoin a network in order to perform a security message exchange (i.e., key establishment). If the network is not authenticated properly, it needs to forget any stack data it used and return to the old network. By suppressing writing of the stack tokens the device will not have stored any persistent data about the network and a reboot will clear the RAM copies. The Smart Energy profile feature Trust Center Swap-out uses this to securely replace the Trust Center and re-authenticate to it.
N/A |
Returns
EMBER_SUCCESS if it could allocate temporary buffers to store network information. EMBER_NO_BUFFERS otherwise.
272
of file stack/include/security.h
emberStartWritingStackTokens#
EmberStatus emberStartWritingStackTokens (void )
Immediately write the value of stack tokens and then resume normal network operation by writing the stack tokens at appropriate intervals or changes in state. It has no effect unless a previous call was made to emberStopWritingStackTokens().
N/A |
Returns
EMBER_SUCCESS if it had previously unwritten tokens from a call to emberStopWritingStackTokens() that it now wrote to the token system. EMBER_INVALID_CALL otherwise.
284
of file stack/include/security.h
emberWritingStackTokensEnabled#
bool emberWritingStackTokensEnabled (void )
Determine whether stack tokens will be written to persistent storage when they change. By default, it is set to true meaning the stack will update its internal tokens via HAL calls when the associated RAM values change.
N/A |
Returns
True if the device will update the persistent storage for tokens when values in RAM change. False otherwise.
294
of file stack/include/security.h
emberApsCryptMessage#
EmberStatus emberApsCryptMessage (bool encrypt, EmberMessageBuffer * buffer, uint8_t apsHeaderEndIndex, EmberEUI64 remoteEui64)
Perform APS encryption/decryption of messages directly. Normally, the stack handles all APS encryption/decryption automatically and there is no need to call this function. If APS data is sent or received via some other means (such as over interpan), APS encryption/decryption must be done manually. If the decryption is performed, the Auxiliary security header and MIC will be removed from the message. If encrypting, the auxiliary header and MIC will be added to the message. This is only available on SOC platforms.
N/A | encrypt | A bool indicating whether perform encryption (true) or decryption (false). |
N/A | buffer | An EmberMessageBuffer containing the APS frame to decrypt or encrypt. |
N/A | apsHeaderEndIndex | The index in the buffer where the APS header ends. If encryption is being performed, this should point to the APS payload, where an Auxiliary header will be inserted. If decryption is being performed, this should point to the start of the Auxiliary header frame. |
N/A | remoteEui64 | the ::EmberEUI64 of the remote device the message was received from (decryption) or being sent to (encryption). |
Returns
EMBER_SUCCESS if encryption/decryption was performed successfully. An appropriate EmberStatus code on failure.
323
of file stack/include/security.h
emberGetMfgSecurityConfig#
EmberStatus emberGetMfgSecurityConfig (EmberMfgSecurityStruct * settings)
Retrieve the security configuration stored in manufacturing tokens. It is only available on the 35x series. See emberSetMfgSecurityConfig() for more details.
N/A | settings | A pointer to the EmberMfgSecurityStruct variable that will contain the returned data. |
Returns
EMBER_SUCCESS if the tokens were successfully read. EmberStatus error code otherwise.
338
of file stack/include/security.h
emberSetMfgSecurityConfig#
EmberStatus emberSetMfgSecurityConfig (uint32_t magicNumber, const EmberMfgSecurityStruct * settings)
Set the security configuration to be stored in manufacturing tokens. It is only available on the 35x series. This API must be called with care. Once set, a manufacturing token CANNOT BE UNSET without using the ISA3 tools and connecting the chip via JTAG. Additionally, a chip with read protection enabled cannot have its configuration changed without a full chip erase. Therefore, this provides a way to disallow access to the keys at runtime that cannot be undone.
N/A | magicNumber | A 32-bit value that must correspond to EMBER_MFG_SECURITY_CONFIG_MAGIC_NUMBER, otherwise EMBER_INVALID_CALL will be returned. |
N/A | settings | The security settings that are intended to be set by the application and written to manufacturing token. |
To call this API, the magic number must be passed in corresponding to EMBER_MFG_SECURITY_CONFIG_MAGIC_NUMBER. This prevents accidental calls to this function when emberGetMfgSecurityConfig() was actually intended.
This function will disable external access to the actual key data used for decryption/encryption outside the stack. Attempts to export the key will return the metadata if applicable (e.g., sequence number, associated EUI64, frame counters) but the key value may be modified, see below.
The stack always has access to the actual key data.
If the EmberKeySettings within the EmberMfgSecurityStruct are set to EMBER_KEY_PERMISSIONS_NONE, the key value will be set to zero when sl_zb_sec_man_export_key() or similar functions are called. If the EmberKeySettings within the EmberMfgSecurityStruct are set to EMBER_KEY_PERMISSIONS_HASHING_ALLOWED, the AES-MMO hash of the key will replace the actual key data when calls to functions like sl_zb_sec_man_export_key() are made. If the EmberKeySettings within the EmberMfgSecurityStruct are set to EMBER_KEY_PERMISSIONS_READING_ALLOWED, the actual key data is returned. This is the default value of the token.
Returns
EMBER_BAD_ARGUMENT if the passed magic number is invalid. EMBER_INVALID_CALL if the chip does not support writing MFG tokens EMBER_SECURITY_CONFIGURATION_INVALID if there was an attempt to write an unerased manufacturing token (i.e., the token has already been set).
384
of file stack/include/security.h
emberSetOutgoingNwkFrameCounter#
EmberStatus emberSetOutgoingNwkFrameCounter (uint32_t desiredValue)
Set the NWK layer outgoing frame counter (intended for device restoration purposes). Caveats:
N/A | desiredValue | The desired outgoing NWK frame counter value. This needs to be less than MAX_INT32U_VALUE to ensure that rollover does not occur on the next encrypted transmission. |
Can only be called before NetworkInit / FormNetwork / JoinNetwork, when emberNetworkState()==EMBER_NO_NETWORK.
This function should be called before emberSetInitialSecurityState, and the EMBER_NO_FRAME_COUNTER_RESET bitmask should be added to the initial security bitmask when ::emberSetInitialSecuritState is called.
If used in multi-network context, emberSetCurrentNetwork() must be called prior to calling this function.
Returns
EMBER_SUCCESS if calling context is valid (emberNetworkState() == EMBER_NO_NETWORK) and desiredValue < MAX_INT32U_VALUE. Otherwise, EMBER_INVALID_CALL.
406
of file stack/include/security.h
emberSetOutgoingApsFrameCounter#
EmberStatus emberSetOutgoingApsFrameCounter (uint32_t desiredValue)
Set the APS layer outgoing frame counter for Trust Center Link Key (intended for device restoration purposes). Caveats:
N/A | desiredValue | The desired outgoing APS frame counter value. This needs to be less than MAX_INT32U_VALUE to ensure that rollover does not occur on the next encrypted transmission. |
Can only be called before NetworkInit / FormNetwork / JoinNetwork, when emberNetworkState()==EMBER_NO_NETWORK.
This function should be called before emberSetInitialSecurityState, and the EMBER_NO_FRAME_COUNTER_RESET bitmask should be added to the initial security bitmask when ::emberSetInitialSecuritState is called.
If used in multi-network context, call emberSetCurrentNetwork() prior to calling this function.
Returns
EMBER_SUCCESS if calling context is valid (emberNetworkState() == EMBER_NO_NETWORK) and desiredValue < MAX_INT32U_VALUE. Otherwise, EMBER_INVALID_CALL.
431
of file stack/include/security.h
emberClearTransientLinkKeys#
void emberClearTransientLinkKeys (void )
Clear all transient link keys from RAM.
N/A |
441
of file stack/include/security.h
emberHmacAesHash#
void emberHmacAesHash (const uint8_t * key, const uint8_t * data, uint8_t dataLength, uint8_t * result)
N/A | key | |
N/A | data | |
N/A | dataLength | |
N/A | result |
459
of file stack/include/security.h
emberGetRejoinMode#
EmberApsRejoinMode emberGetRejoinMode (void )
N/A |
471
of file stack/include/security.h
emberSetRejoinMode#
void emberSetRejoinMode (EmberApsRejoinMode mode)
N/A | mode |
482
of file stack/include/security.h
emberGetSecurityFrameCounter#
uint32_t emberGetSecurityFrameCounter (void )
N/A |
485
of file stack/include/security.h
emberGetApsFrameCounter#
uint32_t emberGetApsFrameCounter (void )
N/A |
486
of file stack/include/security.h
emberGetIncomingTcLinkKeyFrameCounter#
uint32_t emberGetIncomingTcLinkKeyFrameCounter (void )
N/A |
487
of file stack/include/security.h
emberSetIncomingTcLinkKeyFrameCounter#
void emberSetIncomingTcLinkKeyFrameCounter (uint32_t frameCounter)
N/A | frameCounter |
488
of file stack/include/security.h
emberAesMmoHashInit#
void emberAesMmoHashInit (EmberAesMmoHashContext * context)
This routine clears the passed context so that a new hash calculation can be performed.
N/A | context | A pointer to the location of hash context to clear. |
41
of file stack/include/aes-mmo.h
emberAesMmoHashUpdate#
EmberStatus emberAesMmoHashUpdate (EmberAesMmoHashContext * context, uint32_t length, const uint8_t * data)
This routine processes the passed chunk of data and updates the hash calculation based on it. The data passed in MUST have a length that is a multiple of 16.
N/A | context | A pointer to the location of the hash context to update. |
N/A | length | The length of the passed data. |
N/A | data | A pointer to the location of the data to hash. |
Returns
An EmberStatus value indicating EMBER_SUCCESS if the hash was calculated successfully. EMBER_INVALID_CALL if the block size is not a multiple of 16 bytes, and EMBER_INDEX_OUT_OF_RANGE is returned when the data exceeds the maximum limits of the hash function.
57
of file stack/include/aes-mmo.h
emberAesMmoHashFinal#
EmberStatus emberAesMmoHashFinal (EmberAesMmoHashContext * context, uint32_t length, const uint8_t * finalData)
This routine processes the passed chunk of data (if non-NULL) and update the hash context that is passed in. In then performs the final calculations on the hash and returns the final answer in the result parameter of the EmberAesMmoHashContext structure. The length of the data passed in may be any value, it does not have to be a multiple of 16.
N/A | context | A pointer to the location of the hash context to finalize. |
N/A | length | The length of the finalData parameter. |
N/A | finalData | A pointer to the location of data to hash. May be NULL. |
Returns
An EmberStatus value indicating EMBER_SUCCESS if the hash was calculated successfully. EMBER_INVALID_CALL if the block size is not a multiple of 16 bytes, and EMBER_INDEX_OUT_OF_RANGE is returned when the data exceeds the maximum limits of the hash function.
78
of file stack/include/aes-mmo.h
emberAesHashSimple#
EmberStatus emberAesHashSimple (uint8_t totalLength, const uint8_t * data, uint8_t * result)
This is a convenience method when the hash data is less than 255 bytes. It inits, updates, and finalizes the hash in one function call.
N/A | totalLength | The length of the data. |
N/A | data | The data to hash. |
N/A | result | The location where the result of the hash will be written. |
Returns
An EmberStatus value indicating EMBER_SUCCESS if the hash was calculated successfully. EMBER_INVALID_CALL if the block size is not a multiple of 16 bytes, and EMBER_INDEX_OUT_OF_RANGE is returned when the data exceeds the maximum limits of the hash function.
95
of file stack/include/aes-mmo.h
emberGetStrongRandomNumberArray#
EmberStatus emberGetStrongRandomNumberArray (uint16_t * randomNumber, uint8_t count)
Get ::count number of true random numbers. The method of obtaining and quality of the random varies by chip family and the configuration used. For high security applications, please verify that that the generator's properties match your needs.
N/A | randomNumber | |
N/A | count |
Returns
An EmberStatus value.
EMBER_SUCCESS If success.
EMBER_INSUFFICIENT_RANDOM_DATA In case of any error.
48
of file stack/include/ember-random-api.h
emberGetStrongRandomEntropySource#
EmberEntropySource emberGetStrongRandomEntropySource (void )
Return the entropy source used for true random number generation.
N/A |
Returns
An EmberEntropySource value.
EMBER_ENTROPY_SOURCE_ERROR If there is any error identifying the entroypy source.
EMBER_ENTROPY_SOURCE_RADIO Entropy source is the chips that support this. The method of obtaining and quality of the random varies by chip family. For high security applications, please verify that that the generator's properties match the requirements.
EMBER_ENTROPY_SOURCE_MBEDTLS_TRNG Entropy source is the TRNG hardware module (if applicable) and the interface driver is powered by mbed TLS.
EMBER_ENTROPY_SOURCE_MBEDTLS Entropy source is not the TRNG hardware module but the interface driver is powered by mbed TLS.
75
of file stack/include/ember-random-api.h
Macro Definition Documentation#
SECURITY_BLOCK_SIZE#
#define SECURITY_BLOCK_SIZEValue:
16
The block size in bytes of the encryption cypher (AES-MMO-128).
43
of file stack/include/security.h
EMBER_JOIN_NO_PRECONFIG_KEY_BITMASK#
#define EMBER_JOIN_NO_PRECONFIG_KEY_BITMASKValue:
A non-trust center device configuration bitmask example. There is no Preconfigured Link Key, so the NWK key is expected to be sent in-the-clear. The device will request a Trust Center Link key after getting the Network Key.
108
of file stack/include/security.h
EMBER_JOIN_PRECONFIG_KEY_BITMASK#
#define EMBER_JOIN_PRECONFIG_KEY_BITMASKValue:
A non-trust center device configuration bitmask example. The device has a Preconfigured Link Key and expects to receive a NWK Key encrypted at the APS Layer. A NWK key sent in-the-clear will be rejected.
118
of file stack/include/security.h
emberGetPseudoRandomNumber#
#define emberGetPseudoRandomNumberValue:
()
Wrapper for the HAL API to generate pseudo-random numbers.
Returns
uint16_t pseudo random number
37
of file stack/include/ember-random-api.h
emberGetTrueRandomNumberArray#
#define emberGetTrueRandomNumberArrayValue:
(randomNumber, count)
50
of file stack/include/ember-random-api.h
emberGetStrongRandomNumber#
#define emberGetStrongRandomNumberValue:
(randomNumber)
Generate one true random number. For more info check emberGetStrongRandomNumberArray.
56
of file stack/include/ember-random-api.h
emberGetTrueRandomNumber#
#define emberGetTrueRandomNumberValue:
(randomNumber)
59
of file stack/include/ember-random-api.h
emberGetTrueRandomEntropySource#
#define emberGetTrueRandomEntropySourceValue:
()
80
of file stack/include/ember-random-api.h