X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Fencless_test.go;h=1f9fece30e3207999ec3a01a6d779888299d15e6;hb=5fd6174b77647f847a6e6db1cb7d5276747fcd39;hp=20b0df63281e481a254eee1a25bf86a81bf8f0a6;hpb=5095c4864ad0285fa6a8ee177d8f5fa09caa6e85;p=govpn.git diff --git a/src/cypherpunks.ru/govpn/encless_test.go b/src/cypherpunks.ru/govpn/encless_test.go index 20b0df6..1f9fece 100644 --- a/src/cypherpunks.ru/govpn/encless_test.go +++ b/src/cypherpunks.ru/govpn/encless_test.go @@ -20,8 +20,8 @@ package govpn import ( "bytes" - "crypto/rand" "encoding/binary" + "io" "testing" "testing/quick" ) @@ -31,7 +31,7 @@ var ( ) func init() { - rand.Read(testKey[:]) + io.ReadFull(Rand, testKey[:]) } func TestEnclessSymmetric(t *testing.T) { @@ -56,8 +56,8 @@ func TestEnclessSymmetric(t *testing.T) { func BenchmarkEnclessEncode(b *testing.B) { nonce := make([]byte, 8) data := make([]byte, 128) - rand.Read(nonce) - rand.Read(data) + io.ReadFull(Rand, nonce) + io.ReadFull(Rand, data) b.ResetTimer() for i := 0; i < b.N; i++ { EnclessEncode(testKey, nonce, data) @@ -67,8 +67,8 @@ func BenchmarkEnclessEncode(b *testing.B) { func BenchmarkEnclessDecode(b *testing.B) { nonce := make([]byte, 8) data := make([]byte, 128) - rand.Read(nonce) - rand.Read(data) + io.ReadFull(Rand, nonce) + io.ReadFull(Rand, data) encoded, _ := EnclessEncode(testKey, nonce, data) b.ResetTimer() for i := 0; i < b.N; i++ {