Documentation ¶
Index ¶
Constants ¶
const PrivateKeySize = ed25519.PrivateKeySize
PrivateKeySize size of the private key in bytes.
Variables ¶
This section is empty.
Functions ¶
func Public ¶ added in v1.0.0
func Public(priv PrivateKey) ed25519.PublicKey
Types ¶
type EdSigner ¶
type EdSigner struct {
// contains filtered or unexported fields
}
EdSigner represents an ED25519 signer.
func NewEdSigner ¶
func NewEdSigner(opts ...EdSignerOptionFunc) (*EdSigner, error)
NewEdSigner returns an auto-generated ed signer.
func (*EdSigner) PrivateKey ¶ added in v1.0.0
func (es *EdSigner) PrivateKey() PrivateKey
PrivateKey returns private key.
type EdSignerOptionFunc ¶ added in v1.0.0
type EdSignerOptionFunc func(*edSignerOption) error
EdSignerOptionFunc modifies EdSigner.
func WithKeyFromRand ¶ added in v1.0.0
func WithKeyFromRand(rand io.Reader) EdSignerOptionFunc
WithKeyFromRand sets the private key used by EdSigner using predictable randomness source.
func WithPrefix ¶ added in v1.0.0
func WithPrefix(prefix []byte) EdSignerOptionFunc
WithPrefix sets the prefix used by EdSigner. This usually is the Network ID.
func WithPrivateKey ¶ added in v1.0.0
func WithPrivateKey(priv PrivateKey) EdSignerOptionFunc
WithPrivateKey sets the private key used by EdSigner.
type ExtractorOptionFunc ¶
type ExtractorOptionFunc func(*edExtractorOption) error
ExtractorOptionFunc to modify verifier.
func WithExtractorPrefix ¶
func WithExtractorPrefix(prefix []byte) ExtractorOptionFunc
WithExtractorPrefix sets the prefix used by PubKeyExtractor. This usually is the Network ID.
type PrivateKey ¶ added in v1.0.0
type PrivateKey = ed25519.PrivateKey
PrivateKey is an alias to spacemeshos/ed25519.PrivateKey.
type PubKeyExtractor ¶
type PubKeyExtractor struct {
// contains filtered or unexported fields
}
PubKeyExtractor extracts public keys from signatures.
func NewPubKeyExtractor ¶
func NewPubKeyExtractor(opts ...ExtractorOptionFunc) (*PubKeyExtractor, error)
NewPubKeyExtractor returns a new PubKeyExtractor.
func (PubKeyExtractor) Extract ¶
func (e PubKeyExtractor) Extract(m, sig []byte) (*PublicKey, error)
Extract public key from a signature.
func (PubKeyExtractor) ExtractNodeID ¶
func (e PubKeyExtractor) ExtractNodeID(m, sig []byte) (types.NodeID, error)
ExtractNodeID from a signature.
type PublicKey ¶
PublicKey is the type describing a public key.
func NewPublicKey ¶
NewPublicKey constructs a new public key instance from a byte array.
func (*PublicKey) Field ¶ added in v0.1.15
Field returns a log field. Implements the LoggableField interface.
func (*PublicKey) ShortString ¶
ShortString returns a representative sub string.
type VRFSigner ¶ added in v0.1.34
type VRFSigner struct {
// contains filtered or unexported fields
}
VRFSigner is a signer for VRF purposes.
func (VRFSigner) LittleEndian ¶ added in v1.0.0
LittleEndian indicates whether byte order in a signature is little-endian.
type VRFVerifier ¶ added in v1.0.0
func NewVRFVerifier ¶ added in v1.0.0
func NewVRFVerifier() VRFVerifier