File: mt19937.cpp

package info (click to toggle)
libsrtp2 2.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,488 kB
  • sloc: ansic: 19,267; sh: 3,502; makefile: 401; cpp: 17
file content (17 lines) | stat: -rw-r--r-- 321 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <random>
#include <cstdint>

std::mt19937* mt_rand = NULL;

extern "C" void fuzz_mt19937_init(uint32_t seed) {
    mt_rand = new std::mt19937(seed);
}

extern "C" uint32_t fuzz_mt19937_get(void) {
    return (*mt_rand)();
}

extern "C" void fuzz_mt19937_destroy(void) {
    delete mt_rand;
    mt_rand = NULL;
}