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
45ec8646
Commit
45ec8646
authored
Aug 23, 2021
by
mdj33
Committed by
vipwzw
Sep 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapt signature interface
parent
15488a32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
mixsignature.go
plugin/dapp/mix/wallet/mixsignature.go
+8
-4
No files found.
plugin/dapp/mix/wallet/mixsignature.go
View file @
45ec8646
...
@@ -28,8 +28,7 @@ const (
...
@@ -28,8 +28,7 @@ const (
)
)
func
init
()
{
func
init
()
{
crypto
.
Register
(
MixSignName
,
&
MixSignZkSnark
{},
false
)
crypto
.
Register
(
MixSignName
,
&
MixSignZkSnark
{},
crypto
.
WithRegOptionTypeID
(
MixSignID
))
crypto
.
RegisterType
(
MixSignName
,
MixSignID
)
}
}
// MixSignature mix签名中对于crypto.Signature接口实现
// MixSignature mix签名中对于crypto.Signature接口实现
...
@@ -71,12 +70,12 @@ func (privkey *MixSignPrivateKey) Bytes() []byte {
...
@@ -71,12 +70,12 @@ func (privkey *MixSignPrivateKey) Bytes() []byte {
}
}
// Sign signature trasaction
// Sign signature trasaction
func
(
privkey
*
MixSignPrivateKey
)
Sign
(
msg
[]
byte
)
crypto
.
Signature
{
func
(
privkey
*
MixSignPrivateKey
)
Sign
(
msg
[]
byte
,
opts
...
interface
{}
)
crypto
.
Signature
{
return
&
MixSignature
{}
return
&
MixSignature
{}
}
}
// PubKey convert to public key
// PubKey convert to public key
func
(
privkey
*
MixSignPrivateKey
)
PubKey
()
crypto
.
PubKey
{
func
(
privkey
*
MixSignPrivateKey
)
PubKey
(
opts
...
interface
{}
)
crypto
.
PubKey
{
publicKey
:=
new
(
MixSignPublicKey
)
publicKey
:=
new
(
MixSignPublicKey
)
return
publicKey
return
publicKey
}
}
...
@@ -219,3 +218,8 @@ func (r *MixSignZkSnark) SignatureFromBytes(b []byte) (crypto.Signature, error)
...
@@ -219,3 +218,8 @@ func (r *MixSignZkSnark) SignatureFromBytes(b []byte) (crypto.Signature, error)
return
&
mixSig
,
nil
return
&
mixSig
,
nil
}
}
// Validate validate msg and signature
func
(
r
*
MixSignZkSnark
)
Validate
(
msg
,
pub
,
sig
[]
byte
)
error
{
return
crypto
.
BasicValidation
(
r
,
msg
,
pub
,
sig
)
}
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