Documentation ¶
Overview ¶
Package ed25519consensus implements Ed25519 verification according to ZIP215.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchVerifier ¶
type BatchVerifier struct {
// contains filtered or unexported fields
}
BatchVerifier accumulates batch entries with Add, before performing batch verification with Verify.
func NewBatchVerifier ¶
func NewBatchVerifier() BatchVerifier
NewBatchVerifier creates an empty BatchVerifier.
func NewPreallocatedBatchVerifier ¶ added in v0.2.0
func NewPreallocatedBatchVerifier(size int) BatchVerifier
NewPreallocatedBatchVerifier creates a new BatchVerifier with a preallocated capacity. If you know the size of the batch you plan to create ahead of time, this can prevent needless memory copies.
func (*BatchVerifier) Add ¶
func (v *BatchVerifier) Add(publicKey ed25519.PublicKey, message, sig []byte)
Add adds a (public key, message, sig) triple to the current batch. It retains no reference to the inputs.
func (*BatchVerifier) Verify ¶
func (v *BatchVerifier) Verify() bool
Verify checks all entries in the current batch, returning true if all entries are valid and false if any one entry is invalid.
If a failure arises it is unknown which entry failed, the caller must verify each entry individually.
Calling Verify on an empty batch returns false.