Skip to content

Commit

Permalink
use into_iter for chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
Achim Schneider committed Mar 18, 2023
1 parent 4d3b13c commit 1ddd6b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions primitives/arkworks/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ pub fn multi_miller_loop_generic<Curve: Pairing>(
) -> Result<Vec<u8>, PairingError> {
let g1: Vec<_> = a_vec
.chunks(<Curve as Pairing>::G1Affine.serialized_size(Compress::No))
.iter()
.into_iter()
.map(|elem| deserialize_argument::<<Curve as Pairing>::G1Affine>(elem))
.collect();
let g2: Vec<_> = b_vec
.chunks(<Curve as Pairing>::G2Affine.serialized_size(Compress::No))
.iter()
.into_iter()
.map(|elem| deserialize_argument::<<Curve as Pairing>::G2Affine>(elem))
.collect();

Expand All @@ -51,7 +51,7 @@ pub fn final_exponentiation_generic<Curve: Pairing>(
pub fn msm_g1_generic<Curve: Pairing>(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u8> {
let bases: Vec<_> = bases
.chunks(<Curve as Pairing>::G1Affine.serialized_size(Compress::No))
.iter()
.into_iter()
.map(|a| deserialize_argument::<<Curve as Pairing>::G1Affine>(a))
.collect();
let scalars: Vec<_> =
Expand All @@ -66,7 +66,7 @@ pub fn msm_g1_generic<Curve: Pairing>(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u
pub fn msm_g2_generic<Curve: Pairing>(bases: Vec<u8>, scalars: Vec<u8>) -> Vec<u8> {
let bases: Vec<_> = bases
.chunks(<Curve as Pairing>::G2Affine.serialized_size(Compress::No))
.iter()
.into_iter()
.map(|a| deserialize_argument::<<Curve as Pairing>::G2Affine>(a))
.collect();
let scalars: Vec<_> =
Expand Down

0 comments on commit 1ddd6b8

Please sign in to comment.