Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Achim Schneider committed Nov 30, 2022
1 parent ebe10d9 commit d996417
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
10 changes: 5 additions & 5 deletions ec/src/models/short_weierstrass/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,11 @@ impl<P: SWCurveConfig> ScalarMul for Projective<P> {

impl<P: SWCurveConfig> VariableBaseMSM for Projective<P> {
fn msm_bigint(
bases: &[Self::MulBase],
bigints: &[<Self::ScalarField as PrimeField>::BigInt],
) -> Self {
P::msm_bigint(bases, bigints)
}
bases: &[Self::MulBase],
bigints: &[<Self::ScalarField as PrimeField>::BigInt],
) -> Self {
P::msm_bigint(bases, bigints)
}
}

impl<P: SWCurveConfig, T: Borrow<Affine<P>>> core::iter::Sum<T> for Projective<P> {
Expand Down
13 changes: 6 additions & 7 deletions ec/src/models/short_weierstrass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use ark_std::io::{Read, Write};

use ark_ff::{fields::Field, PrimeField};

use crate::{AffineRepr, Group, scalar_mul::variable_base::VariableBaseMSM};
use crate::{scalar_mul::variable_base::VariableBaseMSM, AffineRepr, Group};

use num_traits::Zero;

Expand Down Expand Up @@ -107,12 +107,11 @@ pub trait SWCurveConfig: super::CurveConfig {

/// Default implementation for multi scalar multiplication
fn msm_bigint(
bases: &[Affine<Self>],
bigints: &[<Self::ScalarField as PrimeField>::BigInt],
) -> Projective<Self>
{
VariableBaseMSM::msm_bigint(bases, bigints)
}
bases: &[Affine<Self>],
bigints: &[<Self::ScalarField as PrimeField>::BigInt],
) -> Projective<Self> {
VariableBaseMSM::msm_bigint(bases, bigints)
}

/// If uncompressed, serializes both x and y coordinates as well as a bit for whether it is
/// infinity. If compressed, serializes x coordinate with two bits to encode whether y is
Expand Down
1 change: 0 additions & 1 deletion test-templates/src/msm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use ark_ec::{
use ark_ff::{PrimeField, UniformRand};
use ark_std::vec::Vec;


fn naive_var_base_msm<G: ScalarMul>(bases: &[G::MulBase], scalars: &[G::ScalarField]) -> G {
let mut acc = G::zero();

Expand Down

0 comments on commit d996417

Please sign in to comment.