Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Jan 8, 2024
1 parent 9f4f1f2 commit fe28029
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion banderwagon/src/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn legendre_check_point(x: &Fq) -> bool {
}

pub fn multi_scalar_mul(bases: &[Element], scalars: &[Fr]) -> Element {
let bases_inner: Vec<_> = bases.into_iter().map(|element| element.0).collect();
let bases_inner: Vec<_> = bases.iter().map(|element| element.0).collect();

// XXX: Converting all of these to affine hurts performance
let bases = EdwardsProjective::batch_convert_to_mul_base(&bases_inner);
Expand Down
2 changes: 1 addition & 1 deletion banderwagon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn try_reduce_to_element(bytes: &[u8]) -> Option<Element> {

// The Element::from_bytes method does not reduce the bytes, it expects the
// input to be in a canonical format, so we must do the reduction ourselves
let x_coord = Fq::from_be_bytes_mod_order(&bytes);
let x_coord = Fq::from_be_bytes_mod_order(bytes);

let mut bytes = [0u8; 32];
x_coord.serialize_compressed(&mut bytes[..]).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion banderwagon/src/trait_impls/serialise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl CanonicalSerialize for Element {
) -> Result<(), SerializationError> {
match compress {
ark_serialize::Compress::Yes => {
writer.write(&self.to_bytes())?;
writer.write_all(&self.to_bytes())?;
Ok(())
}
ark_serialize::Compress::No => self.0.into_affine().serialize_uncompressed(writer),
Expand Down
2 changes: 2 additions & 0 deletions ipa-multipoint/src/crs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{ipa::slow_vartime_multiscalar_mul, lagrange_basis::LagrangeBasis};
use banderwagon::{try_reduce_to_element, Element};

#[allow(non_snake_case)]
#[derive(Debug, Clone)]
pub struct CRS {
pub n: usize,
Expand All @@ -9,6 +10,7 @@ pub struct CRS {
}

impl CRS {
#[allow(non_snake_case)]
pub fn new(n: usize, seed: &'static [u8]) -> CRS {
// TODO generate the Q value from the seed also
// TODO: this will also make assert_dedup work as expected
Expand Down

0 comments on commit fe28029

Please sign in to comment.