10 #include "sw/device/lib/testing/entropy_src_testutils.h"
11 #include "sw/device/lib/testing/entropy_testutils.h"
12 #include "sw/device/lib/testing/test_framework/check.h"
17 OTTF_DEFINE_TEST_CONFIG();
19 const size_t kEntropyDataChecks = 10;
22 dif_entropy_src_t entropy_src;
23 CHECK_DIF_OK(dif_entropy_src_init(
34 .route_to_firmware =
true,
36 .health_test_threshold_scope =
false,
37 .health_test_window_size = 0x0200,
46 CHECK_STATUS_OK(entropy_src_testutils_wait_for_state(
47 &entropy_src, kDifEntropySrcMainFsmStateContHTRunning));
49 uint32_t entropy_data;
50 uint32_t last_entropy_data = 0;
51 for (uint32_t i = 0; i < kEntropyDataChecks; ++i) {
56 if (entropy_data == last_entropy_data) {
57 LOG_FATAL(
"Received duplicate entropy, this should never happen");
59 last_entropy_data = entropy_data;
66 LOG_FATAL(
"Error is non-zero, 0x%h", errors);