[linux] Re: /proc/sys/kernel/random/pool_size vergroten
Udo van den Heuvel
udovdh op xs4all.nl
Wo Okt 5 12:44:54 CEST 2005
-- Attached file included as plaintext by Ecartis --
Folkert van Heusden wrote:
>
>>>Ik heb info ingewonnen bij de beheerder van random.c en een patch in
>>>elkaar gedraaid voor 2.6.13 die zou moeten werken. Ik heb 't e.e.a. nog
>>>niet kunnen testen. Als er interesse is kan ik 'm posten o.i.d.
>
>
> Ja!
Hierbij.
Het is nog steeds ongetest maar zou moeten werken.
De poolsize gaat van 4096 naar 8192 bits.
(ook freubel ik wat met de thresholds)
poolinfo_table wordt aangepast en wat verwijzingen erheen.
Graag feedback over werking of verbeteringen.
Groeten,
Udo
-- Attached file included as plaintext by Ecartis --
-- File: random-poolsize2.patch
--- linux-2.6.13.2/drivers/char/random.c 2005-09-17 03:02:12.000000000 +0200
+++ linux/drivers/char/random.c 2005-10-05 09:56:58.000000000 +0200
@@ -249,7 +249,7 @@
/*
* Configuration information
*/
-#define INPUT_POOL_WORDS 128
+#define INPUT_POOL_WORDS 256
#define OUTPUT_POOL_WORDS 32
#define SEC_XFER_SIZE 512
@@ -257,14 +257,14 @@
* The minimum number of bits of entropy before we wake up a read on
* /dev/random. Should be enough to do a significant reseed.
*/
-static int random_read_wakeup_thresh = 64;
+static int random_read_wakeup_thresh = 512;
/*
* If the entropy count falls under this number of bits, then we
* should wake up processes which are selecting or polling on write
* access to /dev/random.
*/
-static int random_write_wakeup_thresh = 128;
+static int random_write_wakeup_thresh = 1024;
/*
* When the input pool goes over trickle_thresh, start dropping most
@@ -291,6 +291,7 @@
{ 128, 103, 76, 51, 25, 1 },
/* x^32 + x^26 + x^20 + x^14 + x^7 + x + 1 -- 15 */
{ 32, 26, 20, 14, 7, 1 },
+
#if 0
/* x^2048 + x^1638 + x^1231 + x^819 + x^411 + x + 1 -- 115 */
{ 2048, 1638, 1231, 819, 411, 1 },
@@ -308,13 +309,13 @@
{ 512, 409, 307, 206, 102, 2 },
/* x^512 + x^409 + x^309 + x^205 + x^103 + x^2 + 1 -- 95 */
{ 512, 409, 309, 205, 103, 2 },
-
+#endif
/* x^256 + x^205 + x^155 + x^101 + x^52 + x + 1 -- 125 */
{ 256, 205, 155, 101, 52, 1 },
/* x^128 + x^103 + x^78 + x^51 + x^27 + x^2 + 1 -- 70 */
{ 128, 103, 78, 51, 27, 2 },
-
+#if 0
/* x^64 + x^52 + x^39 + x^26 + x^14 + x + 1 -- 15 */
{ 64, 52, 39, 26, 14, 1 },
#endif
@@ -414,7 +415,7 @@
static __u32 nonblocking_pool_data[OUTPUT_POOL_WORDS];
static struct entropy_store input_pool = {
- .poolinfo = &poolinfo_table[0],
+ .poolinfo = &poolinfo_table[2],
.name = "input",
.limit = 1,
.lock = SPIN_LOCK_UNLOCKED,
@@ -422,7 +423,7 @@
};
static struct entropy_store blocking_pool = {
- .poolinfo = &poolinfo_table[1],
+ .poolinfo = &poolinfo_table[3],
.name = "blocking",
.limit = 1,
.pull = &input_pool,
@@ -431,7 +432,7 @@
};
static struct entropy_store nonblocking_pool = {
- .poolinfo = &poolinfo_table[1],
+ .poolinfo = &poolinfo_table[3],
.name = "nonblocking",
.pull = &input_pool,
.lock = SPIN_LOCK_UNLOCKED,
-- Attached file included as plaintext by Ecartis --
-- File: signature.asc
-- Desc: OpenPGP digital signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDQ66tOtb4EYMAzAIRA+vuAKCmiqh5+yn2ycZIEm7M3KXT018n2ACeIKlx
zoXwzyscQGnZ/PbC/DBPzuk=
=l+JH
-----END PGP SIGNATURE-----
More information about the Linux
mailing list