import (
"bytes"
"crypto/rand"
+ "io"
"testing"
"testing/quick"
)
)
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++ {