Skip to main content

bls_sig_cli/
errors.rs

1use ark_ec::hashing::HashToCurveError;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum KeyValidationError {
6    #[error("Point is not on the curve.")]
7    NotOnCurve,
8    #[error("Point cannot be the identity.")]
9    Identity,
10    #[error("Point is not in the correct subgroup.")]
11    WrongSubgroup,
12}
13
14#[derive(Debug, Error)]
15pub enum SignatureError {
16    #[error("Problem with hashing the message.")]
17    HashError(#[from] HashToCurveError),
18    #[error("Signature deserialization failed.")]
19    InvalidSignature,
20    #[error("Signature is not in the correct subgroup.")]
21    InvalidSignatureSubgroup,
22    #[error("Public key is invalid.")]
23    InvalidPublicKey(#[from] KeyValidationError),
24    #[error("Pairing mismatch.")]
25    InvalidSignaturePairing,
26}