From 346acdf893b41abba50eacf721e4220d4a39e94b Mon Sep 17 00:00:00 2001 From: Giacomo Fenzi Date: Fri, 29 Nov 2024 15:16:25 +0100 Subject: [PATCH] fix clippy --- nimue/src/arthur.rs | 6 +++--- nimue/src/plugins/ark/iopattern.rs | 2 +- nimue/src/plugins/ark/reader.rs | 10 +++++----- nimue/src/plugins/ark/writer.rs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nimue/src/arthur.rs b/nimue/src/arthur.rs index 97611b7..07b1416 100644 --- a/nimue/src/arthur.rs +++ b/nimue/src/arthur.rs @@ -62,7 +62,7 @@ impl<'a, U: Unit, H: DuplexHash> Arthur<'a, H, U> { } } -impl<'a, H: DuplexHash, U: Unit> UnitTranscript for Arthur<'a, H, U> { +impl, U: Unit> UnitTranscript for Arthur<'_, H, U> { /// Add native elements to the sponge without writing them to the protocol transcript. #[inline] fn public_units(&mut self, input: &[U]) -> Result<(), IOPatternError> { @@ -76,13 +76,13 @@ impl<'a, H: DuplexHash, U: Unit> UnitTranscript for Arthur<'a, H, U> { } } -impl<'a, H: DuplexHash, U: Unit> core::fmt::Debug for Arthur<'a, H, U> { +impl, U: Unit> core::fmt::Debug for Arthur<'_, H, U> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { f.debug_tuple("Arthur").field(&self.safe).finish() } } -impl<'a, H: DuplexHash> ByteReader for Arthur<'a, H, u8> { +impl> ByteReader for Arthur<'_, H, u8> { /// Read the next `input.len()` bytes from the transcript and return them. #[inline] fn fill_next_bytes(&mut self, input: &mut [u8]) -> Result<(), IOPatternError> { diff --git a/nimue/src/plugins/ark/iopattern.rs b/nimue/src/plugins/ark/iopattern.rs index 469904d..37fe077 100644 --- a/nimue/src/plugins/ark/iopattern.rs +++ b/nimue/src/plugins/ark/iopattern.rs @@ -55,7 +55,7 @@ where fn challenge_bytes(self, count: usize, label: &str) -> Self { let n = crate::plugins::random_bits_in_random_modp(Fp::::MODULUS) / 8; - self.squeeze((count + n - 1) / n, label) + self.squeeze(count.div_ceil(n), label) } } diff --git a/nimue/src/plugins/ark/reader.rs b/nimue/src/plugins/ark/reader.rs index fb1ce57..10c9c1a 100644 --- a/nimue/src/plugins/ark/reader.rs +++ b/nimue/src/plugins/ark/reader.rs @@ -9,7 +9,7 @@ use super::{FieldReader, GroupReader}; use crate::traits::*; use crate::{Arthur, DuplexHash, ProofResult}; -impl<'a, F, H> FieldReader for Arthur<'a, H> +impl FieldReader for Arthur<'_, H> where F: Field, H: DuplexHash, @@ -25,7 +25,7 @@ where } } -impl<'a, G, H> GroupReader for Arthur<'a, H> +impl GroupReader for Arthur<'_, H> where G: CurveGroup, H: DuplexHash, @@ -42,7 +42,7 @@ where } } -impl<'a, H, C, const N: usize> FieldReader> for Arthur<'a, H, Fp> +impl FieldReader> for Arthur<'_, H, Fp> where C: FpConfig, H: DuplexHash>, @@ -53,7 +53,7 @@ where } } -impl<'a, P, H, C, const N: usize> GroupReader> for Arthur<'a, H, Fp> +impl GroupReader> for Arthur<'_, H, Fp> where C: FpConfig, H: DuplexHash>, @@ -69,7 +69,7 @@ where } } -impl<'a, P, H, C, const N: usize> GroupReader> for Arthur<'a, H, Fp> +impl GroupReader> for Arthur<'_, H, Fp> where C: FpConfig, H: DuplexHash>, diff --git a/nimue/src/plugins/ark/writer.rs b/nimue/src/plugins/ark/writer.rs index 1742986..74d319d 100644 --- a/nimue/src/plugins/ark/writer.rs +++ b/nimue/src/plugins/ark/writer.rs @@ -75,7 +75,7 @@ where } } -impl<'a, H, C, const N: usize> ByteReader for Arthur<'a, H, Fp> +impl ByteReader for Arthur<'_, H, Fp> where H: DuplexHash>, C: FpConfig,