mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +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:
@@ -43,4 +43,5 @@ target_link_libraries(bitcoin_util
|
||||
bitcoin_crypto
|
||||
$<$<PLATFORM_ID:Windows>:ws2_32>
|
||||
$<$<PLATFORM_ID:Windows>:iphlpapi>
|
||||
$<$<PLATFORM_ID:Windows>:bcrypt>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user