/*
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
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) {
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)
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++ {