summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/test_util.c
blob: 28be59604367fbd8d3b4ca6e45f0aa86daeed624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Copyright 2020 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 * Test utilities.
 */

#include "test_util.h"

/* Linear congruential pseudo random number generator */
uint32_t prng(uint32_t seed)
{
	return 22695477 * seed + 1;
}

uint32_t prng_no_seed(void)
{
	static uint32_t seed = 0x1234abcd;
	return seed = prng(seed);
}