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(_ hotstuff.ID)
- func (sig Multi[T]) Contains(id hotstuff.ID) bool
- func (sig Multi[T]) ForEach(f func(hotstuff.ID))
- func (sig Multi[T]) Len() int
- func (sig Multi[T]) Participants() hotstuff.IDSet
- func (sig Multi[T]) RangeWhile(f func(hotstuff.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 ¶ added in v0.3.0
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 ¶ added in v0.5.0
BitfieldFromBytes creates a bitfield from the given byte slice.
func (Bitfield) Bytes ¶ added in v0.5.0
Bytes returns the raw byte slice containing the data of this bitfield.
func (Bitfield) RangeWhile ¶ added in v0.5.0
RangeWhile calls f for each ID in the set until f returns false.
type Multi ¶ added in v0.5.0
Multi is a set of (partial) signatures.
func Restore ¶ added in v0.5.0
Restore should only be used to restore an existing threshold signature from a set of signatures.
func (Multi[T]) Participants ¶ added in v0.5.0
Participants returns the IDs of replicas who participated in the threshold signature.
func (Multi[T]) RangeWhile ¶ added in v0.5.0
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. |