Commit b81a7f3f authored by 袁兴强's avatar 袁兴强 Committed by 33cn

adapt to new PrivKey interface

parent 42a36561
...@@ -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) crypto.Signature { func (privKey PrivKeyBLS) Sign(msg []byte, _ ...interface{}) 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() crypto.PubKey { func (privKey PrivKeyBLS) PubKey(_ ...interface{}) crypto.PubKey {
priv := g1pubs.DeserializeSecretKey(privKey) priv := g1pubs.DeserializeSecretKey(privKey)
return PubKeyBLS(g1pubs.PrivToPub(priv).Serialize()) return PubKeyBLS(g1pubs.PrivToPub(priv).Serialize())
} }
......
...@@ -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) crypto.Signature { func (privKey PrivKeyPrivacy) Sign(msg []byte, _ ...interface{}) 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) crypto.Signature { ...@@ -51,7 +51,7 @@ func (privKey PrivKeyPrivacy) Sign(msg []byte) crypto.Signature {
} }
// PubKey get public key // PubKey get public key
func (privKey PrivKeyPrivacy) PubKey() crypto.PubKey { func (privKey PrivKeyPrivacy) PubKey(_ ...interface{}) 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) crypto.Signature { func (privkey *RingSignPrivateKey) Sign(msg []byte, _ ...interface{}) 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) crypto.Signature { ...@@ -115,7 +115,7 @@ func (privkey *RingSignPrivateKey) Sign(msg []byte) crypto.Signature {
} }
// PubKey convert to public key // PubKey convert to public key
func (privkey *RingSignPrivateKey) PubKey() crypto.PubKey { func (privkey *RingSignPrivateKey) PubKey(_ ...interface{}) 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