Newer
Older
mbed-os / platform / randlib / tests / unit / stubs / random_stub.c
@Arto Kinnunen Arto Kinnunen on 28 Jun 2021 445 bytes Update copyright (#15)
/*
 * 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;
}