#include "../drivers.h"#include "../../kernel/const.h"#include "assert.h"#include "random.h"#include "sha2.h"#include "aes/rijndael.h"Include dependency graph for random.c:

Go to the source code of this file.
Defines | |
| #define | N_DERIV 16 |
| #define | NR_POOLS 32 |
| #define | MIN_SAMPLES 256 |
Functions | |
| FORWARD | _PROTOTYPE (void add_sample,(int source, unsigned long sample)) |
| FORWARD | _PROTOTYPE (void data_block,(rd_keyinstance *keyp, void *data)) |
| FORWARD | _PROTOTYPE (void reseed,(void)) |
| PUBLIC void | random_init () |
| PUBLIC int | random_isseeded () |
| PUBLIC void | random_update (int source, unsigned short *buf, int count) |
| PUBLIC void | random_getbytes (void *buf, size_t size) |
| PUBLIC void | random_putbytes (void *buf, size_t size) |
| PRIVATE void | add_sample (int source, unsigned long sample) |
| PRIVATE void | data_block (rd_keyinstance *keyp, void *data) |
| PRIVATE void | reseed () |
Variables | |
| PRIVATE unsigned long | deriv [RANDOM_SOURCES][N_DERIV] |
| PRIVATE int | pool_ind [RANDOM_SOURCES] |
| PRIVATE SHA256_CTX | pool_ctx [NR_POOLS] |
| PRIVATE unsigned | samples = 0 |
| PRIVATE int | got_seeded = 0 |
| PRIVATE u8_t | random_key [2 *AES_BLOCKSIZE] |
| PRIVATE u32_t | count_lo |
| PRIVATE u32_t | count_hi |
| PRIVATE u32_t | reseed_count |
|
|
Definition at line 20 of file random.c. Referenced by reseed(). |
|
|
Definition at line 18 of file random.c. Referenced by add_sample(), and random_init(). |
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 131 of file random.c. References d, deriv, i, long(), min, and N_DERIV. Referenced by random_update(). |
|
||||||||||||
|
Definition at line 182 of file random.c. References AES_BLOCKSIZE, assert, count_hi, count_lo, input, memcpy(), memset(), NULL, r, and rijndael_ecb_encrypt(). Referenced by random_getbytes(). |
|
||||||||||||
|
Definition at line 82 of file random.c. References AES_BLOCKSIZE, assert, cp, data_block(), key, memcpy(), n, r, random_key, and rijndael_makekey(). Referenced by r_transfer(). |
|
|
Definition at line 38 of file random.c. References assert, deriv, i, j, N_DERIV, pool_ind, and RANDOM_SOURCES. Referenced by r_init(). |
|
|
Definition at line 58 of file random.c. References got_seeded. Referenced by r_transfer(). |
|
||||||||||||
|
Definition at line 116 of file random.c. References pool_ctx, reseed(), samples, and SHA256_Update(). Referenced by r_transfer(). |
|
||||||||||||||||
|
Definition at line 65 of file random.c. References add_sample(), i, panic, printf, RANDOM_SOURCES, and reseed(). Referenced by r_random(). |
|
|
Definition at line 207 of file random.c. References got_seeded, i, MIN_SAMPLES, pool_ctx, random_key, reseed_count, samples, SHA256_DIGEST_LENGTH, SHA256_Final(), SHA256_Init(), and SHA256_Update(). Referenced by random_putbytes(), and random_update(). |
|
|
Definition at line 30 of file random.c. Referenced by data_block(). |
|
|
Definition at line 30 of file random.c. Referenced by data_block(). |
|
|
Definition at line 24 of file random.c. Referenced by add_sample(), and random_init(). |
|
|
Definition at line 28 of file random.c. Referenced by random_isseeded(), and reseed(). |
|
|
Definition at line 26 of file random.c. Referenced by random_putbytes(), and reseed(). |
|
|
Definition at line 25 of file random.c. Referenced by random_init(). |
|
|
Definition at line 29 of file random.c. Referenced by random_getbytes(), and reseed(). |
|
|
Definition at line 31 of file random.c. Referenced by reseed(). |
|
|
Definition at line 27 of file random.c. Referenced by random_putbytes(), and reseed(). |
1.4.6