use thiserror::Error;

#[derive(Debug, Error)]
pub enum KtError {
    #[error("leaf index {index} is out of range for tree size {tree_size}")]
    IndexOutOfRange { index: u64, tree_size: u64 },

    #[error("inclusion proof verification failed: root mismatch")]
    RootMismatch,

    #[error("serialisation error: {0}")]
    Serialisation(String),

    #[error("identity key is already revoked")]
    AlreadyRevoked,
}
