change math/rand to crypto/rand in non-test code

This commit is contained in:
Lawrence, Rendall
2024-03-05 11:01:18 +03:00
parent 772ac47e9c
commit 95b7f5530f
8 changed files with 42 additions and 19 deletions

View File

@@ -8,12 +8,14 @@ import (
func BenchmarkRand(b *testing.B) {
var cnt uint64
for i := 0; i < b.N; i++ {
// nolint:gosec
cnt = rand.Uint64()
}
_ = cnt
}
func BenchmarkXoRoShiRo128SS(b *testing.B) {
// nolint:gosec
v, s0, s1 := uint64(0), rand.Uint64(), rand.Uint64()
for i := 0; i < b.N; i++ {
v, s0, s1 = XoRoShiRo128SS(s0, s1)
@@ -22,6 +24,7 @@ func BenchmarkXoRoShiRo128SS(b *testing.B) {
}
func BenchmarkXorShift64Star(b *testing.B) {
// nolint:gosec
v, s := uint64(0), rand.Uint64()
for i := 0; i < b.N; i++ {
v, s = XorShift64S(s)