maidsafe / blsttc

poanetwork/threshold_crypto using supranational/blst for sign+verify
Other
28 stars 20 forks source link

feat: accept Borrow<SignatureShare> for ::combine_signatures() to ease use of Vec<SignatureShare> #32

Closed dan-da closed 3 years ago

dan-da commented 3 years ago

I sometimes have found myself with a Vec<(Fr, SignatureShare)> and trying to pass that to PublicKeySet::combine_signatures doesn't work. Instead, it is necessary to convert it to Vec<Fr, &SignatureShare> first with another loop (or to a BTreeMap).

This PR makes it possible for caller to use either BTreeMap<Fr, SignatureShare> or Vec<(Fr, SignatureShare)> interchangeably.

I changed one of the test cases to use a Vec, so that this usage is tested.

iancoleman commented 3 years ago

LGTM