ps-hash-core 0.1.0-25

Core hashing primitives for ps-hash.
Documentation
#![allow(clippy::module_name_repetitions)]

use ps_ecc::{RSDecodeError, RSGenerateParityError};
use thiserror::Error;

#[derive(Clone, Debug, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum HashError {
    #[error(transparent)]
    RSGenerateParityError(#[from] RSGenerateParityError),
    #[error("The digest is all zeros")]
    ZeroDigest,
}

#[derive(Clone, Debug, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum HashValidationError {
    #[error("Invalid Hash length: {0}")]
    InvalidLength(usize),
    #[error(transparent)]
    RSDecodeError(#[from] RSDecodeError),
    #[error("The digest is all zeros")]
    ZeroDigest,
}