Skip to main content

G1Projective

Struct G1Projective 

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

G₁ projective point representation.

Implementations§

Source§

impl G1Projective

Source

pub fn identity() -> G1Projective

Point at infinity.

Source

pub fn generator() -> G1Projective

Fixed generator.

Source

pub fn multiply_secret_be_bytes(&self, secret: &[u8; 32]) -> Result<Self>

Multiply by a canonical, nonzero scalar encoded as a 32-byte big-endian secret key.

This path validates and consumes the borrowed big-endian bytes directly: it does not construct the generic Copy scalar type or materialize a second byte-order representation. Multiplication uses exactly 256 MSB-first rounds, always computes both the doubled and added candidate, and selects with a constant-time mask. Secret-derived point scratch is explicitly cleared after every round. Platform-specific compiler inspection is still required for a concrete side-channel claim.

Source

pub fn random(rng: impl CryptoRng) -> Result<Self, RandomError>

Random point generation.

Source

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

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

Every scalar passed to this low-level helper must be public. It contains input-dependent branches and does not provide secret-scratch ownership. Use Self::multiply_secret_be_bytes for secret scalar multiplication, or the high-level BLS APIs in dcrypt-sign.

§Panics

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

Source

pub fn double(&self) -> G1Projective

Point doubling.

Source

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

Point addition.

Source

pub fn add_mixed(&self, rhs: &G1Affine) -> G1Projective

Mixed addition with affine point.

Source

pub fn clear_cofactor(&self) -> G1Projective

Clear cofactor using [x - 1] method.

Source

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

Batch affine conversion.

Source

pub fn is_identity(&self) -> Choice

Check if point at infinity.

Source

pub fn is_on_curve(&self) -> Choice

Curve membership check.

Source

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

Deserialize a standard compressed group element and enforce subgroup membership. The canonical identity encoding is accepted; protocols such as BLS that prohibit identity inputs should use Self::from_bytes_validated.

Source

pub fn from_bytes_validated(bytes: &[u8]) -> Result<Self>

Deserialize a nonidentity standard compressed point with strict BLS input validation: canonical encoding, curve membership, and subgroup membership.

Source

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

Serialize to compressed bytes.

Source§

impl G1Projective

Source

pub fn hash_to_curve(msg: &[u8], dst: &[u8]) -> Result<Self>

Hash a message to a point on G1 using the hash-to-curve protocol.

Trait Implementations§

Source§

impl Add for G1Projective

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<'a, 'b> Add<&'b G1Affine> for &'a G1Projective

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<'b> Add<&'b G1Affine> for G1Projective

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<'a, 'b> Add<&'b G1Projective> for &'a G1Affine

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<'b> Add<&'b G1Projective> for G1Affine

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<'a> Add<G1Affine> for &'a G1Projective

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: G1Affine) -> G1Projective

Performs the + operation. Read more
Source§

impl Add<G1Affine> for G1Projective

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

fn add(self, rhs: G1Affine) -> G1Projective

Performs the + operation. Read more
Source§

impl<'a> Add<G1Projective> for &'a G1Affine

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add<G1Projective> for G1Affine

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl AddAssign for G1Projective

Source§

fn add_assign(&mut self, rhs: G1Projective)

Performs the += operation. Read more
Source§

impl<'b> AddAssign<&'b G1Affine> for G1Projective

Source§

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

Performs the += operation. Read more
Source§

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

Source§

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

Performs the += operation. Read more
Source§

impl AddAssign<G1Affine> for G1Projective

Source§

fn add_assign(&mut self, rhs: G1Affine)

Performs the += operation. Read more
Source§

impl Clone for G1Projective

Source§

fn clone(&self) -> G1Projective

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl ConditionallySelectable for G1Projective

Source§

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

Source§

impl ConstantTimeEq for G1Projective

Source§

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

Source§

impl Copy for G1Projective

Source§

impl Debug for G1Projective

Source§

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

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

impl Default for G1Projective

Source§

fn default() -> G1Projective

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

impl Display for G1Projective

Source§

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

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

impl Eq for G1Projective

Source§

impl<'a> From<&'a G1Affine> for G1Projective

Source§

fn from(p: &'a G1Affine) -> G1Projective

Converts to this type from the input type.
Source§

impl<'a> From<&'a G1Projective> for G1Affine

Source§

fn from(p: &'a G1Projective) -> G1Affine

Converts to this type from the input type.
Source§

impl From<G1Affine> for G1Projective

Source§

fn from(p: G1Affine) -> G1Projective

Converts to this type from the input type.
Source§

impl From<G1Projective> for G1Affine

Source§

fn from(p: G1Projective) -> G1Affine

Converts to this type from the input type.
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

type Output = G1Projective

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 G1Projective

Source§

type Output = G1Projective

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<G1Projective> for Scalar

Source§

type Output = G1Projective

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<Scalar> for G1Projective

Source§

type Output = G1Projective

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

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

Performs the *= operation. Read more
Source§

impl MulAssign<Scalar> for G1Projective

Source§

fn mul_assign(&mut self, rhs: Scalar)

Performs the *= operation. Read more
Source§

impl<'a> Neg for &'a G1Projective

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

fn neg(self) -> G1Projective

Performs the unary - operation. Read more
Source§

impl Neg for G1Projective

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

fn neg(self) -> G1Projective

Performs the unary - operation. Read more
Source§

impl PartialEq for G1Projective

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Sub for G1Projective

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<'a, 'b> Sub<&'b G1Affine> for &'a G1Projective

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<'b> Sub<&'b G1Affine> for G1Projective

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<'a, 'b> Sub<&'b G1Projective> for &'a G1Affine

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<'b> Sub<&'b G1Projective> for G1Affine

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<'a> Sub<G1Affine> for &'a G1Projective

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: G1Affine) -> G1Projective

Performs the - operation. Read more
Source§

impl Sub<G1Affine> for G1Projective

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: G1Affine) -> G1Projective

Performs the - operation. Read more
Source§

impl<'a> Sub<G1Projective> for &'a G1Affine

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub<G1Projective> for G1Affine

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

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

Source§

type Output = G1Projective

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl SubAssign for G1Projective

Source§

fn sub_assign(&mut self, rhs: G1Projective)

Performs the -= operation. Read more
Source§

impl<'b> SubAssign<&'b G1Affine> for G1Projective

Source§

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

Performs the -= operation. Read more
Source§

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

Source§

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

Performs the -= operation. Read more
Source§

impl SubAssign<G1Affine> for G1Projective

Source§

fn sub_assign(&mut self, rhs: G1Affine)

Performs the -= operation. Read more
Source§

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

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 Zeroize for G1Projective

Source§

fn zeroize(&mut self)

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