func (publicKey PublicKey) Bytes() []byte {
	return publicKey[:]
}
Bytes returns the publicKey in bytes.
package ed25519
import (
	"encoding/json"
	"errors"
	"fmt"
	"golang.org/x/xerrors"
	"github.com/iotaledger/hive.go/marshalutil"
	"github.com/mr-tron/base58"
	"github.com/oasisprotocol/ed25519"
)
type PublicKey [PublicKeySize]byte
func PublicKeyFromString(s string) (publicKey PublicKey, err error) {
	b, err := base58.Decode(s)
	if err != nil {
		return publicKey, xerrors.Errorf("failed to parse public key %s from base58 string: %w", s, err)
	}
	publicKey, _, err = PublicKeyFromBytes(b)
	return publicKey, err
}
func PublicKeyFromBytes(bytes []byte) (result PublicKey, consumedBytes int, err error) {
	if len(bytes) < PublicKeySize {
		err = fmt.Errorf("bytes too short")
		return
	}
	copy(result[:], bytes)
	consumedBytes = PublicKeySize
	return
}
func RecoverKey(key, data, sig []byte) (result PublicKey, err error) {
	if l := len(key); l != PublicKeySize {
		err = fmt.Errorf("invalid key length: %d, need %d", l, PublicKeySize)
		return
	}
	if l := len(sig); l != SignatureSize {
		err = fmt.Errorf("invalid signature length: %d, need %d", l, SignatureSize)
		return
	}
	if !ed25519.Verify(key, data, sig) {
		err = fmt.Errorf("invalid signature")
		return
	}
	copy(result[:], key)
	return
}
func ParsePublicKey(marshalUtil *marshalutil.MarshalUtil) (PublicKey, error) {
	if id, err := marshalUtil.Parse(func(data []byte) (interface{}, int, error) { return PublicKeyFromBytes(data) }); err != nil {
		return PublicKey{}, err
	} else {
		return id.(PublicKey), nil
	}
}
func (publicKey PublicKey) VerifySignature(data []byte, signature Signature) bool {
	return ed25519.Verify(publicKey[:], data, signature[:])
}