Aggregator

Trait Aggregator 

Source
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§

Source

fn new(num_keys: u32, threshold: u32) -> Self

Construct an Aggregator with the passed parameters

Source

fn init( &mut self, poly_comms: &HashMap<u32, PolyCommitment>, ) -> Result<(), AggregatorError>

Initialize an Aggregator with the passed polynomial commitments

Source

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

Source

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

Source

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.

Implementors§