Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy committed Jul 8, 2024
1 parent ced8b9c commit c922816
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ pub type CurveConfig<S> = <AffinePoint<S> as AffineRepr>::Config;

pub type HashOutput<S> = digest::Output<<S as Suite>::Hasher>;

/// Verification error(s)
#[derive(Debug)]
pub enum Error {
/// Verification error(s)
VerificationFailure,
/// Bad input data
BadInputData,
}

/// Defines a cipher suite.
Expand Down
4 changes: 2 additions & 2 deletions src/ring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<S>) -> Result<Self, ()> {
pub fn from_srs(ring_size: usize, mut pcs_params: PcsParams<S>) -> Result<Self, Error> {
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);
Expand Down

0 comments on commit c922816

Please sign in to comment.