coconut_crypto/proof/signature_pok/
error.rs

1use super::super::MessageUnpackingError;
2use alloc::string::String;
3
4use crate::PSError;
5
6// TODO replace by `SchnorrError` when it will derive `Eq`, `PartialEq`, `Clone`
7type SchnorrError = String;
8
9/// An error originated from `SignaturePoK`.
10#[derive(Debug, Clone, PartialEq, Eq)]
11pub enum SignaturePoKError {
12    MessageInputError(MessageUnpackingError),
13    RevealedIndicesMustBeUniqueAndSorted { previous: usize, current: usize },
14    SchnorrError(SchnorrError),
15    SignatureError(PSError),
16}
17
18impl From<MessageUnpackingError> for SignaturePoKError {
19    fn from(err: MessageUnpackingError) -> Self {
20        Self::MessageInputError(err)
21    }
22}