decaf377/error.rs
1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2pub enum EncodingError {
3 InvalidEncoding,
4 InvalidSliceLength,
5}
6
7impl core::fmt::Display for EncodingError {
8 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9 let msg = match self {
10 Self::InvalidEncoding => "Invalid Decaf377 encoding",
11 Self::InvalidSliceLength => "Invalid length bytes in encoded point",
12 };
13
14 msg.fmt(f)
15 }
16}