Skip to content

Commit ba2f2a7

Browse files
brosahayrosahay-silabs
authored andcommitted
Adds changes for use of SL_MBEDTLS_USE_TINYCRYPT
1 parent e17dfe1 commit ba2f2a7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ extern "C" {
7070
#include "sl_wifi.h"
7171
#include "sl_wifi_callback_framework.h"
7272
#include "wfx_host_events.h"
73-
#if TINYCRYPT_PRIMITIVES
73+
#if SL_MBEDTLS_USE_TINYCRYPT
74+
#include "sl_si91x_constants.h"
7475
#include "sl_si91x_trng.h"
75-
#define TRNGKEY_SIZE 4
76-
#endif // TINYCRYPT_PRIMITIVES
76+
#endif // SL_MBEDTLS_USE_TINYCRYPT
7777
}
7878

7979
WfxRsi_t wfx_rsi;
@@ -477,8 +477,8 @@ static sl_status_t wfx_rsi_init(void)
477477
return status;
478478
}
479479

480-
#ifdef TINYCRYPT_PRIMITIVES
481-
const uint32_t trngKey[TRNGKEY_SIZE] = { 0x16157E2B, 0xA6D2AE28, 0x8815F7AB, 0x3C4FCF09 };
480+
#ifdef SL_MBEDTLS_USE_TINYCRYPT
481+
const uint32_t trngKey[TRNG_KEY_SIZE] = { 0x16157E2B, 0xA6D2AE28, 0x8815F7AB, 0x3C4FCF09 };
482482

483483
// To check the Entropy of TRNG and verify TRNG functioning.
484484
status = sl_si91x_trng_entropy();
@@ -489,13 +489,13 @@ static sl_status_t wfx_rsi_init(void)
489489
}
490490

491491
// Initiate and program the key required for TRNG hardware engine
492-
status = sl_si91x_trng_program_key((uint32_t *) trngKey, TRNGKEY_SIZE);
492+
status = sl_si91x_trng_program_key((uint32_t *) trngKey, TRNG_KEY_SIZE);
493493
if (status != SL_STATUS_OK)
494494
{
495495
SILABS_LOG("TRNG Key Programming Failed");
496496
return status;
497497
}
498-
#endif // TINYCRYPT_PRIMITIVES
498+
#endif // SL_MBEDTLS_USE_TINYCRYPT
499499

500500
wfx_rsi.events = xEventGroupCreateStatic(&rsiDriverEventGroup);
501501
wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY;

0 commit comments

Comments
 (0)