elliptic_curve/error.rs
1//! Error type.
2
3use core::fmt::{self, Display};
4
5/// Result type.
6pub type Result<T> = core::result::Result<T, Error>;
7
8/// Elliptic curve errors.
9#[derive(Copy, Clone, Debug, Eq, PartialEq)]
10pub struct Error;
11
12impl Display for Error {
13 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14 f.write_str("crypto error")
15 }
16}
17
18#[cfg(feature = "pkcs8")]
19impl From<pkcs8::Error> for Error {
20 fn from(_: pkcs8::Error) -> Error {
21 Error
22 }
23}
24
25#[cfg(feature = "std")]
26impl std::error::Error for Error {}