-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport: Adds SipHashUint256Extra and moves CSipHasher to it's own file in crypto/ directory #3496
Draft
xanimo
wants to merge
11
commits into
dogecoin:1.15.0-dev
Choose a base branch
from
xanimo:1.15.0-dev-extract-csiphasher
base: 1.15.0-dev
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Mar 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b0b97d1 - Browse repository at this point
Copy the full SHA b0b97d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d4e0bd - Browse repository at this point
Copy the full SHA 8d4e0bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5be21d8 - Browse repository at this point
Copy the full SHA 5be21d8View commit details -
util: Specific GetOSRandom for Linux/FreeBSD/OpenBSD
These are available in sandboxes without access to files or devices. Also [they are safer and more straightforward](https://en.wikipedia.org/wiki/Entropy-supplying_system_calls) to use than `/dev/urandom` as reading from a file has quite a few edge cases: - Linux: `getrandom(buf, buflen, 0)`. [getrandom(2)](http://man7.org/linux/man-pages/man2/getrandom.2.html) was introduced in version 3.17 of the Linux kernel. - OpenBSD: `getentropy(buf, buflen)`. The [getentropy(2)](http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2) function appeared in OpenBSD 5.6. - FreeBSD and NetBSD: `sysctl(KERN_ARND)`. Not sure when this was added but it has existed for quite a while. Alternatives: - Linux has sysctl `CTL_KERN` / `KERN_RANDOM` / `RANDOM_UUID` which gives 16 bytes of randomness. This may be available on older kernels, however [sysctl is deprecated on Linux](https://lwn.net/Articles/605392/) and even removed in some distros so we shouldn't use it. Add tests for `GetOSRand()`: - Test that no error happens (otherwise `RandFailure()` which aborts) - Test that all 32 bytes are overwritten (initialize with zeros, try multiple times) Discussion: - When to use these? Currently they are always used when available. Another option would be to use them only when `/dev/urandom` is not available. But this would mean these code paths receive less testing, and I'm not sure there is any reason to prefer `/dev/urandom`. Closes: #9676
Configuration menu - View commit details
-
Copy full SHA for 1e67923 - Browse repository at this point
Copy the full SHA 1e67923View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca7c655 - Browse repository at this point
Copy the full SHA ca7c655View commit details -
sanity: Move OS random to sanity check function
Move the OS random test to a sanity check function that is called every time bitcoind is initialized. Keep `src/test/random_tests.cpp` for the case that later random tests are added, and keep a rudimentary test that just calls the sanity check.
Configuration menu - View commit details
-
Copy full SHA for 8f0ad1c - Browse repository at this point
Copy the full SHA 8f0ad1cView commit details -
random: Add fallback if getrandom syscall not available
If the code was compiled with newer (>=3.17) kernel headers but executed on a system without the system call, every use of random would crash the program. Add a fallback for that case.
Configuration menu - View commit details
-
Copy full SHA for 04f21a3 - Browse repository at this point
Copy the full SHA 04f21a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 603caf9 - Browse repository at this point
Copy the full SHA 603caf9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c33a27 - Browse repository at this point
Copy the full SHA 9c33a27View commit details
Commits on Mar 27, 2024
-
Add specialization of SipHash for 256 + 32 bit data
We'll need a version of SipHash for tuples of 256 bits and 32 bits data, when CCoinsViewCache switches from using txids to COutPoints as keys.
Configuration menu - View commit details
-
Copy full SHA for 66df26b - Browse repository at this point
Copy the full SHA 66df26bView commit details -
Extract CSipHasher to it's own file in crypto/ directory.
This is a move-only commit with the exception of changes to includes. Cherry-picked from: 4fb789e
Configuration menu - View commit details
-
Copy full SHA for 4aa8403 - Browse repository at this point
Copy the full SHA 4aa8403View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.