use crate::SignerIndex;
use super::AggregateSignatureType;
#[derive(Debug, Clone, thiserror::Error)]
pub enum AggregationError {
#[error("Not enough signatures. Got only {0} out of {1}.")]
NotEnoughSignatures(u64, u64),
#[error("Unsupported proof system: {0}")]
UnsupportedProofSystem(AggregateSignatureType),
#[error("Indices are not unique.")]
IndexNotUnique,
#[error("Missing SNARK signer data for signer index {0}.")]
MissingSnarkSignerData(SignerIndex),
#[error("Missing SNARK signature for lottery index {0}.")]
MissingSnarkSignature(SignerIndex),
}
#[derive(Debug, Clone, thiserror::Error)]
pub enum AggregateSignatureError {
#[error("Invalid bytes")]
SerializationError,
#[error(
"Invalid batch: signatures, aggregate verification keys, message and parameters must have the same length"
)]
BatchInvalid,
#[error("Missing SNARK aggregate verification key")]
MissingSnarkAggregateVerificationKey,
#[error("Missing SNARK clerk for aggregate signature verification")]
MissingSnarkClerk,
#[error("Unsupported proof system: {0}")]
UnsupportedProofSystem(AggregateSignatureType),
#[error("Unknown proof system: {0}")]
UnknownProofSystem(String),
}