mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
scripted-diff: use insecure_rand256/randrange more
-BEGIN VERIFY SCRIPT- sed -i "s/\<GetRandHash(/insecure_rand256(/" src/test/*_tests.cpp sed -i "s/\<GetRand(/insecure_randrange(/" src/test/*_tests.cpp src/test/test_bitcoin.cpp sed -i 's/\<insecure_rand() % \([0-9]\+\)/insecure_randrange(\1)/g' src/test/*_tests.cpp -END VERIFY SCRIPT-
This commit is contained in:
@@ -22,7 +22,7 @@ public:
|
||||
// flip one bit in one of the hashes - this should break the authentication
|
||||
void Damage() {
|
||||
unsigned int n = insecure_rand() % vHash.size();
|
||||
int bit = insecure_rand() % 256;
|
||||
int bit = insecure_randrange(256);
|
||||
*(vHash[n].begin() + (bit>>3)) ^= 1<<(bit&7);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user