Trait modular_frost::sign::SignMachine

source ·
pub trait SignMachine<S>: Send + Sync + Sized {
    type Params: Clone;
    type Keys;
    type Preprocess: Clone + PartialEq + Writable;
    type SignatureShare: Clone + PartialEq + Writable;
    type SignatureMachine: SignatureMachine<S, SignatureShare = Self::SignatureShare>;

    // Required methods
    fn cache(self) -> CachedPreprocess;
    fn from_cache(
        params: Self::Params,
        keys: Self::Keys,
        cache: CachedPreprocess,
    ) -> (Self, Self::Preprocess);
    fn read_preprocess<R: Read>(
        &self,
        reader: &mut R,
    ) -> Result<Self::Preprocess>;
    fn sign(
        self,
        commitments: HashMap<Participant, Self::Preprocess>,
        msg: &[u8],
    ) -> Result<(Self::SignatureMachine, Self::SignatureShare), FrostError>;
}
Expand description

Trait for the second machine of a two-round signing protocol.

Required Associated Types§

source

type Params: Clone

Params used to instantiate this machine which can be used to rebuild from a cache.

source

type Keys

Keys used for signing operations.

source

type Preprocess: Clone + PartialEq + Writable

Preprocess message for this machine.

source

type SignatureShare: Clone + PartialEq + Writable

SignatureShare message for this machine.

source

type SignatureMachine: SignatureMachine<S, SignatureShare = Self::SignatureShare>

SignatureMachine this SignMachine turns into.

Required Methods§

source

fn cache(self) -> CachedPreprocess

Cache this preprocess for usage later. This cached preprocess MUST only be used once. Reuse of it enables recovery of your private key share. Third-party recovery of a cached preprocess also enables recovery of your private key share, so this MUST be treated with the same security as your private key share.

source

fn from_cache( params: Self::Params, keys: Self::Keys, cache: CachedPreprocess, ) -> (Self, Self::Preprocess)

Create a sign machine from a cached preprocess. After this, the preprocess must be deleted so it’s never reused. Any reuse will presumably cause the signer to leak their secret share.

source

fn read_preprocess<R: Read>(&self, reader: &mut R) -> Result<Self::Preprocess>

Read a Preprocess message. Despite taking self, this does not save the preprocess. It must be externally cached and passed into sign.

source

fn sign( self, commitments: HashMap<Participant, Self::Preprocess>, msg: &[u8], ) -> Result<(Self::SignatureMachine, Self::SignatureShare), FrostError>

Sign a message. Takes in the participants’ preprocess messages. Returns the signature share to be broadcast to all participants, over an authenticated channel. The parties who participate here will become the signing set for this session.

Object Safety§

This trait is not object safe.

Implementors§