dash/src/bls
laanwj e9f5b4b735
Merge bitcoin/bitcoin#24213: refactor: use Span in random.*
3ae7791bcaa88f5c68592673b8926ee807242ce7 refactor: use Span in random.* (pasta)

Pull request description:

  ~This PR does two things~
  1. use a Span<unsigned char> for GetRandBytes and GetStrongRandBytes

  ~2. make GetRand a template for which any integral type can be used, where the default behavior is to return a random integral up to the max of the integral unless a max is provided.
  This simplifies a lot of code from `GetRand(std::numeric_limits<uint64_t>::max()` -> `GetRand<uint64_t>()`~

  MarcoFalke this was inspired by your comment here: https://github.com/bitcoin/bitcoin/pull/24185#issuecomment-1025514263 about using Span, so hopefully I'll be able to get this PR done and merged 😂

  ~Also, if requested I could revert the `GetRand(std::numeric_limits<uint64_t>::max()` -> `GetRand<uint64_t>()` related changes if it ends up causing too many conflicts~

ACKs for top commit:
  laanwj:
    Thank you! Code review re-ACK 3ae7791bcaa88f5c68592673b8926ee807242ce7

Tree-SHA512: 12375a83b68b288916ba0de81cfcab4aac14389a66a36811ae850427435eb67dd55e47df9ac3ec47db4e214f4330139e548bec815fff8a3f571484ea558dca79
2024-06-06 22:58:30 -05:00
..
bls_batchverifier.h non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
bls_ies.cpp Merge bitcoin/bitcoin#24213: refactor: use Span in random.* 2024-06-06 22:58:30 -05:00
bls_ies.h merge bitcoin#23438: Use spans of std::byte in serialize 2024-02-28 13:37:34 -06:00
bls_worker.cpp non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
bls_worker.h non-scripted-diff: bump copyright year to 2023 2024-02-24 11:05:37 -06:00
bls.cpp Merge bitcoin/bitcoin#24213: refactor: use Span in random.* 2024-06-06 22:58:30 -05:00
bls.h merge bitcoin#23438: Use spans of std::byte in serialize 2024-02-28 13:37:34 -06:00