batchsignature

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(d []byte, bs *ccmsg.BatchSignature) (bool, error)

Types

type BatchResidue

type BatchResidue struct {
	// contains filtered or unexported fields
}

TODO: Move this to a protobuf message. TODO: This could probably use a better name; the residue doesn't include the leaf digest. TODO: Add a struct that contains one of these and a signature over the root digest.

func NewDigestTree

func NewDigestTree(leaves [][]byte) ([]byte, []BatchResidue, error)

returns (root-digest, digest-trees, error)

func (*BatchResidue) RootDigest

func (t *BatchResidue) RootDigest() []byte

type BatchSigner

type BatchSigner interface {
	// BatchSign signs single message `d`. Implementations may block for
	// (slightly) longer than a regular signing in order to batch up multiple
	// signature requests.
	BatchSign(d []byte) (*ccmsg.BatchSignature, error)
}

BatchSigner is a scalable message signing interface. Batch signatures include the path and adjacent values from a merkle tree plus the root of the tree - the batch residue. This permits that single message to be verified without the rest of the batch, and for signing to have performed a single asymmetric signing operation that signed all of the messages in the batch. Each signed message receives its own distinct batch signature, as it has a unique batch residue.

func NewTrivialBatchSigner

func NewTrivialBatchSigner(signer ed25519.PrivateKey) (BatchSigner, error)

NewTrivialBatchSigner constructs a BatchSigner which signs messages using the given private key. TrivialBatchSigner always uses a batch size of 1 (and so never blocks to gather more items for the batch).

Jump to

Keyboard shortcuts

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