-
Notifications
You must be signed in to change notification settings - Fork 176
/
signer.go
28 lines (24 loc) · 929 Bytes
/
signer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package module
import (
"github.com/onflow/flow-go/crypto"
)
// Signer is a simple cryptographic signer that can sign a simple message to
// generate a signature, and verify the signature against the message.
type Signer interface {
Verifier
Sign(msg []byte) (crypto.Signature, error)
}
// AggregatingSigner is a signer that can sign a simple message and aggregate
// multiple signatures into a single aggregated signature.
type AggregatingSigner interface {
AggregatingVerifier
Sign(msg []byte) (crypto.Signature, error)
Aggregate(sigs []crypto.Signature) (crypto.Signature, error)
}
// ThresholdSigner is a signer that can sign a message to generate a signature
// share and construct a threshold signature from the given shares.
type ThresholdSigner interface {
ThresholdVerifier
Sign(msg []byte) (crypto.Signature, error)
Combine(size uint, shares []crypto.Signature, indices []uint) (crypto.Signature, error)
}