multi_party_ecdsa/
lib.rs

1/*
2    Multi-party ECDSA
3
4    Copyright 2018 by Kzen Networks
5
6    This file is part of Multi-party ECDSA library
7    (https://github.com/KZen-networks/multi-party-ecdsa)
8
9    Multi-party ECDSA is free software: you can redistribute
10    it and/or modify it under the terms of the GNU General Public
11    License as published by the Free Software Foundation, either
12    version 3 of the License, or (at your option) any later version.
13
14    @license GPL-3.0+ <https://github.com/KZen-networks/multi-party-ecdsa/blob/master/LICENSE>
15*/
16
17#![allow(clippy::many_single_char_names)]
18#![allow(clippy::too_many_arguments)]
19#![allow(clippy::type_complexity)]
20
21pub mod protocols;
22pub mod utilities;
23use std::fmt;
24
25#[derive(Copy, PartialEq, Eq, Clone, Debug)]
26pub enum Error {
27    InvalidKey,
28    InvalidSS,
29    InvalidCom,
30    InvalidSig,
31    Phase5BadSum,
32    Phase6Error,
33}
34
35impl fmt::Display for Error {
36    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
37        use Error::*;
38        match *self {
39            InvalidKey => write!(f, "InvalidKey"),
40            InvalidSS => write!(f, "InvalidSS"),
41            InvalidCom => write!(f, "InvalidCom"),
42            InvalidSig => write!(f, "InvalidSig"),
43            Phase5BadSum => write!(f, "Phase5BadSum"),
44            Phase6Error => write!(f, "Phase6Error"),
45        }
46    }
47}