From c922816dff11fb4995f7afdd33d422f7a4a2c914 Mon Sep 17 00:00:00 2001 From: Davide Galassi Date: Mon, 8 Jul 2024 10:12:17 +0200 Subject: [PATCH] Clippy --- src/lib.rs | 4 +++- src/ring.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e6019d8..02f7225 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,10 +51,12 @@ pub type CurveConfig = as AffineRepr>::Config; pub type HashOutput = digest::Output<::Hasher>; -/// Verification error(s) #[derive(Debug)] pub enum Error { + /// Verification error(s) VerificationFailure, + /// Bad input data + BadInputData, } /// Defines a cipher suite. diff --git a/src/ring.rs b/src/ring.rs index ee0b89f..43763e8 100644 --- a/src/ring.rs +++ b/src/ring.rs @@ -173,11 +173,11 @@ where Self::from_srs(ring_size, pcs_params).expect("PCS params is correct") } - pub fn from_srs(ring_size: usize, mut pcs_params: PcsParams) -> Result { + pub fn from_srs(ring_size: usize, mut pcs_params: PcsParams) -> Result { let domain_size = domain_size(ring_size); if pcs_params.powers_in_g1.len() < 3 * domain_size + 1 || pcs_params.powers_in_g2.len() < 2 { - return Err(()); + return Err(Error::BadInputData); } // Keep only the required powers of tau. pcs_params.powers_in_g1.truncate(3 * domain_size + 1);