1 //-----------------------------------------------------------------------------
2 // Copyright Iceman 2022
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
17 //-----------------------------------------------------------------------------
18 // linear congruential generator (LCG)
19 //-----------------------------------------------------------------------------
27 typedef struct generator_s
{
29 void (*Parse
)(uint32_t seed
, uint8_t key
[], const size_t keylen
);
31 // generator_t array are expected to be NULL terminated
33 void make_key_rand_n(uint32_t seed
, uint8_t key
[], const size_t keylen
);
34 void make_key_borland_n(uint32_t seed
, uint8_t key
[], const size_t keylen
);
35 void make_key_recipies_n(uint32_t seed
, uint8_t key
[], const size_t keylen
);
36 void make_key_glibc_n(uint32_t seed
, uint8_t key
[], const size_t keylen
);
37 void make_key_ansic_n(uint32_t seed
, uint8_t key
[], const size_t keylen
);
38 void make_key_turbopascal_n(uint32_t seed
, uint8_t key
[], const size_t keylen
);
39 void make_key_posix_rand_r_n(uint32_t seed
, uint8_t key
[], const size_t keylen
);
40 void make_key_ms_rand_r_n(uint32_t seed
, uint8_t key
[], const size_t keylen
);