]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/cypherpunks.ru/govpn/aont/aont_test.go
go vet/lint
[govpn.git] / src / cypherpunks.ru / govpn / aont / aont_test.go
index 93b7db51afbaf3b3f667c684735b3d01d1ab46fb..b586775bdd8650cf1e0105b6db58f11a2ca02499 100644 (file)
@@ -1,6 +1,6 @@
 /*
 GoVPN -- simple secure free software virtual private network daemon
-Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2017 Sergey Matveev <stargrave@stargrave.org>
 
 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,16 +21,17 @@ package aont
 import (
        "bytes"
        "crypto/rand"
+       "io"
        "testing"
        "testing/quick"
 )
 
 var (
-       testKey *[16]byte = new([16]byte)
+       testKey = new([16]byte)
 )
 
 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++ {