pairing_plus::bls12_381

Struct G1Affine

Source
pub struct G1Affine { /* private fields */ }

Trait Implementations§

Source§

impl Clone for G1Affine

Source§

fn clone(&self) -> G1Affine

Returns a copy 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 CurveAffine for G1Affine

Source§

type Engine = Bls12

Source§

type Scalar = Fr

Source§

type Base = Fq

Source§

type Prepared = G1Prepared

Source§

type Projective = G1

Source§

type Uncompressed = G1Uncompressed

Source§

type Compressed = G1Compressed

Source§

type Pair = G2Affine

Source§

type PairingResult = Fq12

Source§

fn zero() -> Self

Returns the additive identity.
Source§

fn one() -> Self

Returns a fixed generator of unknown exponent.
Source§

fn is_zero(&self) -> bool

Determines if this point represents the point at infinity; the additive identity.
Source§

fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(&self, by: S) -> G1

Performs scalar multiplication of this element with mixed addition.
Source§

fn negate(&mut self)

Negates this element.
Source§

fn prepare(&self) -> Self::Prepared

Prepares this element for pairing purposes.
Source§

fn pairing_with(&self, other: &Self::Pair) -> Self::PairingResult

Perform a pairing
Source§

fn into_projective(&self) -> G1

Converts this element into its affine representation.
Source§

fn as_tuple(&self) -> (&Fq, &Fq)

Borrow references to the X and Y coordinates of this point.
Source§

unsafe fn as_tuple_mut(&mut self) -> (&mut Fq, &mut Fq)

Borrow mutable references to the X and Y coordinates of this point. Unsafe, because incorrectly modifying the coordinates violates the guarantee that the point must be on the curve and in the correct subgroup.
Source§

fn precomp_3(&self, pre: &mut [Self])

pre[0] becomes (2^64) * self, pre[1] becomes (2^128) * self, and pre[2] (becomes 2^196) * self
Source§

fn mul_precomp_3<S: Into<<Self::Scalar as PrimeField>::Repr>>( &self, other: S, pre: &[Self], ) -> G1

Performs scalar multiplication of this element, assuming pre = [(2^64)*self, (2^128)*self, (2^192)*self]
Source§

fn precomp_256(&self, pre: &mut [Self])

pre[i] becomes (\sum_{b such that bth bit of i is 1} 2^{32i}) * self for i in 0..25
Source§

fn mul_precomp_256<S: Into<<Self::Scalar as PrimeField>::Repr>>( &self, other: S, pre: &[Self], ) -> G1

Performs scalar multiplication of this element, assuming pre[i] = (\sum_{b such that bth bit of i is 1} 2^{32i}) * self for i in 0..256
Source§

fn sum_of_products(points: &[Self], scalars: &[&[u64; 4]]) -> G1

given x, compute x^3+b multiplication of many points compute s1 * p1 + … + sn * pn simultaneously
Source§

fn find_pippinger_window(num_components: usize) -> usize

Find the optimal window for running Pippinger’s algorithm; preprogrammed values
Source§

fn find_pippinger_window_via_estimate(num_components: usize) -> usize

Find the optimal window for running Pippinger’s algorithm; computed values via an estimate of running time
Source§

fn sum_of_products_pippinger( points: &[Self], scalars: &[&[u64; 4]], window: usize, ) -> G1

multiplication of many points with Pippinger’s algorithm of window size w compute s1 * p1 + … + sn * pn simultaneously
Source§

fn sum_of_products_precomp_256( points: &[Self], scalars: &[&[u64; 4]], pre: &[Self], ) -> G1

multiplication of many points with precompuation compute s1 * p1 + … + sn * pn simultaneously assuming pre[j*256+i] = (\sum_{b such that bth bit of i is 1} 2^{32i}) * bases[j] for each j and i in 0..256
Source§

fn into_compressed(&self) -> Self::Compressed

Converts this element into its compressed encoding, so long as it’s not the point at infinity.
Source§

fn into_uncompressed(&self) -> Self::Uncompressed

Converts this element into its uncompressed encoding, so long as it’s not the point at infinity.
Source§

impl Debug for G1Affine

Source§

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

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

impl Default for G1Affine

Source§

fn default() -> Self

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

impl Display for G1Affine

Source§

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

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

impl From<G1> for G1Affine

Source§

fn from(p: G1) -> G1Affine

Converts to this type from the input type.
Source§

impl From<G1Affine> for G1

Source§

fn from(p: G1Affine) -> G1

Converts to this type from the input type.
Source§

impl PartialEq for G1Affine

Source§

fn eq(&self, other: &G1Affine) -> 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 SerDes for G1Affine

Source§

fn serialize<W: Write>(&self, writer: &mut W, compressed: bool) -> Result<()>

Convert a G1 point to a blob.

Source§

fn deserialize<R: Read>(reader: &mut R, compressed: bool) -> Result<Self>

Deserialize a G1 element from a blob. Returns an error if deserialization fails.

Source§

impl SubgroupCheck for G1Affine

Source§

fn in_subgroup(&self) -> bool

subgroup membership check using classical method: i.e., raise to the power of group order
Source§

impl Zeroize for G1Affine

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.
Source§

impl Copy for G1Affine

Source§

impl Eq for G1Affine

Source§

impl StructuralPartialEq for G1Affine

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> Same for T

Source§

type Output = T

Should always be Self
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§

default 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.