mithril_stm/protocol/aggregate_signature/
error.rs1use crate::SignerIndex;
2
3use super::AggregateSignatureType;
4
5#[derive(Debug, Clone, thiserror::Error)]
7pub enum AggregationError {
8 #[error("Not enough signatures. Got only {0} out of {1}.")]
10 NotEnoughSignatures(u64, u64),
11
12 #[error("Unsupported proof system: {0}")]
13 UnsupportedProofSystem(AggregateSignatureType),
14
15 #[error("Indices are not unique.")]
17 IndexNotUnique,
18
19 #[error("Missing SNARK signer data for signer index {0}.")]
21 MissingSnarkSignerData(SignerIndex),
22
23 #[error("Missing SNARK signature for lottery index {0}.")]
25 MissingSnarkSignature(SignerIndex),
26}
27
28#[derive(Debug, Clone, thiserror::Error)]
30pub enum AggregateSignatureError {
31 #[error("Invalid bytes")]
33 SerializationError,
34
35 #[error(
37 "Invalid batch: signatures, aggregate verification keys, message and parameters must have the same length"
38 )]
39 BatchInvalid,
40
41 #[error("Missing SNARK aggregate verification key")]
43 MissingSnarkAggregateVerificationKey,
44
45 #[error("Missing SNARK clerk for aggregate signature verification")]
47 MissingSnarkClerk,
48
49 #[error("Unsupported proof system: {0}")]
51 UnsupportedProofSystem(AggregateSignatureType),
52
53 #[error("Unknown proof system: {0}")]
55 UnknownProofSystem(String),
56}