Skip to content

Commit

Permalink
build: make staticcheck happier
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Dec 15, 2023
1 parent 7ef61c9 commit a680c36
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
9 changes: 4 additions & 5 deletions ecc/bls12-377/fr/sis/sis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ package sis

import (
"bytes"
"crypto/rand"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"math/big"
"math/bits"
"math/rand"
"os"
"testing"
"time"

Expand Down Expand Up @@ -69,7 +69,7 @@ func TestReference(t *testing.T) {

// read the test case file
var testCases TestCases
data, err := ioutil.ReadFile("test_cases.json")
data, err := os.ReadFile("test_cases.json")
assert.NoError(err, "reading test cases failed")
err = json.Unmarshal(data, &testCases)
assert.NoError(err, "reading test cases failed")
Expand Down Expand Up @@ -391,8 +391,7 @@ func TestLimbDecompositionFastPath(t *testing.T) {
nValues := bitset.New(uint(size))

// Generate a random buffer
rand.Seed(time.Now().UnixNano()) //#nosec G404 weak rng is fine here
_, err := rand.Read(buf) //#nosec G404 weak rng is fine here
_, err := rand.Read(buf) //#nosec G404 weak rng is fine here
assert.NoError(err)

limbDecomposeBytes8_64(buf, m, mValues)
Expand Down
9 changes: 4 additions & 5 deletions ecc/bn254/fr/sis/sis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ package sis

import (
"bytes"
"crypto/rand"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"math/big"
"math/bits"
"math/rand"
"os"
"testing"
"time"

Expand Down Expand Up @@ -68,7 +68,7 @@ func TestReference(t *testing.T) {

// read the test case file
var testCases TestCases
data, err := ioutil.ReadFile("test_cases.json")
data, err := os.ReadFile("test_cases.json")
assert.NoError(err, "reading test cases failed")
err = json.Unmarshal(data, &testCases)
assert.NoError(err, "reading test cases failed")
Expand Down Expand Up @@ -390,8 +390,7 @@ func TestLimbDecompositionFastPath(t *testing.T) {
nValues := bitset.New(uint(size))

// Generate a random buffer
rand.Seed(time.Now().UnixNano()) //#nosec G404 weak rng is fine here
_, err := rand.Read(buf) //#nosec G404 weak rng is fine here
_, err := rand.Read(buf)
assert.NoError(err)

limbDecomposeBytes8_64(buf, m, mValues)
Expand Down
2 changes: 1 addition & 1 deletion ecc/stark-curve/g1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package starkcurve

import (
"crypto/rand"
"math/big"
"math/rand"
"testing"

"github.com/consensys/gnark-crypto/ecc/stark-curve/fp"
Expand Down

0 comments on commit a680c36

Please sign in to comment.