X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Faont%2Faont_test.go;h=c7bc6a62d9d8e8a14a22f2e37b0d1a1d44e9ad62;hb=572cac17bde738055312f7a468a0bde0e760a262;hp=93b7db51afbaf3b3f667c684735b3d01d1ab46fb;hpb=a87ec543051d428aaa3888804d6c8451f6d537c9;p=govpn.git diff --git a/src/cypherpunks.ru/govpn/aont/aont_test.go b/src/cypherpunks.ru/govpn/aont/aont_test.go index 93b7db5..c7bc6a6 100644 --- a/src/cypherpunks.ru/govpn/aont/aont_test.go +++ b/src/cypherpunks.ru/govpn/aont/aont_test.go @@ -1,6 +1,6 @@ /* GoVPN -- simple secure free software virtual private network daemon -Copyright (C) 2014-2016 Sergey Matveev +Copyright (C) 2014-2017 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ package aont import ( "bytes" "crypto/rand" + "io" "testing" "testing/quick" ) @@ -30,7 +31,7 @@ var ( ) func init() { - rand.Read(testKey[:]) + io.ReadFull(rand.Reader, testKey[:]) } func TestSymmetric(t *testing.T) { @@ -80,7 +81,7 @@ func TestTampered(t *testing.T) { func BenchmarkEncode(b *testing.B) { data := make([]byte, 128) - rand.Read(data) + io.ReadFull(rand.Reader, data) b.ResetTimer() for i := 0; i < b.N; i++ { Encode(testKey, data) @@ -89,7 +90,7 @@ func BenchmarkEncode(b *testing.B) { func BenchmarkDecode(b *testing.B) { data := make([]byte, 128) - rand.Read(data) + io.ReadFull(rand.Reader, data) encoded, _ := Encode(testKey, data) b.ResetTimer() for i := 0; i < b.N; i++ {