Commit 2c9ea07f authored by suyanlong's avatar suyanlong

Fixed bls Address type

parent c6a9d55d
......@@ -3,6 +3,7 @@ package bls
import (
"github.com/herumi/bls-eth-go-binary/bls"
"github.com/meshplus/bitxhub-kit/crypto"
"github.com/meshplus/bitxhub-kit/crypto/asym/ecdsa"
"github.com/meshplus/bitxhub-kit/types"
)
......@@ -59,7 +60,9 @@ func (p *PublicKey) Type() crypto.KeyType {
}
func (p *PublicKey) Address() (*types.Address, error) {
panic("implement me")
data := p.Serialize()
ret := ecdsa.Keccak256(data[1:])
return types.NewAddress(ret[12:]), nil
}
func (p *PublicKey) Verify(digest []byte, sig []byte) (bool, error) {
......
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