|
358 | 358 |
|
359 | 359 | /* #define ADD_INTERRUPT_BENCH */ |
360 | 360 |
|
361 | | -/* |
362 | | - * Configuration information |
363 | | - */ |
364 | | -#define INPUT_POOL_SHIFT 12 |
365 | | -#define INPUT_POOL_WORDS (1 << (INPUT_POOL_SHIFT-5)) |
366 | | -#define EXTRACT_SIZE (BLAKE2S_HASH_SIZE / 2) |
367 | | - |
368 | 361 | /* |
369 | 362 | * To allow fractional bits to be tracked, the entropy_count field is |
370 | 363 | * denominated in units of 1/8th bits. |
@@ -440,7 +433,9 @@ enum poolinfo { |
440 | 433 | POOL_TAP2 = 76, |
441 | 434 | POOL_TAP3 = 51, |
442 | 435 | POOL_TAP4 = 25, |
443 | | - POOL_TAP5 = 1 |
| 436 | + POOL_TAP5 = 1, |
| 437 | + |
| 438 | + EXTRACT_SIZE = BLAKE2S_HASH_SIZE / 2 |
444 | 439 | }; |
445 | 440 |
|
446 | 441 | /* |
@@ -503,7 +498,7 @@ MODULE_PARM_DESC(ratelimit_disable, "Disable random ratelimit suppression"); |
503 | 498 | * |
504 | 499 | **********************************************************************/ |
505 | 500 |
|
506 | | -static u32 input_pool_data[INPUT_POOL_WORDS] __latent_entropy; |
| 501 | +static u32 input_pool_data[POOL_WORDS] __latent_entropy; |
507 | 502 |
|
508 | 503 | static struct { |
509 | 504 | /* read-only data: */ |
@@ -1961,7 +1956,7 @@ SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count, |
1961 | 1956 | #include <linux/sysctl.h> |
1962 | 1957 |
|
1963 | 1958 | static int min_write_thresh; |
1964 | | -static int max_write_thresh = INPUT_POOL_WORDS * 32; |
| 1959 | +static int max_write_thresh = POOL_BITS; |
1965 | 1960 | static int random_min_urandom_seed = 60; |
1966 | 1961 | static char sysctl_bootid[16]; |
1967 | 1962 |
|
@@ -2018,7 +2013,7 @@ static int proc_do_entropy(struct ctl_table *table, int write, |
2018 | 2013 | return proc_dointvec(&fake_table, write, buffer, lenp, ppos); |
2019 | 2014 | } |
2020 | 2015 |
|
2021 | | -static int sysctl_poolsize = INPUT_POOL_WORDS * 32; |
| 2016 | +static int sysctl_poolsize = POOL_BITS; |
2022 | 2017 | extern struct ctl_table random_table[]; |
2023 | 2018 | struct ctl_table random_table[] = { |
2024 | 2019 | { |
|
0 commit comments