You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
994 B

4 years ago
4 years ago
4 years ago
  1. use core::fmt::Debug;
  2. use thiserror::Error;
  3. #[derive(Error, Debug)]
  4. pub enum ProofVerifyError {
  5. #[error("Proof verification failed")]
  6. InternalError,
  7. #[error("Compressed group element failed to decompress: {0:?}")]
  8. DecompressionError(Vec<u8>),
  9. }
  10. impl Default for ProofVerifyError {
  11. fn default() -> Self {
  12. ProofVerifyError::InternalError
  13. }
  14. }
  15. #[derive(Clone, Debug, Eq, PartialEq)]
  16. pub enum R1CSError {
  17. /// returned if the number of constraints is not a power of 2
  18. NonPowerOfTwoCons,
  19. /// returned if the number of variables is not a power of 2
  20. NonPowerOfTwoVars,
  21. /// returned if a wrong number of inputs in an assignment are supplied
  22. InvalidNumberOfInputs,
  23. /// returned if a wrong number of variables in an assignment are supplied
  24. InvalidNumberOfVars,
  25. /// returned if a [u8;32] does not parse into a valid Scalar in the field of ristretto255
  26. InvalidScalar,
  27. /// returned if the supplied row or col in (row,col,val) tuple is out of range
  28. InvalidIndex,
  29. }