solana_zk_sdk/
errors.rs

1//! Errors related to proving and verifying proofs.
2use thiserror::Error;
3
4#[derive(Error, Clone, Debug, Eq, PartialEq)]
5pub enum AuthenticatedEncryptionError {
6    #[error("key derivation method not supported")]
7    DerivationMethodNotSupported,
8    #[error("seed length too short for derivation")]
9    SeedLengthTooShort,
10    #[error("seed length too long for derivation")]
11    SeedLengthTooLong,
12    #[error("failed to deserialize")]
13    Deserialization,
14}
15
16#[derive(Error, Clone, Debug, Eq, PartialEq)]
17pub enum ElGamalError {
18    #[error("key derivation method not supported")]
19    DerivationMethodNotSupported,
20    #[error("seed length too short for derivation")]
21    SeedLengthTooShort,
22    #[error("seed length too long for derivation")]
23    SeedLengthTooLong,
24    #[error("failed to deserialize ciphertext")]
25    CiphertextDeserialization,
26    #[error("failed to deserialize public key")]
27    PubkeyDeserialization,
28    #[error("failed to deserialize keypair")]
29    KeypairDeserialization,
30    #[error("failed to deserialize secret key")]
31    SecretKeyDeserialization,
32}
33
34#[derive(Error, Clone, Debug, Eq, PartialEq)]
35pub enum TranscriptError {
36    #[error("point is the identity")]
37    ValidationError,
38}
39
40#[derive(Error, Debug, Clone, Eq, PartialEq)]
41pub enum ParseError {
42    #[error("String is the wrong size")]
43    WrongSize,
44    #[error("Invalid Base64 string")]
45    Invalid,
46}