crypto

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package crypto provides implementations of the Crypto interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrHashMismatch is the error used when a partial certificate hash does not match the hash of a block.
	ErrHashMismatch = fmt.Errorf("certificate hash does not match block hash")

	// ErrPartialDuplicate is the error used when two or more signatures were created by the same replica.
	ErrPartialDuplicate = fmt.Errorf("cannot add more than one signature per replica")

	// ErrViewMismatch is the error used when timeouts have different views.
	ErrViewMismatch = fmt.Errorf("timeout views do not match")

	// ErrNotAQuorum is the error used when a quorum is not reached.
	ErrNotAQuorum = fmt.Errorf("not a quorum")

	// ErrWrongType is the error used when an incompatible type is encountered.
	ErrWrongType = fmt.Errorf("incompatible type")
)

Functions

func New added in v0.3.0

New returns a new base implementation of the Crypto interface. It will use the given CryptoImpl to create and verify signatures.

func NewCache added in v0.3.0

func NewCache(impl consensus.CryptoImpl, capacity int) consensus.Crypto

NewCache returns a new Crypto implementation that caches the results of the operations of the given CryptoImpl implementation.

Types

type Bitfield added in v0.3.0

type Bitfield []byte

Bitfield is an IDSet implemented by a bitfield. To check if an ID 'i' is present in the set, we simply check if the bit at i-1 is set (because IDs start at 1). This scales poorly if IDs are not sequential.

func (*Bitfield) Add added in v0.3.0

func (bm *Bitfield) Add(id hotstuff.ID)

Add adds an ID to the set.

func (*Bitfield) Contains added in v0.3.0

func (bm *Bitfield) Contains(id hotstuff.ID) bool

Contains returns true if the set contains the ID.

func (*Bitfield) ForEach added in v0.3.0

func (bm *Bitfield) ForEach(f func(hotstuff.ID))

ForEach calls f for each ID in the set.

Directories

Path Synopsis
Package bls12 implements the crypto primitives used by HotStuff using curve BLS12-381.
Package bls12 implements the crypto primitives used by HotStuff using curve BLS12-381.
Package ecdsa provides a crypto implementation for HotStuff using Go's 'crypto/ecdsa' package.
Package ecdsa provides a crypto implementation for HotStuff using Go's 'crypto/ecdsa' package.
Package keygen provides helper methods for generating, serializing, and deserializing public keys, private keys and certificates.
Package keygen provides helper methods for generating, serializing, and deserializing public keys, private keys and certificates.

Jump to

Keyboard shortcuts

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