diff --git a/primitives/arkworks/src/ed_on_bls12_377.rs b/primitives/arkworks/src/ed_on_bls12_377.rs index 82443b21a5b73..e4dd4ea2cb229 100644 --- a/primitives/arkworks/src/ed_on_bls12_377.rs +++ b/primitives/arkworks/src/ed_on_bls12_377.rs @@ -30,13 +30,13 @@ use sp_std::vec::Vec; pub fn msm(bases: Vec, scalars: Vec) -> Vec { let bases: Vec<_> = bases .chunks(twisted_edwards::Affine::::generator().serialized_size(Compress::No)) - .into() - .map(|a| deserialize_argument::>(a)) + .into_iter() + .map(|a| deserialize_argument::>(&a.to_vec())) .collect(); let scalars: Vec<_> = scalars .chunks(::ScalarField::zero().serialized_size(Compress::No)) - .into() - .map(|a| deserialize_argument::<::ScalarField>(a)) + .into_iter() + .map(|a| deserialize_argument::<::ScalarField>(&a.to_vec())) .collect(); let result = ::msm(&bases, &scalars).unwrap(); diff --git a/primitives/arkworks/src/ed_on_bls12_381.rs b/primitives/arkworks/src/ed_on_bls12_381.rs index 3634099892bad..5ffc6ab858aba 100644 --- a/primitives/arkworks/src/ed_on_bls12_381.rs +++ b/primitives/arkworks/src/ed_on_bls12_381.rs @@ -33,13 +33,13 @@ use sp_std::vec::Vec; pub fn te_msm(bases: Vec, scalars: Vec) -> Vec { let bases: Vec<_> = bases .chunks(TEAffine::::generator().serialized_size(Compress::No)) - .iter() - .map(|a| deserialize_argument::>(a)) + .into_iter() + .map(|a| deserialize_argument::>(&a.to_vec())) .collect(); let scalars: Vec<_> = scalars .chunks(::ScalarField::zero().serialized_size(Compress::No)) - .iter() - .map(|a| deserialize_argument::<::ScalarField>(a)) + .into_iter() + .map(|a| deserialize_argument::<::ScalarField>(&a.to_vec())) .collect(); let result = ::msm(&bases, &scalars).unwrap(); @@ -51,13 +51,13 @@ pub fn te_msm(bases: Vec, scalars: Vec) -> Vec { pub fn sw_msm(bases: Vec, scalars: Vec) -> Vec { let bases: Vec<_> = bases .chunks(SWAffine::::genrator().serialized_size(Compress::No)) - .iter() - .map(|a| deserialize_argument::>(a)) + .into_iter() + .map(|a| deserialize_argument::>(&a.to_vec())) .collect(); let scalars: Vec<_> = scalars .chunks(::ScalarField::zero().serialized_size(Compress::No)) - .iter() - .map(|a| deserialize_argument::<::ScalarField>(a)) + .into_iter() + .map(|a| deserialize_argument::<::ScalarField>(&a.to_vec())) .collect(); let result = ::msm(&bases, &scalars).unwrap(); diff --git a/primitives/arkworks/src/utils.rs b/primitives/arkworks/src/utils.rs index df03f7318deb6..2e48fa6b7133b 100644 --- a/primitives/arkworks/src/utils.rs +++ b/primitives/arkworks/src/utils.rs @@ -25,13 +25,13 @@ pub fn multi_miller_loop_generic( ) -> Result, PairingError> { let g1: Vec<_> = a_vec .chunks(::G1Affine::generator().serialized_size(Compress::No)) - .iter() - .map(|elem| deserialize_argument::<::G1Affine>(elem)) + .into_iter() + .map(|elem| deserialize_argument::<::G1Affine>(&elem.to_vec())) .collect(); let g2: Vec<_> = b_vec .chunks(::G2Affine::generator().serialized_size(Compress::No)) - .iter() - .map(|elem| deserialize_argument::<::G2Affine>(elem)) + .into_iter() + .map(|elem| deserialize_argument::<::G2Affine>(&elem.to_vec())) .collect(); let result = Curve::multi_miller_loop(g1, g2); @@ -55,13 +55,13 @@ pub fn final_exponentiation_generic( pub fn msm_g1_generic(bases: Vec, scalars: Vec) -> Vec { let bases: Vec<_> = bases .chunks(::G1Affine::generator().serialized_size(Compress::No)) - .iter() - .map(|a| deserialize_argument::<::G1Affine>(a)) + .into_iter() + .map(|a| deserialize_argument::<::G1Affine>(&a.to_vec())) .collect(); let scalars: Vec<_> = scalars .chunks(Curve::ScalarField::zero().serialized_size(Compress::No)) - .iter() - .map(|a| deserialize_argument::(a)) + .into_iter() + .map(|a| deserialize_argument::(&a.to_vec())) .collect(); let result = @@ -73,13 +73,13 @@ pub fn msm_g1_generic(bases: Vec, scalars: Vec) -> Vec(bases: Vec, scalars: Vec) -> Vec { let bases: Vec<_> = bases .chunks(::G2Affine::generator().serialized_size(Compress::No)) - .iter() - .map(|a| deserialize_argument::<::G2Affine>(a)) + .into_iter() + .map(|a| deserialize_argument::<::G2Affine>(&a.to_vec())) .collect(); let scalars: Vec<_> = scalars .chunks(Curve::ScalarField::zero().serialized_size(Compress::No)) - .iter() - .map(|a| deserialize_argument::(a)) + .into_iter() + .map(|a| deserialize_argument::(&a.to_vec())) .collect(); let result =