Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar
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
sidecar
Commits
b834c03c
Commit
b834c03c
authored
Nov 19, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug and update dep
parent
97649fce
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
3 deletions
+21
-3
go.mod
go.mod
+2
-1
go.sum
go.sum
+2
-2
bls.go
pkg/crypto/bls/bls.go
+6
-0
bls_test.go
pkg/crypto/bls/bls_test.go
+11
-0
No files found.
go.mod
View file @
b834c03c
...
@@ -195,4 +195,5 @@ require (
...
@@ -195,4 +195,5 @@ require (
)
)
replace github.com/libp2p/go-libp2p-core => github.com/libp2p/go-libp2p-core v0.5.6
replace github.com/libp2p/go-libp2p-core => github.com/libp2p/go-libp2p-core v0.5.6
replace github.com/meshplus/bitxhub-kit => github.com/suyanlong/bitxhub-kit v1.2.1-0.20211118095742-332b6c4e4b9f
replace github.com/meshplus/bitxhub-kit => github.com/suyanlong/bitxhub-kit v1.2.1-0.20211119060656-70eb89a9b03d
go.sum
View file @
b834c03c
...
@@ -927,8 +927,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
...
@@ -927,8 +927,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/suyanlong/bitxhub-kit v1.2.1-0.2021111
8095742-332b6c4e4b9f h1:X8yS+C9VjzzrPUwoxagOebfZl6kRI/+GRw8k4jVfyeo
=
github.com/suyanlong/bitxhub-kit v1.2.1-0.2021111
9060656-70eb89a9b03d h1:ZZ7t5/MPISe2FdnUbIqlafbhSe0mPUktN0o2g7duwq8
=
github.com/suyanlong/bitxhub-kit v1.2.1-0.2021111
8095742-332b6c4e4b9f
/go.mod h1:yp/KN421RU3uYvn7PVQj/ru+CsnJkN6PfE2g4d9YDVQ=
github.com/suyanlong/bitxhub-kit v1.2.1-0.2021111
9060656-70eb89a9b03d
/go.mod h1:yp/KN421RU3uYvn7PVQj/ru+CsnJkN6PfE2g4d9YDVQ=
github.com/sykesm/zap-logfmt v0.0.3 h1:3Wrhf7+I9JEUD8B6KPtDAr9j2jrS0/EPLy7GCE1t/+U=
github.com/sykesm/zap-logfmt v0.0.3 h1:3Wrhf7+I9JEUD8B6KPtDAr9j2jrS0/EPLy7GCE1t/+U=
github.com/sykesm/zap-logfmt v0.0.3/go.mod h1:AuBd9xQjAe3URrWT1BBDk2v2onAZHkZkWRMiYZXiZWA=
github.com/sykesm/zap-logfmt v0.0.3/go.mod h1:AuBd9xQjAe3URrWT1BBDk2v2onAZHkZkWRMiYZXiZWA=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
...
...
pkg/crypto/bls/bls.go
View file @
b834c03c
...
@@ -11,6 +11,12 @@ import (
...
@@ -11,6 +11,12 @@ import (
)
)
func
init
()
{
func
init
()
{
if
err
:=
bls
.
Init
(
bls
.
BLS12_381
);
err
!=
nil
{
panic
(
err
)
}
if
err
:=
bls
.
SetETHmode
(
bls
.
EthModeDraft07
);
err
!=
nil
{
panic
(
err
)
}
asym
.
RegisterCrypto1
(
asym
.
RegisterCrypto1
(
BlsEth
,
BlsEth
,
"BlsEth"
,
"BlsEth"
,
...
...
pkg/crypto/bls/bls_test.go
View file @
b834c03c
...
@@ -387,3 +387,14 @@ func TestZero(t *testing.T) {
...
@@ -387,3 +387,14 @@ func TestZero(t *testing.T) {
t
.
Fatal
(
"sig is not zero"
)
t
.
Fatal
(
"sig is not zero"
)
}
}
}
}
func
TestAddress
(
t
*
testing
.
T
)
{
pk
:=
PublicKey
{
curve
:
BlsEth
,
PublicKey
:
&
bls
.
PublicKey
{},
}
address
,
err
:=
pk
.
Address
()
assert
.
Nil
(
t
,
err
)
assert
.
NotNil
(
t
,
address
)
t
.
Log
(
address
)
}
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