diff --git a/go.mod b/go.mod index 8db03b5..d6520fa 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/libp2p/go-libp2p-xor -go 1.17 +go 1.22 require github.com/libp2p/go-libp2p-kbucket v0.3.1 diff --git a/kademlia/health_test.go b/kademlia/health_test.go index d2086c7..fbc327d 100644 --- a/kademlia/health_test.go +++ b/kademlia/health_test.go @@ -1,6 +1,7 @@ package kademlia import ( + crand "crypto/rand" "math/rand" "testing" @@ -38,7 +39,7 @@ func randomTestTableHealthSubsetSamples(contactSize, knownSize int) *testTableHe func randomKey(size int) key.Key { k := make([]byte, size) - rand.Read(k) + crand.Read(k) return key.BytesKey(k) } diff --git a/trie/add_test.go b/trie/add_test.go index bf514bb..ea9f0b2 100644 --- a/trie/add_test.go +++ b/trie/add_test.go @@ -1,6 +1,7 @@ package trie import ( + crand "crypto/rand" "math/rand" "testing" @@ -77,7 +78,7 @@ func randomTestAddSample(setSize, keySizeByte int) *testAddSample { keySet := make([]key.Key, setSize) for i := range keySet { k := make([]byte, keySizeByte) - rand.Read(k) + crand.Read(k) keySet[i] = key.BytesKey(k) } return &testAddSample{ diff --git a/trie/remove_test.go b/trie/remove_test.go index d322c78..4113f30 100644 --- a/trie/remove_test.go +++ b/trie/remove_test.go @@ -1,9 +1,10 @@ package trie import ( - "github.com/libp2p/go-libp2p-xor/key" "math/rand" "testing" + + "github.com/libp2p/go-libp2p-xor/key" ) func TestImmutableRemoveIsImmutable(t *testing.T) {