mbed-os/test/mbed-client-randlib/unittest/stubs/random_stub.c

29 lines
445 B
C

/*
* Copyright (c) 2016, 2018, 2021, Pelion and affiliates.
*/
#include "ns_types.h"
static uint32_t seed_value = 4;
static bool seed_inc = false;
void arm_random_module_init(void)
{
}
uint32_t arm_random_seed_get(void)
{
uint32_t result = seed_value;
if (seed_inc) {
++seed_value;
}
return result;
}
void random_stub_set_seed(uint32_t value, bool increment)
{
seed_value = value;
seed_inc = increment;
}