mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 00:34:01 +02:00
random: Use modern Windows randomness functions
The old randomness API has been deprecated and may be removed soon.[^1]
For reference on `BCryptGenRandom`, see: https://learn.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom.
`STATUS_SUCCESS`[^2] gets defined here since including `ntstatus.h` is
more trouble than it's worth. [^3]
[^1]: https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontextw & https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom
[^2]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55
[^3]: See 70f149b9a1/examples/examples_util.h (L19-L28)
This commit is contained in:
@@ -87,6 +87,7 @@ target_link_libraries(bitcoinkernel
|
||||
bitcoin_crypto
|
||||
leveldb
|
||||
secp256k1
|
||||
$<$<PLATFORM_ID:Windows>:bcrypt>
|
||||
$<TARGET_NAME_IF_EXISTS:USDT::headers>
|
||||
PUBLIC
|
||||
Boost::headers
|
||||
|
||||
Reference in New Issue
Block a user