Created
August 23, 2020 16:25
-
-
Save Pratyush/10331e98656f190af210fa544fdc217a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait GlvMul { | |
// whatever trait methods you need | |
} | |
pub trait SWModelParameters { | |
fn scalar_mul(thing: SWAffine<Self>, other: bits) -> SWAffine<Self> { | |
// default double and add impl | |
} | |
} | |
impl GlvMul for bls12_377::G1 { // or bls12_377::G1Parameters | |
// stuff | |
} | |
impl SWModelParameters for bls12_377::G1Parameters { | |
// other stuff here | |
fn scalar_mul(thing: SWAffine<Self>, other: bits) -> SWAffine<Self> { | |
// Glv based impl that invokes | |
} | |
} | |
////////////////////////////////////////////////////////////// | |
// In short_weierstrass_jacobian.rs | |
impl<P: SWModelParameters> SWAffine<P> { | |
fn mul_bits(&self, other: bits) -> Self { | |
P::scalar_mul(&self, other) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment