G2Projective

Struct G2Projective 

Source
pub struct G2Projective { /* private fields */ }
Expand description

G₂ projective point representation.

Implementations§

Source§

impl G2Projective

Source

pub fn identity() -> G2Projective

Point at infinity.

Source

pub fn generator() -> G2Projective

Fixed generator.

Source

pub fn random(rng: impl RngCore) -> Self

Random non-identity element.

Source

pub fn msm_vartime(points: &[G2Affine], scalars: &[Scalar]) -> Result<Self>

Multi-scalar multiplication using a variable-time Pippenger’s algorithm.

This method is faster for non-sensitive operations where timing side-channels are not a concern, as it contains input-dependent branches.

§Panics

Panics if points.len() != scalars.len().

Source

pub fn msm(points: &[G2Affine], scalars: &[Scalar]) -> Result<Self>

Multi-scalar multiplication using a constant-time Pippenger’s algorithm.

This method is suitable for cryptographic operations where resistance to timing side-channels is required.

§Panics

Panics if points.len() != scalars.len().

Source

pub fn double(&self) -> G2Projective

Point doubling.

Source

pub fn add(&self, rhs: &G2Projective) -> G2Projective

Point addition.

Source

pub fn add_mixed(&self, rhs: &G2Affine) -> G2Projective

Mixed addition with affine point.

Source

pub fn clear_cofactor(&self) -> G2Projective

Clear cofactor.

Source

pub fn batch_normalize(p: &[Self], q: &mut [G2Affine])

Batch conversion to affine.

Source

pub fn is_identity(&self) -> Choice

Check if point at infinity.

Source

pub fn is_on_curve(&self) -> Choice

Check if on curve y² = x³ + B.

Source

pub fn from_bytes(bytes: &[u8; 96]) -> CtOption<Self>

Deserialize from compressed bytes.

Source

pub fn from_bytes_unchecked(bytes: &[u8; 96]) -> CtOption<Self>

Deserialize without validation.

Source

pub fn to_bytes(&self) -> [u8; 96]

Serialize to compressed bytes.

Trait Implementations§

Source§

impl<'a, 'b> Add<&'b G2Affine> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'b G2Affine) -> G2Projective

Performs the + operation. Read more
Source§

impl<'b> Add<&'b G2Affine> for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'b G2Affine) -> G2Projective

Performs the + operation. Read more
Source§

impl<'a, 'b> Add<&'b G2Projective> for &'a G2Affine

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'b G2Projective) -> G2Projective

Performs the + operation. Read more
Source§

impl<'a, 'b> Add<&'b G2Projective> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'b G2Projective) -> G2Projective

Performs the + operation. Read more
Source§

impl<'b> Add<&'b G2Projective> for G2Affine

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'b G2Projective) -> G2Projective

Performs the + operation. Read more
Source§

impl<'b> Add<&'b G2Projective> for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'b G2Projective) -> G2Projective

Performs the + operation. Read more
Source§

impl<'a> Add<G2Affine> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: G2Affine) -> G2Projective

Performs the + operation. Read more
Source§

impl Add<G2Affine> for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: G2Affine) -> G2Projective

Performs the + operation. Read more
Source§

impl<'a> Add<G2Projective> for &'a G2Affine

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: G2Projective) -> G2Projective

Performs the + operation. Read more
Source§

impl<'a> Add<G2Projective> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: G2Projective) -> G2Projective

Performs the + operation. Read more
Source§

impl Add<G2Projective> for G2Affine

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: G2Projective) -> G2Projective

Performs the + operation. Read more
Source§

impl Add for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: G2Projective) -> G2Projective

Performs the + operation. Read more
Source§

impl<'b> AddAssign<&'b G2Affine> for G2Projective

Source§

