tecdsa-core 0.1.2

2PC ECDSA at the cost of 1 OLE: core math and protocols
Documentation
//! Crate-wide error type.
use thiserror::Error;

#[derive(Debug, Error, Clone, Copy, PartialEq, Eq)]
pub enum Error {
    #[error("value out of range")]
    OutOfRange,
    #[error("element is not invertible")]
    NotInvertible,
    #[error("invalid encoding")]
    InvalidEncoding,
    #[error("invalid modulus")]
    InvalidModulus,
    #[error("verification failed")]
    VerificationFailed,
    #[error("parameter sampling failed")]
    Sampling,
    #[error("session timed out")]
    Timeout,
    #[error("secret not found")]
    NotFound,
    #[error("secret store failure")]
    Storage,
}

impl From<crate::rsa::tough::ToughError> for Error {
    fn from(_: crate::rsa::tough::ToughError) -> Self {
        Self::Sampling
    }
}

pub type Result<T> = core::result::Result<T, Error>;