Struct dusk_bls12_381::G2Affine [−][src]
pub struct G2Affine { /* fields omitted */ }
This is an element of $\mathbb{G}_2$ represented in the affine coordinate space. It is ideal to keep elements in this representation to reduce memory usage and improve performance through the use of mixed curve model arithmetic.
Values of G2Affine
are guaranteed to be in the $q$-order subgroup unless an
“unchecked” API was misused.
Implementations
impl G2Affine
[src]
impl G2Affine
[src]pub const RAW_SIZE: usize
[src]
Bytes size of the raw representation
pub fn identity() -> G2Affine
[src]
Returns the identity of the group: the point at infinity.
pub fn generator() -> G2Affine
[src]
Returns a fixed generator of the group. See notes::design
for how this generator is chosen.
pub fn to_raw_bytes(&self) -> [u8; 193]
[src]
Raw bytes representation
The intended usage of this function is for trusted sets of data where performance is critical.
For secure serialization, check to_bytes
pub unsafe fn from_slice_unchecked(bytes: &[u8]) -> Self
[src]
Create a G2Affine
from a set of bytes created by G2Affine::to_raw_bytes
.
No check is performed and no constant time is granted. The expected usage of this function is for trusted bytes where performance is critical.
For secure serialization, check from_bytes
After generating the point, you can check is_on_curve
and is_torsion_free
to grant its
security
pub fn is_identity(&self) -> Choice
[src]
Returns true if this element is the identity (the point at infinity).
pub fn is_torsion_free(&self) -> Choice
[src]
Returns true if this point is free of an $h$-torsion component, and so it exists within the $q$-order subgroup $\mathbb{G}_2$. This should always return true unless an “unchecked” API was used.
pub fn is_on_curve(&self) -> Choice
[src]
Returns true if this point is on the curve. This should always return true unless an “unchecked” API was used.
Trait Implementations
impl<'a, 'b> Add<&'b G2Affine> for &'a G2Projective
[src]
impl<'a, 'b> Add<&'b G2Affine> for &'a G2Projective
[src]type Output = G2Projective
The resulting type after applying the +
operator.
fn add(self, rhs: &'b G2Affine) -> G2Projective
[src]
impl<'b> Add<&'b G2Affine> for G2Projective
[src]
impl<'b> Add<&'b G2Affine> for G2Projective
[src]type Output = G2Projective
The resulting type after applying the +
operator.
fn add(self, rhs: &'b G2Affine) -> G2Projective
[src]
impl<'a, 'b> Add<&'b G2Projective> for &'a G2Affine
[src]
impl<'a, 'b> Add<&'b G2Projective> for &'a G2Affine
[src]type Output = G2Projective
The resulting type after applying the +
operator.
fn add(self, rhs: &'b G2Projective) -> G2Projective
[src]
impl<'b> Add<&'b G2Projective> for G2Affine
[src]
impl<'b> Add<&'b G2Projective> for G2Affine
[src]type Output = G2Projective
The resulting type after applying the +
operator.
fn add(self, rhs: &'b G2Projective) -> G2Projective
[src]
impl<'a> Add<G2Affine> for &'a G2Projective
[src]
impl<'a> Add<G2Affine> for &'a G2Projective
[src]type Output = G2Projective
The resulting type after applying the +
operator.
fn add(self, rhs: G2Affine) -> G2Projective
[src]
impl Add<G2Affine> for G2Projective
[src]
impl Add<G2Affine> for G2Projective
[src]type Output = G2Projective
The resulting type after applying the +
operator.
fn add(self, rhs: G2Affine) -> G2Projective
[src]
impl<'a> Add<G2Projective> for &'a G2Affine
[src]
impl<'a> Add<G2Projective> for &'a G2Affine
[src]type Output = G2Projective
The resulting type after applying the +
operator.
fn add(self, rhs: G2Projective) -> G2Projective
[src]
impl Add<G2Projective> for G2Affine
[src]
impl Add<G2Projective> for G2Affine
[src]type Output = G2Projective
The resulting type after applying the +
operator.
fn add(self, rhs: G2Projective) -> G2Projective
[src]
impl<'b> AddAssign<&'b G2Affine> for G2Projective
[src]
impl<'b> AddAssign<&'b G2Affine> for G2Projective
[src]fn add_assign(&mut self, rhs: &'b G2Affine)
[src]
impl AddAssign<G2Affine> for G2Projective
[src]
impl AddAssign<G2Affine> for G2Projective
[src]fn add_assign(&mut self, rhs: G2Affine)
[src]
impl ConditionallySelectable for G2Affine
[src]
impl ConditionallySelectable for G2Affine
[src]fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
[src]
pub fn conditional_assign(&mut self, other: &Self, choice: Choice)
[src]
pub fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
[src]
impl<'a> From<&'a G2Affine> for G2Projective
[src]
impl<'a> From<&'a G2Affine> for G2Projective
[src]fn from(p: &'a G2Affine) -> G2Projective
[src]
impl<'a> From<&'a G2Projective> for G2Affine
[src]
impl<'a> From<&'a G2Projective> for G2Affine
[src]fn from(p: &'a G2Projective) -> G2Affine
[src]
impl From<G2Affine> for G2Projective
[src]
impl From<G2Affine> for G2Projective
[src]fn from(p: G2Affine) -> G2Projective
[src]
impl From<G2Affine> for G2Prepared
[src]
impl From<G2Affine> for G2Prepared
[src]fn from(q: G2Affine) -> G2Prepared
[src]
impl From<G2Projective> for G2Affine
[src]
impl From<G2Projective> for G2Affine
[src]fn from(p: G2Projective) -> G2Affine
[src]
impl<'b> Mul<&'b Scalar> for G2Affine
[src]
impl<'b> Mul<&'b Scalar> for G2Affine
[src]type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b BlsScalar) -> G2Projective
[src]
impl<'a> Mul<Scalar> for &'a G2Affine
[src]
impl<'a> Mul<Scalar> for &'a G2Affine
[src]type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: BlsScalar) -> G2Projective
[src]
impl Mul<Scalar> for G2Affine
[src]
impl Mul<Scalar> for G2Affine
[src]type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: BlsScalar) -> G2Projective
[src]
impl Serializable<96_usize> for G2Affine
[src]
impl Serializable<96_usize> for G2Affine
[src]type Error = BytesError
The type returned in the event of a conversion error.
fn to_bytes(&self) -> [u8; 96]
[src]
Serializes this element into compressed form. See notes::serialization
for details about how group elements are serialized.
fn from_bytes(buf: &[u8; 96]) -> Result<Self, Self::Error>
[src]
Attempts to deserialize a compressed element. See notes::serialization
for details about how group elements are serialized.
pub const SIZE: usize
[src]
impl<'a, 'b> Sub<&'b G2Affine> for &'a G2Projective
[src]
impl<'a, 'b> Sub<&'b G2Affine> for &'a G2Projective
[src]type Output = G2Projective
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b G2Affine) -> G2Projective
[src]
impl<'b> Sub<&'b G2Affine> for G2Projective
[src]
impl<'b> Sub<&'b G2Affine> for G2Projective
[src]type Output = G2Projective
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b G2Affine) -> G2Projective
[src]
impl<'a, 'b> Sub<&'b G2Projective> for &'a G2Affine
[src]
impl<'a, 'b> Sub<&'b G2Projective> for &'a G2Affine
[src]type Output = G2Projective
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b G2Projective) -> G2Projective
[src]
impl<'b> Sub<&'b G2Projective> for G2Affine
[src]
impl<'b> Sub<&'b G2Projective> for G2Affine
[src]type Output = G2Projective
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b G2Projective) -> G2Projective
[src]
impl<'a> Sub<G2Affine> for &'a G2Projective
[src]
impl<'a> Sub<G2Affine> for &'a G2Projective
[src]type Output = G2Projective
The resulting type after applying the -
operator.
fn sub(self, rhs: G2Affine) -> G2Projective
[src]
impl Sub<G2Affine> for G2Projective
[src]
impl Sub<G2Affine> for G2Projective
[src]type Output = G2Projective
The resulting type after applying the -
operator.
fn sub(self, rhs: G2Affine) -> G2Projective
[src]
impl<'a> Sub<G2Projective> for &'a G2Affine
[src]
impl<'a> Sub<G2Projective> for &'a G2Affine
[src]type Output = G2Projective
The resulting type after applying the -
operator.
fn sub(self, rhs: G2Projective) -> G2Projective
[src]
impl Sub<G2Projective> for G2Affine
[src]
impl Sub<G2Projective> for G2Affine
[src]type Output = G2Projective
The resulting type after applying the -
operator.
fn sub(self, rhs: G2Projective) -> G2Projective
[src]
impl<'b> SubAssign<&'b G2Affine> for G2Projective
[src]
impl<'b> SubAssign<&'b G2Affine> for G2Projective
[src]fn sub_assign(&mut self, rhs: &'b G2Affine)
[src]
impl SubAssign<G2Affine> for G2Projective
[src]
impl SubAssign<G2Affine> for G2Projective
[src]fn sub_assign(&mut self, rhs: G2Affine)
[src]
Auto Trait Implementations
impl RefUnwindSafe for G2Affine
impl RefUnwindSafe for G2Affine
impl UnwindSafe for G2Affine
impl UnwindSafe for G2Affine
Blanket Implementations
impl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: for<'a> Neg,
<&'a T as Neg>::Output == T,
[src]
impl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: for<'a> Neg,
<&'a T as Neg>::Output == T,
[src]pub fn conditional_negate(&mut self, choice: Choice)
[src]
impl<T, const N: usize> DeserializableSlice<N> for T where
T: Serializable<N>,
[src]
impl<T, const N: usize> DeserializableSlice<N> for T where
T: Serializable<N>,
[src]impl<T, const N: usize> ParseHexStr<N> for T where
T: Serializable<N>,
[src]
impl<T, const N: usize> ParseHexStr<N> for T where
T: Serializable<N>,
[src]pub fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
[src]
Self::Error: BadLength,
Self::Error: InvalidChar,