Libtropic API
SDK for the TROPIC01 secure element
Version: master (latest)
Loading...
Searching...
No Matches

◆ lt_ex_macandd()

int lt_ex_macandd ( lt_handle_t h)

Value MACANDD_ROUNDS represents a number of possible PIN gueses, this value also affects size of lt_macandd_nvm_t struct. Technically TROPIC01 is capable to have this set to 128, therefore provide 128 Mac And Destroy tries, which would require roughly 128*32 bytes in non volatile memory for storing data related to M&D tries.

In this example, TROPIC01's User R-Memory is used as a storage for data during power cycle (specifically, the last slot is used). For a sake of simplicity, only one User R-Memory slot is used as a storage.

Therefore MACANDD_ROUNDS is here limited to 12 -> the biggest possible number of tries which fits into one User R-Memory slot (slot size in User R-Memory is atleast 444B in all TROPIC01 chips).

Note
We recommend reading TROPIC01's datasheet before diving into this example!
Parameters
hHandle for communication with TROPIC01. It is assumed that the h.l2.device and h.l3.crypto_ctx members were already initialized. Because these members are pointers, the assigned structures must exist throughout the whole life-cycle of the handle. Refer to the 'Get Started'->'Integrating Libtropic'->'How to Use' Section in the Libtropic documentation for more information.
Return values
0Function executed successfully
-1Function did not execute successfully