Skip to content

Commit

Permalink
collect as vec
Browse files Browse the repository at this point in the history
  • Loading branch information
Achim Schneider committed Mar 18, 2023
1 parent 344cfff commit 9167d59
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions primitives/arkworks/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ pub fn multi_miller_loop_generic<Curve: Pairing>(
let g1: Vec<_> = a_vec
.chunks(<Curve as Pairing>::G1Affine::generator().serialized_size(Compress::No))
.into_iter()
.map(|elem| deserialize_argument::<<Curve as Pairing>::G1Affine>(elem.into()))
.map(|elem| deserialize_argument::<<Curve as Pairing>::G1Affine>(elem.collect::<Vec<_>>()))
.collect();
let g2: Vec<_> = b_vec
.chunks(<Curve as Pairing>::G2Affine::generator().serialized_size(Compress::No))
.into_iter()
.map(|elem| deserialize_argument::<<Curve as Pairing>::G2Affine>(elem.into()))
.map(|elem| deserialize_argument::<<Curve as Pairing>::G2Affine>(elem.collect::<Vec<_>>()))
.collect();

let result = Curve::multi_miller_loop(g1, g2);
Expand All @@ -56,12 +56,12 @@ pub fn msm_g1_generic<Curve: Pairing>(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u
let bases: Vec<_> = bases
.chunks(<Curve as Pairing>::G1Affine::generator().serialized_size(Compress::No))
.into_iter()
.map(|a| deserialize_argument::<<Curve as Pairing>::G1Affine>(a.into()))
.map(|a| deserialize_argument::<<Curve as Pairing>::G1Affine>(a.collect::<Vec<_>>()))
.collect();
let scalars: Vec<_> = scalars
.chunks(Curve::ScalarField::zero().serialized_size(Compress::No))
.into_iter()
.map(|a| deserialize_argument::<Curve::ScalarField>(a.into()))
.map(|a| deserialize_argument::<Curve::ScalarField>(a.collect::<Vec<_>>()))
.collect();

let result =
Expand All @@ -74,12 +74,12 @@ pub fn msm_g2_generic<Curve: Pairing>(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u
let bases: Vec<_> = bases
.chunks(<Curve as Pairing>::G2Affine::generator().serialized_size(Compress::No))
.into_iter()
.map(|a| deserialize_argument::<<Curve as Pairing>::G2Affine>(a.into()))
.map(|a| deserialize_argument::<<Curve as Pairing>::G2Affine>(a.collect::<Vec<_>>()))
.collect();
let scalars: Vec<_> = scalars
.chunks(Curve::ScalarField::zero().serialized_size(Compress::No))
.into_iter()
.map(|a| deserialize_argument::<Curve::ScalarField>(a.into()))
.map(|a| deserialize_argument::<Curve::ScalarField>(a.collect::<Vec<_>>()))
.collect();

let result =
Expand Down

0 comments on commit 9167d59

Please sign in to comment.