fn add_assign(&mut self, rhs: &'b G2Affine)

Performs the += operation. Read more
Source§

impl<'b> AddAssign<&'b G2Projective> for G2Projective

Source§

fn add_assign(&mut self, rhs: &'b G2Projective)

Performs the += operation. Read more
Source§

impl AddAssign<G2Affine> for G2Projective

Source§

fn add_assign(&mut self, rhs: G2Affine)

Performs the += operation. Read more
Source§

impl AddAssign for G2Projective

Source§

fn add_assign(&mut self, rhs: G2Projective)

Performs the += operation. Read more
Source§

impl Clone for G2Projective

Source§

fn clone(&self) -> G2Projective

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConditionallySelectable for G2Projective

Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
Source§

impl ConstantTimeEq for G2Projective

Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl Debug for G2Projective

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for G2Projective

Source§

fn default() -> G2Projective

Returns the “default value” for a type. Read more
Source§

impl Display for G2Projective

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a G2Affine> for G2Projective

Source§

fn from(p: &'a G2Affine) -> G2Projective

Converts to this type from the input type.
Source§

impl<'a> From<&'a G2Projective> for G2Affine

Source§

fn from(p: &'a G2Projective) -> G2Affine

Converts to this type from the input type.
Source§

impl From<G2Affine> for G2Projective

Source§

fn from(p: G2Affine) -> G2Projective

Converts to this type from the input type.
Source§

impl From<G2Projective> for G2Affine

Source§

fn from(p: G2Projective) -> G2Affine

Converts to this type from the input type.
Source§

impl<'a, 'b> Mul<&'b G2Projective> for &'a Scalar

Source§

type Output = G2Projective

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'b G2Projective) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b> Mul<&'b G2Projective> for Scalar

Source§

type Output = G2Projective

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'b G2Projective) -> G2Projective

Performs the * operation. Read more
Source§

impl<'a, 'b> Mul<&'b Scalar> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'b Scalar) -> Self::Output

Performs the * operation. Read more
Source§

impl<'b> Mul<&'b Scalar> for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'b Scalar) -> G2Projective

Performs the * operation. Read more
Source§

impl<'a> Mul<G2Projective> for &'a Scalar

Source§

type Output = G2Projective

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: G2Projective) -> G2Projective

Performs the * operation. Read more
Source§

impl Mul<G2Projective> for Scalar

Source§

type Output = G2Projective

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: G2Projective) -> G2Projective

Performs the * operation. Read more
Source§

impl<'a> Mul<Scalar> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Scalar) -> G2Projective

Performs the * operation. Read more
Source§

impl Mul<Scalar> for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Scalar) -> G2Projective

Performs the * operation. Read more
Source§

impl<'b> MulAssign<&'b Scalar> for G2Projective

Source§

fn mul_assign(&mut self, rhs: &'b Scalar)

Performs the *= operation. Read more
Source§

impl MulAssign<Scalar> for G2Projective

Source§

fn mul_assign(&mut self, rhs: Scalar)

Performs the *= operation. Read more
Source§

impl<'a> Neg for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn neg(self) -> G2Projective

Performs the unary - operation. Read more
Source§

impl Neg for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn neg(self) -> G2Projective

Performs the unary - operation. Read more
Source§

impl PartialEq for G2Projective

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> Sub<&'b G2Affine> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'b G2Affine) -> G2Projective

Performs the - operation. Read more
Source§

impl<'b> Sub<&'b G2Affine> for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'b G2Affine) -> G2Projective

Performs the - operation. Read more
Source§

impl<'a, 'b> Sub<&'b G2Projective> for &'a G2Affine

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'b G2Projective) -> G2Projective

Performs the - operation. Read more
Source§

impl<'a, 'b> Sub<&'b G2Projective> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'b G2Projective) -> G2Projective

Performs the - operation. Read more
Source§

impl<'b> Sub<&'b G2Projective> for G2Affine

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'b G2Projective) -> G2Projective

Performs the - operation. Read more
Source§

impl<'b> Sub<&'b G2Projective> for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'b G2Projective) -> G2Projective

Performs the - operation. Read more
Source§

impl<'a> Sub<G2Affine> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: G2Affine) -> G2Projective

Performs the - operation. Read more
Source§

impl Sub<G2Affine> for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: G2Affine) -> G2Projective

Performs the - operation. Read more
Source§

impl<'a> Sub<G2Projective> for &'a G2Affine

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: G2Projective) -> G2Projective

Performs the - operation. Read more
Source§

impl<'a> Sub<G2Projective> for &'a G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: G2Projective) -> G2Projective

Performs the - operation. Read more
Source§

impl Sub<G2Projective> for G2Affine

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: G2Projective) -> G2Projective

Performs the - operation. Read more
Source§

impl Sub for G2Projective

Source§

type Output = G2Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: G2Projective) -> G2Projective

Performs the - operation. Read more
Source§

impl<'b> SubAssign<&'b G2Affine> for G2Projective

Source§

fn sub_assign(&mut self, rhs: &'b G2Affine)

Performs the -= operation. Read more
Source§

impl<'b> SubAssign<&'b G2Projective> for G2Projective

Source§

fn sub_assign(&mut self, rhs: &'b G2Projective)

Performs the -= operation. Read more
Source§

impl SubAssign<G2Affine> for G2Projective

Source§

fn sub_assign(&mut self, rhs: G2Affine)

Performs the -= operation. Read more
Source§

impl SubAssign for G2Projective

Source§

fn sub_assign(&mut self, rhs: G2Projective)

Performs the -= operation. Read more
Source§

impl<T> Sum<T> for G2Projective
where T: Borrow<G2Projective>,

Source§

fn sum<I>(iter: I) -> Self
where I: Iterator<Item = T>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Copy for G2Projective

Source§

impl DefaultIsZeroes for G2Projective

Source§

impl Eq for G2Projective

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ConditionallyNegatable for T
where T: ConditionallySelectable, &'a T: for<'a> Neg<Output = T>,

Source§

fn conditional_negate(&mut self, choice: Choice)

Negate self if choice == Choice(1); otherwise, leave it unchanged. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<Z> Zeroize for Z
where Z: DefaultIsZeroes,

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.