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
8456f2d8
Commit
8456f2d8
authored
Aug 12, 2021
by
jiangpeng
Committed by
vipwzw
Sep 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mod:update chain33
parent
84435b3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
bls.go
plugin/crypto/bls/bls.go
+2
-2
privacy_test.go
plugin/dapp/privacy/crypto/privacy_test.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 @
8456f2d8
...
...
@@ -197,14 +197,14 @@ func (privKey PrivKeyBLS) Bytes() []byte {
}
// Sign create signature
func
(
privKey
PrivKeyBLS
)
Sign
(
msg
[]
byte
,
_
...
interface
{}
)
crypto
.
Signature
{
func
(
privKey
PrivKeyBLS
)
Sign
(
msg
[]
byte
)
crypto
.
Signature
{
priv
:=
g1pubs
.
DeserializeSecretKey
(
privKey
)
sig
:=
g1pubs
.
Sign
(
msg
,
priv
)
return
SignatureBLS
(
sig
.
Serialize
())
}
// PubKey convert to public key
func
(
privKey
PrivKeyBLS
)
PubKey
(
_
...
interface
{}
)
crypto
.
PubKey
{
func
(
privKey
PrivKeyBLS
)
PubKey
()
crypto
.
PubKey
{
priv
:=
g1pubs
.
DeserializeSecretKey
(
privKey
)
return
PubKeyBLS
(
g1pubs
.
PrivToPub
(
priv
)
.
Serialize
())
}
...
...
plugin/dapp/privacy/crypto/privacy_test.go
View file @
8456f2d8
...
...
@@ -64,11 +64,11 @@ func (mock *privKeyMock) Bytes() []byte {
return
formatByte32
([]
byte
(
"1234"
))
}
func
(
mock
*
privKeyMock
)
Sign
(
msg
[]
byte
,
_
...
interface
{}
)
crypto
.
Signature
{
func
(
mock
*
privKeyMock
)
Sign
(
msg
[]
byte
)
crypto
.
Signature
{
return
&
signatureMock
{}
}
func
(
mock
*
privKeyMock
)
PubKey
(
_
...
interface
{}
)
crypto
.
PubKey
{
func
(
mock
*
privKeyMock
)
PubKey
()
crypto
.
PubKey
{
return
&
pubKeyMock
{}
}
...
...
plugin/dapp/privacy/crypto/privatekey.go
View file @
8456f2d8
...
...
@@ -22,7 +22,7 @@ func (privKey PrivKeyPrivacy) Bytes() []byte {
}
// Sign signature trasaction
func
(
privKey
PrivKeyPrivacy
)
Sign
(
msg
[]
byte
,
_
...
interface
{}
)
crypto
.
Signature
{
func
(
privKey
PrivKeyPrivacy
)
Sign
(
msg
[]
byte
)
crypto
.
Signature
{
temp
:=
new
([
64
]
byte
)
randomScalar
:=
new
([
32
]
byte
)
...
...
@@ -51,7 +51,7 @@ func (privKey PrivKeyPrivacy) Sign(msg []byte, _ ...interface{}) crypto.Signatur
}
// PubKey get public key
func
(
privKey
PrivKeyPrivacy
)
PubKey
(
_
...
interface
{}
)
crypto
.
PubKey
{
func
(
privKey
PrivKeyPrivacy
)
PubKey
()
crypto
.
PubKey
{
var
pubKeyPrivacy
PubKeyPrivacy
...
...
plugin/dapp/privacy/crypto/ring_signature_crypto.go
View file @
8456f2d8
...
...
@@ -64,7 +64,7 @@ func (privkey *RingSignPrivateKey) Bytes() []byte {
}
// Sign signature trasaction
func
(
privkey
*
RingSignPrivateKey
)
Sign
(
msg
[]
byte
,
_
...
interface
{}
)
crypto
.
Signature
{
func
(
privkey
*
RingSignPrivateKey
)
Sign
(
msg
[]
byte
)
crypto
.
Signature
{
emptySign
:=
&
RingSignature
{}
if
len
(
msg
)
<=
0
{
return
emptySign
...
...
@@ -115,7 +115,7 @@ func (privkey *RingSignPrivateKey) Sign(msg []byte, _ ...interface{}) crypto.Sig
}
// PubKey convert to public key
func
(
privkey
*
RingSignPrivateKey
)
PubKey
(
_
...
interface
{}
)
crypto
.
PubKey
{
func
(
privkey
*
RingSignPrivateKey
)
PubKey
()
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