mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 18:57:12 +08:00
chg: lets not have it static, since I get the same nonce in the same session over again.
This commit is contained in:
parent
496b673453
commit
fbed30e8c9
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
|
||||||
static uint64_t next_random = 1;
|
uint64_t next_random = 1;
|
||||||
|
|
||||||
/* Generates a (non-cryptographically secure) 32-bit random number.
|
/* Generates a (non-cryptographically secure) 32-bit random number.
|
||||||
*
|
*
|
||||||
|
@ -13,7 +13,9 @@ uint32_t prand() {
|
||||||
if (next_random == 1)
|
if (next_random == 1)
|
||||||
next_random = GetTickCount();
|
next_random = GetTickCount();
|
||||||
|
|
||||||
next_random = next_random * 6364136223846793005 + 1;
|
next_random *= 6364136223846793005;
|
||||||
|
next_random += 1;
|
||||||
|
|
||||||
return (uint32_t)(next_random >> 32) % 0xffffffff;
|
return (uint32_t)(next_random >> 32) % 0xffffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue