Commit 8456f2d8 authored by jiangpeng's avatar jiangpeng Committed by vipwzw

mod:update chain33

parent 84435b3c
...@@ -197,14 +197,14 @@ func (privKey PrivKeyBLS) Bytes() []byte { ...@@ -197,14 +197,14 @@ func (privKey PrivKeyBLS) Bytes() []byte {
} }
// Sign create signature // Sign create signature
func (privKey PrivKeyBLS) Sign(msg []byte, _ ...interface{}) crypto.Signature { func (privKey PrivKeyBLS) Sign(msg []byte) crypto.Signature {
priv := g1pubs.DeserializeSecretKey(privKey) priv := g1pubs.DeserializeSecretKey(privKey)
sig := g1pubs.Sign(msg, priv) sig := g1pubs.Sign(msg, priv)
return SignatureBLS(sig.Serialize()) return SignatureBLS(sig.Serialize())
} }
// PubKey convert to public key // PubKey convert to public key
func (privKey PrivKeyBLS) PubKey(_ ...interface{}) crypto.PubKey { func (privKey PrivKeyBLS) PubKey() crypto.PubKey {
priv := g1pubs.DeserializeSecretKey(privKey) priv := g1pubs.DeserializeSecretKey(privKey)
return PubKeyBLS(g1pubs.PrivToPub(priv).Serialize()) return PubKeyBLS(g1pubs.PrivToPub(priv).Serialize())
} }
......
...@@ -64,11 +64,11 @@ func (mock *privKeyMock) Bytes() []byte { ...@@ -64,11 +64,11 @@ func (mock *privKeyMock) Bytes() []byte {
return formatByte32([]byte("1234")) return formatByte32([]byte("1234"))
} }
func (mock *privKeyMock) Sign(msg []byte, _ ...interface{}) crypto.Signature { func (mock *privKeyMock) Sign(msg []byte) crypto.Signature {
return &signatureMock{} return &signatureMock{}
} }
func (mock *privKeyMock) PubKey(_ ...interface{}) crypto.PubKey { func (mock *privKeyMock) PubKey() crypto.PubKey {
return &pubKeyMock{} return &pubKeyMock{}
} }
......
...@@ -22,7 +22,7 @@ func (privKey PrivKeyPrivacy) Bytes() []byte { ...@@ -22,7 +22,7 @@ func (privKey PrivKeyPrivacy) Bytes() []byte {
} }
// Sign signature trasaction // Sign signature trasaction
func (privKey PrivKeyPrivacy) Sign(msg []byte, _ ...interface{}) crypto.Signature { func (privKey PrivKeyPrivacy) Sign(msg []byte) crypto.Signature {
temp := new([64]byte) temp := new([64]byte)
randomScalar := new([32]byte) randomScalar := new([32]byte)
...@@ -51,7 +51,7 @@ func (privKey PrivKeyPrivacy) Sign(msg []byte, _ ...interface{}) crypto.Signatur ...@@ -51,7 +51,7 @@ func (privKey PrivKeyPrivacy) Sign(msg []byte, _ ...interface{}) crypto.Signatur
} }
// PubKey get public key // PubKey get public key
func (privKey PrivKeyPrivacy) PubKey(_ ...interface{}) crypto.PubKey { func (privKey PrivKeyPrivacy) PubKey() crypto.PubKey {
var pubKeyPrivacy PubKeyPrivacy var pubKeyPrivacy PubKeyPrivacy
......
...@@ -64,7 +64,7 @@ func (privkey *RingSignPrivateKey) Bytes() []byte { ...@@ -64,7 +64,7 @@ func (privkey *RingSignPrivateKey) Bytes() []byte {
} }
// Sign signature trasaction // Sign signature trasaction
func (privkey *RingSignPrivateKey) Sign(msg []byte, _ ...interface{}) crypto.Signature { func (privkey *RingSignPrivateKey) Sign(msg []byte) crypto.Signature {
emptySign := &RingSignature{} emptySign := &RingSignature{}
if len(msg) <= 0 { if len(msg) <= 0 {
return emptySign return emptySign
...@@ -115,7 +115,7 @@ func (privkey *RingSignPrivateKey) Sign(msg []byte, _ ...interface{}) crypto.Sig ...@@ -115,7 +115,7 @@ func (privkey *RingSignPrivateKey) Sign(msg []byte, _ ...interface{}) crypto.Sig
} }
// PubKey convert to public key // PubKey convert to public key
func (privkey *RingSignPrivateKey) PubKey(_ ...interface{}) crypto.PubKey { func (privkey *RingSignPrivateKey) PubKey() crypto.PubKey {
publicKey := new(RingSignPublicKey) publicKey := new(RingSignPublicKey)
addr32 := (*[KeyLen32]byte)(unsafe.Pointer(&privkey.key)) addr32 := (*[KeyLen32]byte)(unsafe.Pointer(&privkey.key))
addr64 := (*[privateKeyLen]byte)(unsafe.Pointer(&privkey.key)) addr64 := (*[privateKeyLen]byte)(unsafe.Pointer(&privkey.key))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment