Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
ce0df3b4
Commit
ce0df3b4
authored
Jul 30, 2020
by
harrylee
Committed by
33cn
Aug 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unlinter comment line
parent
8b6c1218
Hide whitespace changes
Inline
Side-by-side
Showing
69 changed files
with
125 additions
and
64 deletions
+125
-64
blake2b.go
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2b.go
+11
-9
blake2bAVX2_amd64.go
...vm/executor/vm/common/crypto/blake2b/blake2bAVX2_amd64.go
+1
-0
blake2b_amd64.go
...pp/evm/executor/vm/common/crypto/blake2b/blake2b_amd64.go
+1
-0
blake2b_f_fuzz.go
...p/evm/executor/vm/common/crypto/blake2b/blake2b_f_fuzz.go
+1
-0
blake2b_f_test.go
...p/evm/executor/vm/common/crypto/blake2b/blake2b_f_test.go
+1
-0
blake2b_generic.go
.../evm/executor/vm/common/crypto/blake2b/blake2b_generic.go
+19
-17
blake2b_ref.go
...dapp/evm/executor/vm/common/crypto/blake2b/blake2b_ref.go
+1
-0
blake2b_test.go
...app/evm/executor/vm/common/crypto/blake2b/blake2b_test.go
+8
-7
blake2x.go
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2x.go
+1
-0
register.go
...in/dapp/evm/executor/vm/common/crypto/blake2b/register.go
+1
-0
arithmetic_decl.go
...evm/executor/vm/common/crypto/bls12381/arithmetic_decl.go
+1
-0
arithmetic_fallback.go
...executor/vm/common/crypto/bls12381/arithmetic_fallback.go
+1
-0
arithmetic_x86_adx.go
.../executor/vm/common/crypto/bls12381/arithmetic_x86_adx.go
+1
-0
arithmetic_x86_noadx.go
...xecutor/vm/common/crypto/bls12381/arithmetic_x86_noadx.go
+1
-0
bls12_381.go
.../dapp/evm/executor/vm/common/crypto/bls12381/bls12_381.go
+1
-0
field_element_test.go
.../executor/vm/common/crypto/bls12381/field_element_test.go
+1
-0
fp.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp.go
+1
-0
fp12.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp12.go
+1
-0
fp2.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp2.go
+1
-0
fp6.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp6.go
+1
-0
fp_test.go
...in/dapp/evm/executor/vm/common/crypto/bls12381/fp_test.go
+1
-0
g1.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/g1.go
+1
-0
g1_test.go
...in/dapp/evm/executor/vm/common/crypto/bls12381/g1_test.go
+1
-0
g2.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/g2.go
+1
-0
g2_test.go
...in/dapp/evm/executor/vm/common/crypto/bls12381/g2_test.go
+1
-0
gt.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/gt.go
+5
-6
isogeny.go
...in/dapp/evm/executor/vm/common/crypto/bls12381/isogeny.go
+1
-0
pairing.go
...in/dapp/evm/executor/vm/common/crypto/bls12381/pairing.go
+2
-2
pairing_test.go
...pp/evm/executor/vm/common/crypto/bls12381/pairing_test.go
+1
-0
swu.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/swu.go
+1
-0
utils.go
plugin/dapp/evm/executor/vm/common/crypto/bls12381/utils.go
+1
-0
bn256_fast.go
...in/dapp/evm/executor/vm/common/crypto/bn256/bn256_fast.go
+2
-0
bn256_fuzz.go
...in/dapp/evm/executor/vm/common/crypto/bn256/bn256_fuzz.go
+1
-0
bn256_slow.go
...in/dapp/evm/executor/vm/common/crypto/bn256/bn256_slow.go
+2
-0
bn256.go
...p/evm/executor/vm/common/crypto/bn256/cloudflare/bn256.go
+2
-0
bn256_test.go
.../executor/vm/common/crypto/bn256/cloudflare/bn256_test.go
+1
-0
constants.go
...m/executor/vm/common/crypto/bn256/cloudflare/constants.go
+1
-1
curve.go
...p/evm/executor/vm/common/crypto/bn256/cloudflare/curve.go
+1
-0
example_test.go
...xecutor/vm/common/crypto/bn256/cloudflare/example_test.go
+1
-1
gfp.go
...app/evm/executor/vm/common/crypto/bn256/cloudflare/gfp.go
+1
-0
gfp12.go
...p/evm/executor/vm/common/crypto/bn256/cloudflare/gfp12.go
+1
-0
gfp2.go
...pp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp2.go
+1
-0
gfp6.go
...pp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp6.go
+1
-0
gfp_decl.go
...vm/executor/vm/common/crypto/bn256/cloudflare/gfp_decl.go
+4
-1
gfp_generic.go
...executor/vm/common/crypto/bn256/cloudflare/gfp_generic.go
+2
-0
gfp_test.go
...vm/executor/vm/common/crypto/bn256/cloudflare/gfp_test.go
+1
-0
lattice.go
...evm/executor/vm/common/crypto/bn256/cloudflare/lattice.go
+1
-0
lattice_test.go
...xecutor/vm/common/crypto/bn256/cloudflare/lattice_test.go
+1
-0
main_test.go
...m/executor/vm/common/crypto/bn256/cloudflare/main_test.go
+1
-0
optate.go
.../evm/executor/vm/common/crypto/bn256/cloudflare/optate.go
+1
-0
twist.go
...p/evm/executor/vm/common/crypto/bn256/cloudflare/twist.go
+1
-0
bn256.go
.../dapp/evm/executor/vm/common/crypto/bn256/google/bn256.go
+1
-0
bn256_test.go
.../evm/executor/vm/common/crypto/bn256/google/bn256_test.go
+1
-1
constants.go
...p/evm/executor/vm/common/crypto/bn256/google/constants.go
+1
-1
curve.go
.../dapp/evm/executor/vm/common/crypto/bn256/google/curve.go
+1
-1
example_test.go
...vm/executor/vm/common/crypto/bn256/google/example_test.go
+1
-1
gfp12.go
.../dapp/evm/executor/vm/common/crypto/bn256/google/gfp12.go
+1
-1
gfp2.go
...n/dapp/evm/executor/vm/common/crypto/bn256/google/gfp2.go
+1
-1
gfp6.go
...n/dapp/evm/executor/vm/common/crypto/bn256/google/gfp6.go
+1
-1
main_test.go
...p/evm/executor/vm/common/crypto/bn256/google/main_test.go
+1
-0
optate.go
...dapp/evm/executor/vm/common/crypto/bn256/google/optate.go
+1
-1
twist.go
.../dapp/evm/executor/vm/common/crypto/bn256/google/twist.go
+1
-1
hash.go
plugin/dapp/evm/executor/vm/common/hash.go
+2
-2
memory_table.go
plugin/dapp/evm/executor/vm/mm/memory_table.go
+1
-1
stack.go
plugin/dapp/evm/executor/vm/mm/stack.go
+4
-2
const.go
plugin/dapp/evm/executor/vm/model/const.go
+1
-0
errors.go
plugin/dapp/evm/executor/vm/model/errors.go
+5
-4
protocol_params.go
plugin/dapp/evm/executor/vm/params/protocol_params.go
+1
-0
opcodes.go
plugin/dapp/evm/executor/vm/runtime/opcodes.go
+2
-2
No files found.
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2b.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,8 @@
//
// BLAKE2X is a construction to compute hash values larger than 64 bytes. It
// can produce hash values between 0 and 4 GiB.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
(
...
...
@@ -302,18 +304,18 @@ func appendUint64(b []byte, x uint64) []byte {
return
append
(
b
,
a
[
:
]
...
)
}
//
func appendUint32(b []byte, x uint32) []byte {
//
var a [4]byte
//
binary.BigEndian.PutUint32(a[:], x)
//
return append(b, a[:]...)
//
}
func
appendUint32
(
b
[]
byte
,
x
uint32
)
[]
byte
{
var
a
[
4
]
byte
binary
.
BigEndian
.
PutUint32
(
a
[
:
],
x
)
return
append
(
b
,
a
[
:
]
...
)
}
func
consumeUint64
(
b
[]
byte
)
([]
byte
,
uint64
)
{
x
:=
binary
.
BigEndian
.
Uint64
(
b
)
return
b
[
8
:
],
x
}
//
func consumeUint32(b []byte) ([]byte, uint32) {
//
x := binary.BigEndian.Uint32(b)
//
return b[4:], x
//
}
func
consumeUint32
(
b
[]
byte
)
([]
byte
,
uint32
)
{
x
:=
binary
.
BigEndian
.
Uint32
(
b
)
return
b
[
4
:
],
x
}
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2bAVX2_amd64.go
View file @
ce0df3b4
...
...
@@ -4,6 +4,7 @@
// +build go1.7,amd64,!gccgo,!appengine
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
"golang.org/x/sys/cpu"
...
...
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2b_amd64.go
View file @
ce0df3b4
...
...
@@ -4,6 +4,7 @@
// +build !go1.7,amd64,!gccgo,!appengine
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
"golang.org/x/sys/cpu"
...
...
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2b_f_fuzz.go
View file @
ce0df3b4
// +build gofuzz
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2b_f_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2b_generic.go
View file @
ce0df3b4
...
...
@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
(
"encoding/binary"
"math/bits"
)
...
...
@@ -24,23 +26,23 @@ var precomputed = [10][16]byte{
{
10
,
8
,
7
,
1
,
2
,
4
,
6
,
5
,
15
,
9
,
3
,
13
,
11
,
14
,
12
,
0
},
}
//
func hashBlocksGeneric(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) {
//
var m [16]uint64
//
c0, c1 := c[0], c[1]
//
//
for i := 0; i < len(blocks); {
//
c0 += BlockSize
//
if c0 < BlockSize {
//
c1++
//
}
//
for j := range m {
//
m[j] = binary.LittleEndian.Uint64(blocks[i:])
//
i += 8
//
}
//
fGeneric(h, &m, c0, c1, flag, 12)
//
}
//
c[0], c[1] = c0, c1
//
}
func
hashBlocksGeneric
(
h
*
[
8
]
uint64
,
c
*
[
2
]
uint64
,
flag
uint64
,
blocks
[]
byte
)
{
var
m
[
16
]
uint64
c0
,
c1
:=
c
[
0
],
c
[
1
]
for
i
:=
0
;
i
<
len
(
blocks
);
{
c0
+=
BlockSize
if
c0
<
BlockSize
{
c1
++
}
for
j
:=
range
m
{
m
[
j
]
=
binary
.
LittleEndian
.
Uint64
(
blocks
[
i
:
])
i
+=
8
}
fGeneric
(
h
,
&
m
,
c0
,
c1
,
flag
,
12
)
}
c
[
0
],
c
[
1
]
=
c0
,
c1
}
func
fGeneric
(
h
*
[
8
]
uint64
,
m
*
[
16
]
uint64
,
c0
,
c1
uint64
,
flag
uint64
,
rounds
uint64
)
{
v0
,
v1
,
v2
,
v3
,
v4
,
v5
,
v6
,
v7
:=
h
[
0
],
h
[
1
],
h
[
2
],
h
[
3
],
h
[
4
],
h
[
5
],
h
[
6
],
h
[
7
]
...
...
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2b_ref.go
View file @
ce0df3b4
...
...
@@ -4,6 +4,7 @@
// +build !amd64 appengine gccgo
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
func
f
(
h
*
[
8
]
uint64
,
m
*
[
16
]
uint64
,
c0
,
c1
uint64
,
flag
uint64
,
rounds
uint64
)
{
...
...
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2b_test.go
View file @
ce0df3b4
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
(
...
...
@@ -14,13 +15,13 @@ import (
"testing"
)
//
func fromHex(s string) []byte {
//
b, err := hex.DecodeString(s)
//
if err != nil {
//
panic(err)
//
}
//
return b
//
}
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
)
{
...
...
plugin/dapp/evm/executor/vm/common/crypto/blake2b/blake2x.go
View file @
ce0df3b4
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/blake2b/register.go
View file @
ce0df3b4
...
...
@@ -4,6 +4,7 @@
// +build go1.9
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
blake2b
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/arithmetic_decl.go
View file @
ce0df3b4
...
...
@@ -16,6 +16,7 @@
// +build amd64,blsasm amd64,blsadx
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/arithmetic_fallback.go
View file @
ce0df3b4
...
...
@@ -33,6 +33,7 @@
// +build !amd64 !blsasm,!blsadx
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/arithmetic_x86_adx.go
View file @
ce0df3b4
...
...
@@ -16,6 +16,7 @@
// +build amd64,blsadx
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
// enableADX is true if the ADX/BMI2 instruction set was requested for the BLS
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/arithmetic_x86_noadx.go
View file @
ce0df3b4
...
...
@@ -16,6 +16,7 @@
// +build amd64,blsasm
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
// enableADX is true if the ADX/BMI2 instruction set was requested for the BLS
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/bls12_381.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
/*
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/field_element_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp12.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp2.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp6.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/fp_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/g1.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/g1_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/g2.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/g2_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/gt.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
@@ -37,8 +38,7 @@ func (e *E) Set(e2 *E) *E {
// One sets a new target group element to one
func
(
e
*
E
)
One
()
*
E
{
e
=
new
(
fe12
)
.
one
()
var
e1
*
E
=
e
return
e1
return
e
}
// IsOne returns true if given element equals to one
...
...
@@ -69,11 +69,10 @@ func (g *GT) FromBytes(in []byte) (*E, error) {
if
err
!=
nil
{
return
nil
,
err
}
var
e1
*
E
=
e
if
!
g
.
IsValid
(
e1
)
{
return
e1
,
errors
.
New
(
"invalid element"
)
if
!
g
.
IsValid
(
e
)
{
return
e
,
errors
.
New
(
"invalid element"
)
}
return
e
1
,
nil
return
e
,
nil
}
// ToBytes serializes target group element.
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/isogeny.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
// isogenyMapG1 applies 11-isogeny map for BLS12-381 G1 defined at draft-irtf-cfrg-hash-to-curve-06.
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/pairing.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
type
pair
struct
{
...
...
@@ -272,9 +273,8 @@ func (e *Engine) Check() bool {
// Result computes pairing and returns target group element as result.
func
(
e
*
Engine
)
Result
()
*
E
{
r
:=
e
.
calculate
()
var
r1
*
E
=
r
e
.
Reset
()
return
r
1
return
r
}
// GT returns target group instance.
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/pairing_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/swu.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
// swuMapG1 is implementation of Simplified Shallue-van de Woestijne-Ulas Method
...
...
plugin/dapp/evm/executor/vm/common/crypto/bls12381/utils.go
View file @
ce0df3b4
...
...
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bls12381
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/bn256_fast.go
View file @
ce0df3b4
...
...
@@ -5,6 +5,8 @@
// +build amd64 arm64
// Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/bn256_fuzz.go
View file @
ce0df3b4
...
...
@@ -4,6 +4,7 @@
// +build gofuzz
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/bn256_slow.go
View file @
ce0df3b4
...
...
@@ -5,6 +5,8 @@
// +build !amd64,!arm64
// Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
bn256
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/common/crypto/bn256/google"
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/bn256.go
View file @
ce0df3b4
...
...
@@ -11,6 +11,8 @@
// Barreto-Naehrig curve as described in
// http://cryptojedi.org/papers/dclxvi-20100714.pdf. Its output is compatible
// with the implementation described in that paper.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/bn256_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/constants.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/curve.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/example_test.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp12.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
// For details of the algorithms used, see "Multiplication and Squaring on
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp2.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
// For details of the algorithms used, see "Multiplication and Squaring on
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp6.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
// For details of the algorithms used, see "Multiplication and Squaring on
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp_decl.go
View file @
ce0df3b4
// +build amd64,!generic arm64,!generic
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
"golang.org/x/sys/cpu"
// This file contains forward declarations for the architecture-specific
// assembly implementations of these functions, provided that they exist.
//nolint:varcheck
//
var hasBMI2 = cpu.X86.HasBMI2
var
hasBMI2
=
cpu
.
X86
.
HasBMI2
// go:noescape
func
gfpNeg
(
c
,
a
*
gfP
)
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp_generic.go
View file @
ce0df3b4
// +build !amd64,!arm64 generic
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
func
gfpCarry
(
a
*
gfP
,
head
uint64
)
{
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/gfp_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/lattice.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/lattice_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/main_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/optate.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
func
lineFunctionAdd
(
r
,
p
*
twistPoint
,
q
*
curvePoint
,
r2
*
gfP2
)
(
a
,
b
,
c
*
gfP2
,
rOut
*
twistPoint
)
{
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/cloudflare/twist.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/bn256.go
View file @
ce0df3b4
...
...
@@ -18,6 +18,7 @@
// (This package previously claimed to operate at a 128-bit security level.
// However, recent improvements in attacks mean that is no longer true. See
// https://moderncrypto.org/mail-archive/curves/2016/000740.html.)
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/bn256_test.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/constants.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/curve.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/example_test.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/gfp12.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
// For details of the algorithms used, see "Multiplication and Squaring on
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/gfp2.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
// For details of the algorithms used, see "Multiplication and Squaring on
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/gfp6.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
// For details of the algorithms used, see "Multiplication and Squaring on
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/main_test.go
View file @
ce0df3b4
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/optate.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
func
lineFunctionAdd
(
r
,
p
*
twistPoint
,
q
*
curvePoint
,
r2
*
gfP2
,
pool
*
bnPool
)
(
a
,
b
,
c
*
gfP2
,
rOut
*
twistPoint
)
{
...
...
plugin/dapp/evm/executor/vm/common/crypto/bn256/google/twist.go
View file @
ce0df3b4
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
bn256
import
(
...
...
plugin/dapp/evm/executor/vm/common/hash.go
View file @
ce0df3b4
...
...
@@ -18,7 +18,7 @@ const (
// Hash160Length Hash160格式的地址长度
Hash160Length
=
20
// AddressLength 地址长度
AddressLength
=
20
)
...
...
@@ -51,7 +51,7 @@ func BigToHash(b *big.Int) Hash {
return
Hash
(
common
.
BytesToHash
(
b
.
Bytes
()))
}
//
uinitToHash
//
Uint256ToHash 大数转化为哈希
func
Uint256ToHash
(
u
*
uint256
.
Int
)
Hash
{
return
Hash
(
common
.
BytesToHash
(
u
.
Bytes
()))
}
...
...
plugin/dapp/evm/executor/vm/mm/memory_table.go
View file @
ce0df3b4
...
...
@@ -11,7 +11,7 @@ type (
MemorySizeFunc
func
(
*
Stack
)
(
size
uint64
,
overflow
bool
)
)
//
MemorySha3 sha3计算所需内存大小
//MemorySha3 sha3计算所需内存大小
func
MemorySha3
(
stack
*
Stack
)
(
uint64
,
bool
)
{
return
calcMemSize64
(
stack
.
Back
(
0
),
stack
.
Back
(
1
))
}
...
...
plugin/dapp/evm/executor/vm/mm/stack.go
View file @
ce0df3b4
...
...
@@ -26,7 +26,7 @@ type Stack struct {
func
NewStack
()
*
Stack
{
return
stackPool
.
Get
()
.
(
*
Stack
)
}
// Returnstack 把用完的stack还给stackpool
func
Returnstack
(
s
*
Stack
)
{
s
.
data
=
s
.
data
[
:
0
]
stackPool
.
Put
(
s
)
...
...
@@ -108,6 +108,7 @@ var rStackPool = sync.Pool{
},
}
// ReturnStack 返回栈对象
type
ReturnStack
struct
{
data
[]
uint32
}
...
...
@@ -123,11 +124,12 @@ func ReturnRStack(rs *ReturnStack) {
rStackPool
.
Put
(
rs
)
}
// Push 压栈
func
(
st
*
ReturnStack
)
Push
(
d
uint32
)
{
st
.
data
=
append
(
st
.
data
,
d
)
}
//
Pop
A uint32 is sufficient as for code below 4.2G
//
Pop
A uint32 is sufficient as for code below 4.2G
func
(
st
*
ReturnStack
)
Pop
()
(
ret
uint32
)
{
ret
=
st
.
data
[
len
(
st
.
data
)
-
1
]
st
.
data
=
st
.
data
[
:
len
(
st
.
data
)
-
1
]
...
...
plugin/dapp/evm/executor/vm/model/const.go
View file @
ce0df3b4
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
model
const
(
...
...
plugin/dapp/evm/executor/vm/model/errors.go
View file @
ce0df3b4
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
model
import
"errors"
...
...
@@ -41,12 +42,12 @@ var (
// ErrNoCoinsAccount no coins account in executor!
ErrNoCoinsAccount
=
errors
.
New
(
"no coins account in executor"
)
// ErrReturnStackExceeded
// ErrReturnStackExceeded
return stack limit reached
ErrReturnStackExceeded
=
errors
.
New
(
"return stack limit reached"
)
// ErrInvalidSubroutineEntry
// ErrInvalidSubroutineEntry
invalid subroutine entry
ErrInvalidSubroutineEntry
=
errors
.
New
(
"invalid subroutine entry"
)
// ErrInvalidJump
// ErrInvalidJump
invalid jump destination
ErrInvalidJump
=
errors
.
New
(
"invalid jump destination"
)
// ErrInvalidRetsub
// ErrInvalidRetsub
invalid retsub
ErrInvalidRetsub
=
errors
.
New
(
"invalid retsub"
)
)
plugin/dapp/evm/executor/vm/params/protocol_params.go
View file @
ce0df3b4
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//nolint:unparam // 忽视本文件所有golangci-linter检查
package
params
import
"math/big"
...
...
plugin/dapp/evm/executor/vm/runtime/opcodes.go
View file @
ce0df3b4
...
...
@@ -355,9 +355,9 @@ const (
JUMPDEST
// BEGINSUB OP
BEGINSUB
// RETURNSUB op
RETURNSUB
// JUMPSUB op
JUMPSUB
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment