wireguard-mod : remove excessive wait_for_random_bytes

This commit is contained in:
bolvan 2019-04-29 23:31:50 +03:00
parent 25188c052c
commit 5140622b66
2 changed files with 1 additions and 10 deletions

View File

@ -84,14 +84,9 @@ Index: WireGuard-0.0.20190123/src/noise.c
+__le32 gen_trash(void)
+{
+ if (gtrash)
+ {
+ gtrash = gtrash*1103515243 + 12345;
+ }
+ else
+ {
+ // first value is true random
+ wait_for_random_bytes();
+ get_random_bytes_wait(&gtrash, sizeof(gtrash));
+ }
+ return gtrash;
+}

View File

@ -72,15 +72,10 @@ __le32 gtrash = 0;
__le32 gen_trash(void)
{
if (gtrash)
{
gtrash = gtrash*1103515243 + 12345;
}
else
{
// first value is true random
wait_for_random_bytes();
get_random_bytes_wait(&gtrash, sizeof(gtrash));
}
return gtrash;
}
--------------------------------------
@ -212,6 +207,7 @@ make clean оттуда все снесет, включая ваши модиф
# opkg update
# opkg install .... <зависимости>
# opkg install *.ipk
# rmmod wireguard
# kmodloader
# dmesg | tail