Documentation
¶
Overview ¶
Package crypto provides implementations of the Crypto interface.
Index ¶
- Variables
- func New(impl modules.CryptoBase) modules.Crypto
- func NewCache(impl modules.CryptoBase, capacity int) modules.Crypto
- type Bitfield
- type Multi
- func (sig Multi[T]) Add(_ consbench.ID)
- func (sig Multi[T]) Contains(id consbench.ID) bool
- func (sig Multi[T]) ForEach(f func(consbench.ID))
- func (sig Multi[T]) Len() int
- func (sig Multi[T]) Participants() consbench.IDSet
- func (sig Multi[T]) RangeWhile(f func(consbench.ID) bool)
- func (sig Multi[T]) String() string
- func (sig Multi[T]) ToBytes() []byte
- type Signature
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCombineMultiple is used when Combine is called with less than two signatures. ErrCombineMultiple = errors.New("must have at least two signatures") // ErrCombineOverlap is used when Combine is called with signatures that have overlapping participation. ErrCombineOverlap = errors.New("overlapping signatures") )
Functions ¶
Types ¶
type Bitfield ¶
type Bitfield struct {
// contains filtered or unexported fields
}
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 BitfieldFromBytes ¶
BitfieldFromBytes creates a bitfield from the given byte slice.
func (Bitfield) RangeWhile ¶
RangeWhile calls f for each ID in the set until f returns false.
type Multi ¶
Multi is a set of (partial) signatures.
func Restore ¶
Restore should only be used to restore an existing threshold signature from a set of signatures.
func (Multi[T]) Participants ¶
Participants returns the IDs of replicas who participated in the threshold signature.
func (Multi[T]) RangeWhile ¶
RangeWhile calls f for each ID in the set until f returns false.
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 implements the spec-k256 curve signature.
|
Package ecdsa implements the spec-k256 curve signature. |
Package eddsa implements the ed25519 curve signature.
|
Package eddsa implements the ed25519 curve signature. |
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. |