gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd2] 01/08: perf_replies: fixed pseudo-random sequence gener


From: Admin
Subject: [libmicrohttpd2] 01/08: perf_replies: fixed pseudo-random sequence generation
Date: Sat, 14 Jun 2025 19:15:16 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd2.

commit fa37ebd2f31b1bdf74bb186414890b4e043b5204
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
AuthorDate: Sat Jun 14 10:49:33 2025 +0200

    perf_replies: fixed pseudo-random sequence generation
---
 src/tools/perf_replies.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/tools/perf_replies.c b/src/tools/perf_replies.c
index 2d1a7bd..d389401 100644
--- a/src/tools/perf_replies.c
+++ b/src/tools/perf_replies.c
@@ -1438,8 +1438,8 @@ mini_rnd (void)
 {
   /* Simple xoshiro256+ implementation */
   static uint_fast64_t s[4] = {
-    0x76e15d3efefdcbbfuLL, 0xc5004e441c522fb3uLL,
-    0x77710069854ee241uLL, 0x39109bb02acbe635uLL
+    0xE220A8397B1DCDAFuLL, 0x6E789E6AA1B965F4uLL,
+    0x06C45D188009454FuLL, 0xF88BB8A8724C81ECuLL
   };     /* Good enough for static initialisation */
 
   const uint_fast64_t ret = (s[0] + s[3]) & 0xFFFFFFFFFFFFFFFFuLL;
@@ -1450,7 +1450,7 @@ mini_rnd (void)
   s[1] ^= s[2];
   s[0] ^= s[3];
   s[2] ^= t;
-  s[3] = ((s[3] << 45u) | (s[3] << (64u - 45u))) & 0xFFFFFFFFFFFFFFFFuLL;
+  s[3] = ((s[3] << 45u) | (s[3] >> (64u - 45u))) & 0xFFFFFFFFFFFFFFFFuLL;
 
   return ret;
 }
@@ -1531,7 +1531,7 @@ init_response_body_data (void)
         body_dyn[pos + 4] = (char) (unsigned char) (rnd_data >> 32);
         body_dyn[pos + 5] = (char) (unsigned char) (rnd_data >> 40);
         body_dyn[pos + 6] = (char) (unsigned char) (rnd_data >> 48);
-        body_dyn[pos + 7] = (char) (unsigned char) (rnd_data >> 54);
+        body_dyn[pos + 7] = (char) (unsigned char) (rnd_data >> 56);
       }
       rnd_data = mini_rnd ();
       for ((void) pos; pos < body_dyn_size; ++pos)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]