5 Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
7 Copyright (C) 1997 - 2000 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
24 /* Forward declaration. Actual object is in source file. */
25 typedef struct SilcRngObjectStruct *SilcRng;
27 /* Number of states to fetch data from pool. */
28 #define SILC_RNG_STATE_NUM 4
30 /* Byte size of the random data pool. */
31 #define SILC_RNG_POOLSIZE 1024
34 SilcRng silc_rng_alloc();
35 void silc_rng_free(SilcRng rng);
36 void silc_rng_init(SilcRng rng);
37 unsigned char silc_rng_get_byte(SilcRng rng);
38 uint16 silc_rng_get_rn16(SilcRng rng);
39 uint32 silc_rng_get_rn32(SilcRng rng);
40 unsigned char *silc_rng_get_rn_string(SilcRng rng, uint32 len);
41 unsigned char *silc_rng_get_rn_data(SilcRng rng, uint32 len);
43 int silc_rng_global_init(SilcRng rng);
44 int silc_rng_global_uninit();
45 unsigned char silc_rng_global_get_byte();
46 uint16 silc_rng_global_get_rn16();
47 uint32 silc_rng_global_get_rn32();
48 unsigned char *silc_rng_global_get_rn_string(uint32 len);
49 unsigned char *silc_rng_global_get_rn_data(uint32 len);