Skip to content

Commit 8f051f1

Browse files
committed
wip frost signing
1 parent afb2450 commit 8f051f1

9 files changed

Lines changed: 5179 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package frost
2+
3+
type ContributionType uint8
4+
5+
const (
6+
ContributionTypePubNonce ContributionType = iota
7+
ContributionTypeAggNonce
8+
ContributionTypeAggOtherNonce
9+
ContributionTypePSig
10+
)
11+
12+
func (c ContributionType) String() string {
13+
switch c {
14+
case ContributionTypePubNonce:
15+
return "pubnonce"
16+
17+
case ContributionTypeAggOtherNonce:
18+
return "aggothernonce"
19+
20+
case ContributionTypeAggNonce:
21+
return "aggnonce"
22+
23+
case ContributionTypePSig:
24+
return "psig"
25+
26+
default:
27+
return "unknown"
28+
}
29+
}
30+
31+
type ErrInvalidContribution struct {
32+
// SignerIndex is the signer index when the error is due to a known
33+
// signer, or -1 when there's an error due to an aggregated value.
34+
SignerIndex int
35+
36+
// ContributionType is the type of invalid contribution.
37+
ContributionType
38+
}
39+
40+
func (e ErrInvalidContribution) Error() string {
41+
return "Invalid contribution"
42+
}

0 commit comments

Comments
 (0)