mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
scripted-diff: Use randbits/bool instead of randrange where possible
-BEGIN VERIFY SCRIPT- sed -i 's/insecure_randbits(1)/insecure_randbool()/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(2)/insecure_randbool()/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(4)/insecure_randbits(2)/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(32)/insecure_randbits(5)/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(256)/insecure_randbits(8)/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_randrange(vHash.size());
|
||||
int bit = insecure_randrange(256);
|
||||
int bit = insecure_randbits(8);
|
||||
*(vHash[n].begin() + (bit>>3)) ^= 1<<(bit&7);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user