Documentation
¶
Overview ¶
Package ecdsa provides a crypto implementation for HotStuff using Go's 'crypto/ecdsa' package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrHashMismatch = fmt.Errorf("certificate hash does not match block hash")
ErrHashMismatch is the error used when a partial certificate hash does not match the hash of a block.
var ErrPartialDuplicate = fmt.Errorf("cannot add more than one signature per replica")
ErrPartialDuplicate is the error used when two or more signatures were created by the same replica.
Functions ¶
Types ¶
type PartialCert ¶
type PartialCert struct {
// contains filtered or unexported fields
}
PartialCert is an ECDSA signature and the hash that was signed.
func NewPartialCert ¶
func NewPartialCert(signature *Signature, hash hotstuff.Hash) *PartialCert
NewPartialCert initializes a PartialCert struct from the given values.
func (PartialCert) BlockHash ¶
func (cert PartialCert) BlockHash() hotstuff.Hash
BlockHash returns the hash of the block that was signed.
func (PartialCert) Signature ¶
func (cert PartialCert) Signature() hotstuff.Signature
Signature returns the signature.
func (PartialCert) String ¶
func (cert PartialCert) String() string
func (PartialCert) ToBytes ¶
func (cert PartialCert) ToBytes() []byte
ToBytes returns a byte representation of the partial certificate.
type PrivateKey ¶
type PrivateKey struct {
*ecdsa.PrivateKey
}
PrivateKey is an ECDSA private key.
This struct wraps the regular ecdsa.PrivateKey in order to implement the hotstuff.PrivateKey interface.
func (PrivateKey) PublicKey ¶
func (pk PrivateKey) PublicKey() hotstuff.PublicKey
PublicKey returns the public key associated with the private key
type QuorumCert ¶
type QuorumCert struct {
// contains filtered or unexported fields
}
QuorumCert is a set of signature that form a quorum certificate for a block.
func NewQuorumCert ¶
NewQuorumCert initializes a new QuorumCert struct from the given values.
func (QuorumCert) BlockHash ¶
func (qc QuorumCert) BlockHash() hotstuff.Hash
BlockHash returns the hash of the block for which the certificate was created.
func (QuorumCert) Signatures ¶
func (qc QuorumCert) Signatures() map[hotstuff.ID]*Signature
Signatures returns the signatures within the quorum certificate.
func (QuorumCert) String ¶
func (qc QuorumCert) String() string
func (QuorumCert) ToBytes ¶
func (qc QuorumCert) ToBytes() []byte
ToBytes returns a byte representation of the quorum certificate.