1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
trait NOfNSecretSharing {
    type Plaintext;
    type Share;

    fn share(plaintext: &Self::Plaintext, share_count: usize) -> Vec<Self::Share>;

    fn combine(shares: &[Self::Share]) -> Self::Plaintext;
}

trait TOfNSecretSharing {
    type Plaintext;
    type Share;

    fn share(plaintext: &Self::Plaintext, threshold: usize, share_count: usize)
        -> Vec<Self::Share>;

    fn combine(shares: &[Self::Share]) -> Self::Plaintext;
}