Derive thiserror::Error for ProofError
This commit is contained in:
parent
2c51288afd
commit
88ce934bd7
|
@ -1,19 +1,20 @@
|
||||||
//! Errors related to proving and verifying proofs.
|
//! Errors related to proving and verifying proofs.
|
||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Error, Clone, Debug, Eq, PartialEq)]
|
||||||
pub enum ProofError {
|
pub enum ProofError {
|
||||||
/// This error occurs when a proof failed to verify.
|
#[error("proof failed to verify")]
|
||||||
VerificationError,
|
VerificationError,
|
||||||
/// This error occurs when the proof encoding is malformed.
|
#[error("malformed proof")]
|
||||||
FormatError,
|
FormatError,
|
||||||
/// This error occurs during proving if the number of blinding
|
#[error("number of blinding factors do not match the number of values")]
|
||||||
/// factors does not match the number of values.
|
|
||||||
WrongNumBlindingFactors,
|
WrongNumBlindingFactors,
|
||||||
/// This error occurs when attempting to create a proof with
|
#[error("attempted to create a proof with bitsize other than \\(8\\), \\(16\\), \\(32\\), or \\(64\\)")]
|
||||||
/// bitsize other than \\(8\\), \\(16\\), \\(32\\), or \\(64\\).
|
|
||||||
InvalidBitsize,
|
InvalidBitsize,
|
||||||
/// This error occurs when there are insufficient generators for the proof.
|
#[error("insufficient generators for the proof")]
|
||||||
InvalidGeneratorsLength,
|
InvalidGeneratorsLength,
|
||||||
/// This error occurs a `zk_token_elgamal::pod::ElGamalCiphertext` contains invalid ElGamalCiphertext ciphertext
|
#[error(
|
||||||
|
"`zk_token_elgamal::pod::ElGamalCiphertext` contains invalid ElGamalCiphertext ciphertext"
|
||||||
|
)]
|
||||||
InconsistentCTData,
|
InconsistentCTData,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue