pub trait Aggregator:
Clone
+ Debug
+ PartialEq {
// Required methods
fn new(num_keys: u32, threshold: u32) -> Self;
fn init(
&mut self,
poly_comms: &HashMap<u32, PolyCommitment>,
) -> Result<(), AggregatorError>;
fn sign(
&mut self,
msg: &[u8],
nonces: &[PublicNonce],
sig_shares: &[SignatureShare],
key_ids: &[u32],
) -> Result<Signature, AggregatorError>;
fn sign_schnorr(
&mut self,
msg: &[u8],
nonces: &[PublicNonce],
sig_shares: &[SignatureShare],
key_ids: &[u32],
) -> Result<SchnorrProof, AggregatorError>;
fn sign_taproot(
&mut self,
msg: &[u8],
nonces: &[PublicNonce],
sig_shares: &[SignatureShare],
key_ids: &[u32],
merkle_root: Option<MerkleRoot>,
) -> Result<SchnorrProof, AggregatorError>;
}Expand description
A trait which provides a common Aggregator interface for v1 and v2
Required Methods§
Sourcefn new(num_keys: u32, threshold: u32) -> Self
fn new(num_keys: u32, threshold: u32) -> Self
Construct an Aggregator with the passed parameters
Sourcefn init(
&mut self,
poly_comms: &HashMap<u32, PolyCommitment>,
) -> Result<(), AggregatorError>
fn init( &mut self, poly_comms: &HashMap<u32, PolyCommitment>, ) -> Result<(), AggregatorError>
Initialize an Aggregator with the passed polynomial commitments
Sourcefn sign(
&mut self,
msg: &[u8],
nonces: &[PublicNonce],
sig_shares: &[SignatureShare],
key_ids: &[u32],
) -> Result<Signature, AggregatorError>
fn sign( &mut self, msg: &[u8], nonces: &[PublicNonce], sig_shares: &[SignatureShare], key_ids: &[u32], ) -> Result<Signature, AggregatorError>
Check and aggregate the signature shares into a FROST Signature
Sourcefn sign_schnorr(
&mut self,
msg: &[u8],
nonces: &[PublicNonce],
sig_shares: &[SignatureShare],
key_ids: &[u32],
) -> Result<SchnorrProof, AggregatorError>
fn sign_schnorr( &mut self, msg: &[u8], nonces: &[PublicNonce], sig_shares: &[SignatureShare], key_ids: &[u32], ) -> Result<SchnorrProof, AggregatorError>
Check and aggregate the signature shares into a BIP-340 SchnorrProof.
https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
Sourcefn sign_taproot(
&mut self,
msg: &[u8],
nonces: &[PublicNonce],
sig_shares: &[SignatureShare],
key_ids: &[u32],
merkle_root: Option<MerkleRoot>,
) -> Result<SchnorrProof, AggregatorError>
fn sign_taproot( &mut self, msg: &[u8], nonces: &[PublicNonce], sig_shares: &[SignatureShare], key_ids: &[u32], merkle_root: Option<MerkleRoot>, ) -> Result<SchnorrProof, AggregatorError>
Check and aggregate the signature shares into a BIP-340 SchnorrProof with BIP-341 key tweaks
https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.