use thiserror::Error;
use crypto_core::{AeadAlgorithm, Algorithm, CryptoError, HashAlgorithm, MacAlgorithm};
#[derive(Debug, Error)]
pub enum AlgorithmError {
#[error("unsupported algorithm: {0}")]
UnsupportedAlgorithm(Algorithm),
#[error("unsupported AEAD algorithm: {0}")]
UnsupportedAeadAlgorithm(AeadAlgorithm),
#[error("unsupported hash algorithm: {0}")]
UnsupportedHashAlgorithm(HashAlgorithm),
#[error("unsupported MAC algorithm: {0}")]
UnsupportedMacAlgorithm(MacAlgorithm),
#[error("invalid key for algorithm: {0}")]
InvalidKey(Algorithm),
#[error("signature verification failed for {0}")]
SignatureInvalid(Algorithm),
#[error(transparent)]
Crypto(#[from] CryptoError),
}