pub struct SigningSession { /* private fields */ }Expand description
A FROST signing session.
Manages the two-round signing protocol state and collected data.
Implementations§
Source§impl SigningSession
impl SigningSession
Sourcepub fn new(message: Vec<u8>, threshold: u16) -> Result<Self>
pub fn new(message: Vec<u8>, threshold: u16) -> Result<Self>
Create a new signing session. Returns Err (rather than panicking) if the
CSPRNG health check fails, so a broken RNG cannot crash the caller.
Sourcepub fn session_id(&self) -> &[u8; 32]
pub fn session_id(&self) -> &[u8; 32]
The session ID.
Sourcepub fn state(&self) -> SessionState
pub fn state(&self) -> SessionState
The current session state.
Sourcepub fn generate_commitment(
&mut self,
key_package: &KeyPackage,
) -> Result<SigningCommitments>
pub fn generate_commitment( &mut self, key_package: &KeyPackage, ) -> Result<SigningCommitments>
Generate our commitment (round 1). Must not have been called before.
Sourcepub fn add_commitment(
&mut self,
id: Identifier,
commitment: SigningCommitments,
) -> Result<()>
pub fn add_commitment( &mut self, id: Identifier, commitment: SigningCommitments, ) -> Result<()>
Add another participant’s commitment.
Sourcepub fn commitments_needed(&self) -> usize
pub fn commitments_needed(&self) -> usize
Commitments still needed to reach threshold.
Generate our signature share (round 2).
Add another participant’s signature share. Returns the aggregated signature when threshold is met.
Signature shares still needed to reach threshold.
Sourcepub fn signature_bytes(&self) -> Result<Option<[u8; 64]>>
pub fn signature_bytes(&self) -> Result<Option<[u8; 64]>>
The signature bytes, if signing is complete.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true if signing completed successfully.
Trait Implementations§
Source§impl Drop for SigningSession
impl Drop for SigningSession
Auto Trait Implementations§
impl Forget for SigningSession
impl Freeze for SigningSession
impl Move for SigningSession
impl RefUnwindSafe for SigningSession
impl Send for SigningSession
impl Sync for SigningSession
impl Unpin for SigningSession
impl UnsafeUnpin for SigningSession
impl UnwindSafe for SigningSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more