Trait ark_ec::CurveGroup
source · pub trait CurveGroup: Group + Add<Self::Affine, Output = Self> + AddAssign<Self::Affine> + VariableBaseMSM + ScalarMul<MulBase = Self::Affine> + From<Self::Affine> + Into<Self::Affine> + Sum<Self::Affine> + for<'a> Sum<&'a Self::Affine> {
type Config: CurveConfig<ScalarField = Self::ScalarField, BaseField = Self::BaseField>;
type BaseField: Field;
type Affine: AffineRepr<Config = Self::Config, Group = Self, ScalarField = Self::ScalarField, BaseField = Self::BaseField> + From<Self> + Into<Self>;
type FullGroup;
fn normalize_batch(v: &[Self]) -> Vec<Self::Affine>;
fn into_affine(self) -> Self::Affine { ... }
}
Expand description
An opaque representation of an elliptic curve group element that is suitable for efficient group arithmetic.
The point is guaranteed to be in the correct prime order subgroup.
Required Associated Types§
type Config: CurveConfig<ScalarField = Self::ScalarField, BaseField = Self::BaseField>
sourcetype Affine: AffineRepr<Config = Self::Config, Group = Self, ScalarField = Self::ScalarField, BaseField = Self::BaseField> + From<Self> + Into<Self>
type Affine: AffineRepr<Config = Self::Config, Group = Self, ScalarField = Self::ScalarField, BaseField = Self::BaseField> + From<Self> + Into<Self>
The affine representation of this element.
Required Methods§
sourcefn normalize_batch(v: &[Self]) -> Vec<Self::Affine>
fn normalize_batch(v: &[Self]) -> Vec<Self::Affine>
Normalizes a slice of group elements into affine.
Provided Methods§
sourcefn into_affine(self) -> Self::Affine
fn into_affine(self) -> Self::Affine
Converts self
into the affine representation.
Examples found in repository?
src/models/bls12/g1.rs (line 29)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
fn from(q: G1Projective<P>) -> Self {
q.into_affine().into()
}
}
impl<'a, P: Bls12Config> From<&'a G1Affine<P>> for G1Prepared<P> {
fn from(other: &'a G1Affine<P>) -> Self {
G1Prepared(*other)
}
}
impl<'a, P: Bls12Config> From<&'a G1Projective<P>> for G1Prepared<P> {
fn from(q: &'a G1Projective<P>) -> Self {
q.into_affine().into()
}
More examples
src/models/bls12/g2.rs (line 86)
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
fn from(q: G2Projective<P>) -> Self {
q.into_affine().into()
}
}
impl<'a, P: Bls12Config> From<&'a G2Affine<P>> for G2Prepared<P> {
fn from(other: &'a G2Affine<P>) -> Self {
(*other).into()
}
}
impl<'a, P: Bls12Config> From<&'a G2Projective<P>> for G2Prepared<P> {
fn from(q: &'a G2Projective<P>) -> Self {
q.into_affine().into()
}
src/models/bn/g1.rs (line 29)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
fn from(q: G1Projective<P>) -> Self {
q.into_affine().into()
}
}
impl<'a, P: BnConfig> From<&'a G1Affine<P>> for G1Prepared<P> {
fn from(other: &'a G1Affine<P>) -> Self {
G1Prepared(*other)
}
}
impl<'a, P: BnConfig> From<&'a G1Projective<P>> for G1Prepared<P> {
fn from(q: &'a G1Projective<P>) -> Self {
q.into_affine().into()
}
src/models/bn/g2.rs (line 154)
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
fn from(q: G2Projective<P>) -> Self {
q.into_affine().into()
}
}
impl<'a, P: BnConfig> From<&'a G2Affine<P>> for G2Prepared<P> {
fn from(other: &'a G2Affine<P>) -> Self {
(*other).into()
}
}
impl<'a, P: BnConfig> From<&'a G2Projective<P>> for G2Prepared<P> {
fn from(q: &'a G2Projective<P>) -> Self {
q.into_affine().into()
}
src/models/bw6/g1.rs (line 30)
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
fn from(q: G1Projective<P>) -> Self {
q.into_affine().into()
}
}
impl<'a, P: BW6Config> From<&'a G1Affine<P>> for G1Prepared<P> {
fn from(other: &'a G1Affine<P>) -> Self {
G1Prepared(*other)
}
}
impl<'a, P: BW6Config> From<&'a G1Projective<P>> for G1Prepared<P> {
fn from(q: &'a G1Projective<P>) -> Self {
q.into_affine().into()
}