aws-c-common
aws-c-common copied to clipboard
Avoiding allocating a handle in the Windows RNG.
Issue #, if available:
Description of changes:
This PR uses the BCRYPT_USE_SYSTEM_PREFERRED_RNG
option in the call to BCryptGenRandom
to avoid allocating an algorithm handle, and simplifying the code a bit.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Can you please explain why you would want to avoid allocating an algorithm handle?
Greetings! It looks like this PR hasn’t been active in longer than a week, add a comment or an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
Can you please explain why you would want to avoid allocating an algorithm handle?
It reduces global state and slightly simplifies the code. This approach is being used by OpenSSL and .NET among others.
Thanks!