signing

package
v0.1.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VRFVerify added in v0.1.34

func VRFVerify(pub, msg, sig []byte) bool

VRFVerify verifies a message and signature, given a public key

func Verify

func Verify(pubkey *PublicKey, message []byte, sign []byte) bool

Verify verifies the provided message

Types

type EdSigner

type EdSigner struct {
	// contains filtered or unexported fields
}

EdSigner represents an ED25519 signer

func NewEdSigner

func NewEdSigner() *EdSigner

NewEdSigner returns an auto-generated ed signer

func NewEdSignerFromBuffer

func NewEdSignerFromBuffer(buff []byte) (*EdSigner, error)

NewEdSignerFromBuffer builds a signer from a private key as byte buffer

func (*EdSigner) PublicKey

func (es *EdSigner) PublicKey() *PublicKey

PublicKey returns the public key of the signer

func (*EdSigner) Sign

func (es *EdSigner) Sign(m []byte) []byte

Sign signs the provided message

func (*EdSigner) ToBuffer

func (es *EdSigner) ToBuffer() []byte

ToBuffer returns the private key as a byte buffer

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey is the type describing a public key

func NewPublicKey

func NewPublicKey(pub []byte) *PublicKey

NewPublicKey constructs a new public key instance from a byte array

func (*PublicKey) Bytes

func (p *PublicKey) Bytes() []byte

Bytes returns the public key as byte array

func (*PublicKey) Equals

func (p *PublicKey) Equals(o *PublicKey) bool

Equals returns true iff the public keys are equal

func (*PublicKey) Field added in v0.1.15

func (p *PublicKey) Field() log.Field

Field returns a log field. Implements the LoggableField interface.

func (*PublicKey) ShortString

func (p *PublicKey) ShortString() string

ShortString returns a representative sub string

func (*PublicKey) String

func (p *PublicKey) String() string

String returns the public key as a hex representation string

type VRFSigner added in v0.1.34

type VRFSigner struct {
	// contains filtered or unexported fields
}

VRFSigner is a signer for VRF purposes

func NewVRFSigner added in v0.1.34

func NewVRFSigner(seed []byte) (*VRFSigner, []byte, error)

NewVRFSigner creates a new VRFSigner from a 32-byte seed

func (VRFSigner) Sign added in v0.1.34

func (s VRFSigner) Sign(msg []byte) []byte

Sign signs a message for VRF purposes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL