]> Cypherpunks repositories - gostls13.git/commit
crypto/rand: generate random numbers using RtlGenRandom on Windows
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 5 Dec 2019 17:48:21 +0000 (18:48 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 27 Oct 2020 12:00:35 +0000 (12:00 +0000)
commit333e90448a0e55f2e1161853caecf3d30ef3a74a
treeecdf3def80d320fd29ea5ae5f7a8016b1c5767a9
parent8a013233ac53d934e53cd7d118b5ff7836d8973a
crypto/rand: generate random numbers using RtlGenRandom on Windows

CryptGenRandom appears to be unfavorable these days, whereas the classic
RtlGenRandom is still going strong.

This commit also moves the warnBlocked function into rand_unix, rather
than rand, because it's now only used on unix.

Fixes #33542

Change-Id: I5c02a5917572f54079d627972401efb6e1ce4057
Reviewed-on: https://go-review.googlesource.com/c/go/+/210057
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
src/crypto/rand/rand.go
src/crypto/rand/rand_unix.go
src/crypto/rand/rand_windows.go
src/syscall/syscall_windows.go
src/syscall/zsyscall_windows.go