mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 12:27:18 +00:00
ee5d75732d
* Add pkg crypto * Update go.yml Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
34 lines
1.3 KiB
Go
34 lines
1.3 KiB
Go
package testdata
|
|
|
|
import (
|
|
foobar "math/rand"
|
|
mathRand "math/rand"
|
|
"time"
|
|
)
|
|
|
|
// UseRandNewCustomImport --
|
|
func UseRandNewCustomImport() {
|
|
// #nosec G404
|
|
source := mathRand.NewSource(time.Now().UnixNano()) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
|
|
// #nosec G404
|
|
randGenerator := mathRand.New(source) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
|
|
start := uint64(randGenerator.Intn(32))
|
|
_ = start
|
|
|
|
// #nosec G404
|
|
source = mathRand.NewSource(time.Now().UnixNano()) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
|
|
// #nosec G404
|
|
randGenerator = mathRand.New(source) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
|
|
}
|
|
|
|
// UseWithoutSeeCustomImport --
|
|
func UseWithoutSeeCustomImport() {
|
|
// #nosec G404
|
|
assignedIndex := mathRand.Intn(128) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
|
|
_ = assignedIndex
|
|
// #nosec G404
|
|
foobar.Shuffle(10, func(i, j int) { // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
|
|
|
|
})
|
|
}
|