signers

package
v0.0.0-...-f0b6488 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	ToSigner(pk []byte) (Signer, error)
}

Adapter represents a signer adapter

func NewAdapter

func NewAdapter() Adapter

NewAdapter creates a new adapter

type Factory

type Factory interface {
	Create() Signer
}

Factory represents a signer factory

func NewFactory

func NewFactory() Factory

NewFactory creates a new factory

type PublicKey

type PublicKey interface {
	Point() kyber.Point
	Equals(pubKey PublicKey) bool
	Bytes() ([]byte, error)
}

PublicKey represents the public key

type PublicKeyAdapter

type PublicKeyAdapter interface {
	ToPublicKey(pubKey []byte) (PublicKey, error)
}

PublicKeyAdapter represents a publicKey adapter

func NewPublicKeyAdapter

func NewPublicKeyAdapter() PublicKeyAdapter

NewPublicKeyAdapter creates a new public key adapter

type Signature

type Signature interface {
	PublicKey(msg []byte) (PublicKey, error)
	Verify() bool
	Bytes() ([]byte, error)
}

Signature represents a signature

type SignatureAdapter

type SignatureAdapter interface {
	ToSignature(bytes []byte) (Signature, error)
}

SignatureAdapter represents a signature adapter

func NewSignatureAdapter

func NewSignatureAdapter() SignatureAdapter

NewSignatureAdapter creates a new signature adapter

type Signer

type Signer interface {
	PublicKey() PublicKey
	Sign(msg []byte) (Signature, error)
	Vote(msg []byte, ring []PublicKey) (Vote, error)
	Bytes() ([]byte, error)
}

Signer represents a signer

type Vote

type Vote interface {
	Ring() []PublicKey
	Verify(msg []byte) bool
	Bytes() ([]byte, error)
}

Vote represents a vote

type VoteAdapter

type VoteAdapter interface {
	ToVote(bytes []byte) (Vote, error)
	ToVerification(vote Vote, msg []byte, pubKeyHashes []hash.Hash) (bool, error)
}

VoteAdapter represents a vote adapter

func NewVoteAdapter

func NewVoteAdapter() VoteAdapter

NewVoteAdapter creates a new vote adapter

Jump to

Keyboard shortcuts

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