Do random number generation all at once.
Splitting it into chunks is handled in the go mx syscall now.
Change-Id: I439faaca20b7569b0803fb142dcaaa2a687a9045
diff --git a/tcpip/network/hash/hash.go b/tcpip/network/hash/hash.go
index 20fb76d..a1f33d6 100644
--- a/tcpip/network/hash/hash.go
+++ b/tcpip/network/hash/hash.go
@@ -18,16 +18,8 @@
// RandN32 generates a slice of n cryptographic random 32-bit numbers.
func RandN32(n int) []uint32 {
b := make([]byte, 4*n)
- // Read in 256-byte increments because the Fuchsia crypto library doesn't support large
- // byte arrays.
- for i := 0; i < 4*n; i += 256 {
- end := i + 256
- if end > len(b) {
- end = len(b)
- }
- if _, err := rand.Read(b[i:end]); err != nil {
- panic(fmt.Sprintf("unable to get random numbers: %v", err))
- }
+ if _, err := rand.Read(b); err != nil {
+ panic(fmt.Sprintf("unable to get random numbers: %v", err))
}
r := make([]uint32, n)
for i := range r {