-
Notifications
You must be signed in to change notification settings - Fork 176
/
merger.go
23 lines (21 loc) · 1.05 KB
/
merger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package module
import (
"github.com/onflow/flow-go/crypto"
)
// Merger is responsible for combining two signatures, but it must be done
// in a cryptographically unaware way (agnostic of the byte structure of the
// signatures). However, the merger has an internal notion of the expected
// length of each signature and errors in case the inputs have incompatible
// length.
type Merger interface {
// Join concatenates the provided signatures. The merger has an internal notion
// of the expected length of each signature. It returns the sentinel error
// `verification.ErrInvalidFormat` if one of the signatures does not conform
// to the expected byte length.
Join(sig1, sig2 crypto.Signature) ([]byte, error)
// Split separates the concatenated signature into its two components. The
// merger has an internal notion of the expected byte length of each
// signature. It returns the sentinel error `verification.ErrInvalidFormat`
// if either signatures does not conform to the expected length.
Split(combined []byte) (crypto.Signature, crypto.Signature, error)
}