errors.rs 1.4 KB

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