-
Notifications
You must be signed in to change notification settings - Fork 177
/
signer.go
32 lines (27 loc) · 1.01 KB
/
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
29
30
31
32
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)
Reconstruct(size uint, shares []crypto.Signature, indices []uint) (crypto.Signature, error)
}
type ThresholdSignerStore interface {
GetThresholdSigner(view uint64) (ThresholdSigner, error)
}