decaf377/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EncodingError {
    InvalidEncoding,
    InvalidSliceLength,
}

impl core::fmt::Display for EncodingError {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        let msg = match self {
            Self::InvalidEncoding => "Invalid Decaf377 encoding",
            Self::InvalidSliceLength => "Invalid length bytes in encoded point",
        };

        msg.fmt(f)
    }
}