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
b81a7f3f
Commit
b81a7f3f
authored
Jun 30, 2021
by
袁兴强
Committed by
33cn
Jul 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapt to new PrivKey interface
parent
42a36561
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
bls.go
plugin/crypto/bls/bls.go
+2
-2
privatekey.go
plugin/dapp/privacy/crypto/privatekey.go
+2
-2
ring_signature_crypto.go
plugin/dapp/privacy/crypto/ring_signature_crypto.go
+2
-2
No files found.
plugin/crypto/bls/bls.go
View file @
b81a7f3f
...
...
@@ -197,14 +197,14 @@ func (privKey PrivKeyBLS) Bytes() []byte {
}
// Sign create signature
func
(
privKey
PrivKeyBLS
)
Sign
(
msg
[]
byte
)
crypto
.
Signature
{
func
(
privKey
PrivKeyBLS
)
Sign
(
msg
[]
byte
,
_
...
interface
{}
)
crypto
.
Signature
{
priv
:=
g1pubs
.
DeserializeSecretKey
(
privKey
)
sig
:=
g1pubs
.
Sign
(
msg
,
priv
)
return
SignatureBLS
(
sig
.
Serialize
())
}
// PubKey convert to public key
func
(
privKey
PrivKeyBLS
)
PubKey
()
crypto
.
PubKey
{
func
(
privKey
PrivKeyBLS
)
PubKey
(
_
...
interface
{}
)
crypto
.
PubKey
{
priv
:=
g1pubs
.
DeserializeSecretKey
(
privKey
)
return
PubKeyBLS
(
g1pubs
.
PrivToPub
(
priv
)
.
Serialize
())
}
...
...
plugin/dapp/privacy/crypto/privatekey.go
View file @
b81a7f3f
...
...
@@ -22,7 +22,7 @@ func (privKey PrivKeyPrivacy) Bytes() []byte {
}
// Sign signature trasaction
func
(
privKey
PrivKeyPrivacy
)
Sign
(
msg
[]
byte
)
crypto
.
Signature
{
func
(
privKey
PrivKeyPrivacy
)
Sign
(
msg
[]
byte
,
_
...
interface
{}
)
crypto
.
Signature
{
temp
:=
new
([
64
]
byte
)
randomScalar
:=
new
([
32
]
byte
)
...
...
@@ -51,7 +51,7 @@ func (privKey PrivKeyPrivacy) Sign(msg []byte) crypto.Signature {
}
// PubKey get public key
func
(
privKey
PrivKeyPrivacy
)
PubKey
()
crypto
.
PubKey
{
func
(
privKey
PrivKeyPrivacy
)
PubKey
(
_
...
interface
{}
)
crypto
.
PubKey
{
var
pubKeyPrivacy
PubKeyPrivacy
...
...
plugin/dapp/privacy/crypto/ring_signature_crypto.go
View file @
b81a7f3f
...
...
@@ -64,7 +64,7 @@ func (privkey *RingSignPrivateKey) Bytes() []byte {
}
// Sign signature trasaction
func
(
privkey
*
RingSignPrivateKey
)
Sign
(
msg
[]
byte
)
crypto
.
Signature
{
func
(
privkey
*
RingSignPrivateKey
)
Sign
(
msg
[]
byte
,
_
...
interface
{}
)
crypto
.
Signature
{
emptySign
:=
&
RingSignature
{}
if
len
(
msg
)
<=
0
{
return
emptySign
...
...
@@ -115,7 +115,7 @@ func (privkey *RingSignPrivateKey) Sign(msg []byte) crypto.Signature {
}
// PubKey convert to public key
func
(
privkey
*
RingSignPrivateKey
)
PubKey
()
crypto
.
PubKey
{
func
(
privkey
*
RingSignPrivateKey
)
PubKey
(
_
...
interface
{}
)
crypto
.
PubKey
{
publicKey
:=
new
(
RingSignPublicKey
)
addr32
:=
(
*
[
KeyLen32
]
byte
)(
unsafe
.
Pointer
(
&
privkey
.
key
))
addr64
:=
(
*
[
privateKeyLen
]
byte
)(
unsafe
.
Pointer
(
&
privkey
.
key
))
...
...
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