]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
chg: lets not have it static, since I get the same nonce in the same session over...
authoriceman1001 <iceman@iuse.se>
Thu, 26 Jan 2017 14:54:12 +0000 (15:54 +0100)
committericeman1001 <iceman@iuse.se>
Thu, 26 Jan 2017 14:54:12 +0000 (15:54 +0100)
common/random.c

index 62d0cbeb121d169eef7864af315644155aa09726..df5499689be315a85dc0fc33f1dc84e0f01b8778 100644 (file)
@@ -1,6 +1,6 @@
 #include "random.h"
 
-static uint64_t next_random = 1;
+ uint64_t next_random = 1;
 
 /* Generates a (non-cryptographically secure) 32-bit random number.
  *
@@ -13,7 +13,9 @@ uint32_t prand() {
        if (next_random == 1)
                next_random = GetTickCount();
 
-       next_random = next_random * 6364136223846793005 + 1;
+       next_random *= 6364136223846793005;
+       next_random += 1;
+       
        return (uint32_t)(next_random >> 32) % 0xffffffff;
 }
 
Impressum, Datenschutz