import (
"bytes"
- "crypto/rand"
"encoding/binary"
+ "io"
"testing"
"testing/quick"
)
)
func init() {
- rand.Read(testKey[:])
+ io.ReadFull(Rand, testKey[:])
}
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)
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++ {