Преглед на файлове

archive/zip, crypto/tls: use rand.Read instead of casting ints to bytes

Makes tests run ~1ms faster.

Change-Id: Ida509952469540280996d2bd9266724829e53c91
Reviewed-on: https://go-review.googlesource.com/47359
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Run-TryBot: Filippo Valsorda <hi@filippo.io>
TryBot-Result: Gobot Gobot <gobot@golang.org>
tls13
Carl Mastrangelo преди 7 години
committed by Filippo Valsorda
родител
ревизия
5731b5256b
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. +2
    -2
      handshake_messages_test.go

+ 2
- 2
handshake_messages_test.go Целия файл

@@ -98,8 +98,8 @@ func TestFuzz(t *testing.T) {

func randomBytes(n int, rand *rand.Rand) []byte {
r := make([]byte, n)
for i := 0; i < n; i++ {
r[i] = byte(rand.Int31())
if _, err := rand.Read(r); err != nil {
panic("rand.Read failed: " + err.Error())
}
return r
}


Зареждане…
Отказ
Запис