mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
crypto: fix staticcheck warnings
This commit is contained in:
parent
fdff182f11
commit
296e2ee156
5 changed files with 5 additions and 10 deletions
|
|
@ -302,6 +302,7 @@ func appendUint64(b []byte, x uint64) []byte {
|
|||
return append(b, a[:]...)
|
||||
}
|
||||
|
||||
//lint:ignore U1000 keep utility function
|
||||
func appendUint32(b []byte, x uint32) []byte {
|
||||
var a [4]byte
|
||||
binary.BigEndian.PutUint32(a[:], x)
|
||||
|
|
@ -313,6 +314,7 @@ func consumeUint64(b []byte) ([]byte, uint64) {
|
|||
return b[8:], x
|
||||
}
|
||||
|
||||
//lint:ignore U1000 keep utility function
|
||||
func consumeUint32(b []byte) ([]byte, uint32) {
|
||||
x := binary.BigEndian.Uint32(b)
|
||||
return b[4:], x
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ var precomputed = [10][16]byte{
|
|||
{10, 8, 7, 1, 2, 4, 6, 5, 15, 9, 3, 13, 11, 14, 12, 0},
|
||||
}
|
||||
|
||||
//lint:ignore U1000 useful on other platforms
|
||||
func hashBlocksGeneric(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) {
|
||||
var m [16]uint64
|
||||
c0, c1 := c[0], c[1]
|
||||
|
|
|
|||
|
|
@ -14,14 +14,6 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
func fromHex(s string) []byte {
|
||||
b, err := hex.DecodeString(s)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func TestHashes(t *testing.T) {
|
||||
defer func(sse4, avx, avx2 bool) {
|
||||
useSSE4, useAVX, useAVX2 = sse4, avx, avx2
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import (
|
|||
"golang.org/x/sys/cpu"
|
||||
)
|
||||
|
||||
//lint:ignore U1000 used in asm
|
||||
//nolint:varcheck
|
||||
var hasBMI2 = cpu.X86.HasBMI2
|
||||
|
||||
|
|
|
|||
|
|
@ -199,9 +199,8 @@ func miller(q *twistPoint, p *curvePoint) *gfP12 {
|
|||
r = newR
|
||||
|
||||
r2.Square(&minusQ2.y)
|
||||
a, b, c, newR = lineFunctionAdd(r, minusQ2, bAffine, r2)
|
||||
a, b, c, _ = lineFunctionAdd(r, minusQ2, bAffine, r2)
|
||||
mulLine(ret, a, b, c)
|
||||
r = newR
|
||||
|
||||
return ret
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue