kyber_rs/share/vss/
error.rs

1use thiserror::Error;
2
3use crate::{
4    dh::DhError, encoding::MarshallingError, share::poly::PolyError, sign::error::SignatureError,
5};
6
7#[derive(Debug, Error)]
8pub enum VSSError {
9    #[error("marshalling error")]
10    MarshallingError(#[from] MarshallingError),
11    #[error("dh error")]
12    DhError(#[from] DhError),
13    #[error("signature error")]
14    SignatureError(#[from] SignatureError),
15    #[error("polynomial error")]
16    PolyError(#[from] PolyError),
17    #[error("io error")]
18    IoError(#[from] std::io::Error),
19    #[error("invalid threshold")]
20    InvalidThreshold(String),
21    #[error("wrong index to generate encrypted deal")]
22    DealerWrongIndex,
23    #[error("receiving inconsistent sessionID in response")]
24    ResponseInconsistentSessionId,
25    #[error("index out of bounds in response")]
26    ResponseIndexOutOfBounds,
27    #[error("index out of bounds in complaint")]
28    ComplaintIndexOutOfBounds,
29    #[error("already existing response from same origin")]
30    ResponseAlreadyExisting,
31    #[error("missing aggregator")]
32    MissingAggregator,
33    #[error("no aggregator for verifier")]
34    NoAggregatorForVerifier,
35    #[error("public key not found in the list of verifiers")]
36    PublicKeyNotFound,
37    #[error("verifier got wrong index from deal")]
38    DealWrongIndex,
39    #[error("verifier already received a deal")]
40    DealAlreadyProcessed,
41    #[error("share does not verify against commitments in deal")]
42    DealDoesNotVerify,
43    #[error("invalid t received in deal")]
44    DealInvalidThreshold,
45    #[error("incompatible threshold - potential attack")]
46    DealIncompatibleThreshold,
47    #[error("found different sessionIDs from deal")]
48    DealInvalidSessionId,
49    #[error("not the same index for f and g share in deal")]
50    DealInconsistentIndex,
51    #[error("index out of bounds in deal")]
52    DealIndexOutOfBounds,
53    #[error("index out of bounds in justification")]
54    JustificationIndexOutOfBounds,
55    #[error("no complaints received for this justification")]
56    JustificationNoComplaints,
57    #[error("justification received for an approval")]
58    JustificationForApproval,
59    #[error("all deals need to have same session id")]
60    DealsSameID,
61}