Skip to main content

Bucket

Struct Bucket 

Source
pub struct Bucket<P: SWCurveConfig> {
    pub x: P::BaseField,
    pub y: P::BaseField,
    pub zz: P::BaseField,
    pub zzz: P::BaseField,
}
Expand description

Extended Jacobian coordinates for a point on an elliptic curve in short Weierstrass form, over the base field P::BaseField. This struct implements arithmetic via the extended Jacobian arithmetic outlined here: https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html

Fields§

§x: P::BaseField

X / ZZ projection of the affine X

§y: P::BaseField

Y / ZZZ projection of the affine Y

§zz: P::BaseField

Bucket multiplicative inverse. Will be 0 only at infinity.

§zzz: P::BaseField

Bucket multiplicative inverse. Will be 0 only at infinity.

Implementations§

Source§

impl<P: SWCurveConfig> Bucket<P>

Source

pub const ZERO: Self

Source

pub const fn new_unchecked( x: P::BaseField, y: P::BaseField, zz: P::BaseField, zzz: P::BaseField, ) -> Self

Constructs a new group element without checking whether the coordinates specify a point in the subgroup.

Source

pub fn is_zero(&self) -> bool

Checks whether self.z.is_zero().

Source

pub fn double_in_place(&mut self)

Trait Implementations§

Source§

impl<'a, P: SWCurveConfig> Add<&'a Bucket<P>> for Bucket<P>

Source§

type Output = Bucket<P>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a Self) -> Self

Performs the + operation. Read more
Source§

impl<'a, P: SWCurveConfig> AddAssign<&'a Bucket<P>> for Bucket<P>

Source§

fn add_assign(&mut self, other: &'a Self)

Performs the += operation. Read more
Source§

impl<'a, P: SWCurveConfig> AddAssign<&'a Bucket<P>> for Projective<P>

Source§

fn add_assign(&mut self, other: &'a Bucket<P>)

Performs the += operation. Read more
Source§

impl<P: SWCurveConfig, T: Borrow<Affine<P>>> AddAssign<T> for Bucket<P>

Source§

impl<P: SWCurveConfig> Clone for Bucket<P>
where P::BaseField: Copy,

Source§

fn clone(&self) -> Self

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<P: SWCurveConfig> Debug for Bucket<P>

Source§

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

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

impl<P: SWCurveConfig> Default for Bucket<P>

Source§

fn default() -> Self

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

impl<P: SWCurveConfig> From<Affine<P>> for Bucket<P>

Source§

fn from(p: Affine<P>) -> Self

Converts to this type from the input type.
Source§

impl<P: SWCurveConfig> From<Bucket<P>> for Affine<P>

Source§

fn from(p: Bucket<P>) -> Self

Converts to this type from the input type.
Source§

impl<P: SWCurveConfig> From<Bucket<P>> for Projective<P>

Source§

fn from(p: Bucket<P>) -> Self

Converts to this type from the input type.
Source§

impl<P: SWCurveConfig> Hash for Bucket<P>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<P: SWCurveConfig> Neg for Bucket<P>

Source§

type Output = Bucket<P>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<P: SWCurveConfig> PartialEq for Bucket<P>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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, P: SWCurveConfig> SubAssign<&'a Bucket<P>> for Bucket<P>

Source§

fn sub_assign(&mut self, other: &'a Self)

Performs the -= operation. Read more
Source§

impl<P: SWCurveConfig, T: Borrow<Affine<P>>> SubAssign<T> for Bucket<P>

Source§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
Source§

impl<P: SWCurveConfig> Zeroize for Bucket<P>

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<P: SWCurveConfig> Copy for Bucket<P>
where P::BaseField: Copy,

Source§

impl<P: SWCurveConfig> Eq for Bucket<P>

Auto Trait Implementations§

§

impl<P> Freeze for Bucket<P>
where <P as CurveConfig>::BaseField: Freeze,

§

impl<P> RefUnwindSafe for Bucket<P>

§

impl<P> Send for Bucket<P>

§

impl<P> Sync for Bucket<P>

§

impl<P> Unpin for Bucket<P>
where <P as CurveConfig>::BaseField: Unpin,

§

impl<P> UnsafeUnpin for Bucket<P>

§

impl<P> UnwindSafe for Bucket<P>

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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, 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.
§

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

§

fn vzip(self) -> V