```
```

```
```
This PRNG MUST first be initialized with the following function:
void tinymt32_init (tinymt32_t* s, uint32_t seed);

It takes as input a 32-bit unsigned integer used as a seed (note that value 0 is permitted by TinyMT32).
This function also takes as input a pointer to an instance of a tinymt32_t structure that needs to be allocated by the caller but left uninitialized.
This structure will then be updated by the various TinyMT32 functions in order to keep the internal state of the PRNG.
The use of this structure admits several instances of this PRNG to be used in parallel, each of them having its own instance of the structure.
Then, each time a new 32-bit pseudo-random unsigned integer between 0 and 2^32 - 1 inclusive is needed, the following function is used:
uint32_t tinymt32_generate_uint32 (tinymt32_t * s);

Of course, the tinymt32_t structure must be left unchanged by the caller between successive calls to this function.
PRNG determinism, for a given seed, can be a requirement (e.g., with ).
Consequently, any implementation of the TinyMT32 PRNG in line with this specification MUST have the same output as that provided by the reference implementation of .
In order to increase the compliancy confidence, this document proposes the following criteria.
Using a seed value of 1, the first 50 values returned by tinymt32_generate_uint32(s) as 32-bit unsigned integers
are equal to values provided in , to be read line by line.
Note that these values come from the tinymt/check32.out.txt file provided by the PRNG authors to validate implementations
of TinyMT32, as part of the MersenneTwister-Lab/TinyMT Github repository.
In particular, the deterministic behavior of the source code has been checked across several platforms:
high-end laptops running 64-bits Mac OSX and Linux/Ubuntu;
a board featuring a 32-bits ARM Cortex-A15 and running 32-bit Linux/Ubuntu;
several embedded cards featuring either an ARM Cortex-M0+, a Cortex-M3 or a Cortex-M4 32-bit microcontroller, all of them running RIOT ;
two low-end embedded cards featuring either a 16-bit microcontroller (TI MSP430) or a 8-bit microcontroller (Arduino ATMEGA2560), both of them running RIOT.
This specification only outputs 32-bit unsigned pseudo-random numbers and does not try to map this output to a smaller integer range (e.g., between 10 and 49 inclusive).
If a specific use-case needs such a mapping, it will have to provide its own function.
In that case, if PRNG determinism is also required, the use of floating point (single or double precision) to perform this mapping should probably be avoided, these calculations leading potentially to different rounding errors across different target platforms.
Great care should also be put on not introducing biases in the randomness of the mapped output (it may be the case with some mapping algorithms) incompatible with the use-case requirements.
The details of how to perform such a mapping are out-of-scope of this document.

```
```
The authors do not believe the present specification generates specific security risks per se.
However, neither the TinyMT nor MT PRNG are meant to be used for cryptographic applications.
This document does not require any IANA action.
The authors would like to thank Belkacem Teibi with whom we explored TinyMT32 specificities when looking to an alternative to the Park-Miller Linear Congruential PRNG.
The authors would like to thank
Carl Wallace, Stewart Bryant, Greg Skinner, Mike Heard, the three TSVWG chairs, Wesley Eddy, our shepherd, David Black and Gorry Fairhurst, as well as Spencer Dawkins and Mirja Kuhlewind.
Last but not least, the authors are really grateful to the IESG members, in particular Benjamin Kaduk, Eric Rescorla, Adam Roach, Roman Danyliw, Barry Leiba, Martin Vigoureux, Eric Vyncke for their highly valuable feedbacks that greatly contributed to improve this specification.

```
```
&rfc2119;
&rfc8174;
&rfc5170;
Tiny Mersenne Twister (TinyMT) web site
Tiny Mersenne Twister (TinyMT) github site
TinyMT pre-calculated parameter list github site
Sliding Window Random Linear Code (RLC) Forward Erasure Correction (FEC) Scheme for FECFRAME
Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator
TinyMT Pseudo Random Number Generator for Erlang
RIOT: An Open Source Operating System for Low-End Embedded Devices in the IoT
Numerical Recipies in C; Second Edition
TestU01: A C Library for Empirical Testing of Random Number Generators
Automation of statistical tests on randomness to obtain clearer conclusion
Programming languages - C: C99, correction 3:2007

```
```