pub struct Point<E: JubjubEngine, Subgroup> { /* private fields */ }
Implementations§
Source§impl<E: JubjubEngine> Point<E, Unknown>
impl<E: JubjubEngine> Point<E, Unknown>
pub fn read<R: Read>(reader: R, params: &E::Params) -> Result<Self>
pub fn from_xy(x: E::Fr, y: E::Fr, params: &E::Params) -> Option<Self>
pub fn from_xy_unchecked(x: E::Fr, y: E::Fr, params: &E::Params) -> (Self, bool)
pub fn get_for_y(y: E::Fr, sign: bool, params: &E::Params) -> Option<Self>
pub fn compress_into_y(&self) -> (E::Fr, bool)
Sourcepub fn mul_by_cofactor(&self, params: &E::Params) -> Point<E, PrimeOrder>
pub fn mul_by_cofactor(&self, params: &E::Params) -> Point<E, PrimeOrder>
This guarantees the point is in the prime order subgroup
pub fn rand<R: Rng>(rng: &mut R, params: &E::Params) -> Self
Source§impl<E: JubjubEngine, Subgroup> Point<E, Subgroup>
impl<E: JubjubEngine, Subgroup> Point<E, Subgroup>
pub fn write<W: Write>(&self, writer: W) -> Result<()>
Sourcepub fn from_montgomery(m: &Point<E, Subgroup>, params: &E::Params) -> Self
pub fn from_montgomery(m: &Point<E, Subgroup>, params: &E::Params) -> Self
Convert from a Montgomery point
Sourcepub fn as_prime_order(&self, params: &E::Params) -> Option<Point<E, PrimeOrder>>
pub fn as_prime_order(&self, params: &E::Params) -> Option<Point<E, PrimeOrder>>
Attempts to cast this as a prime order element, failing if it’s not in the prime order subgroup.
pub fn zero() -> Self
pub fn into_xy(&self) -> (E::Fr, E::Fr)
pub fn negate(&self) -> Self
pub fn double(&self, _: &E::Params) -> Self
pub fn add(&self, other: &Self, params: &E::Params) -> Self
pub fn mul<S: Into<<E::Fs as PrimeField>::Repr>>( &self, scalar: S, params: &E::Params, ) -> Self
Trait Implementations§
Source§impl<E: JubjubEngine, Subgroup> Clone for Point<E, Subgroup>
impl<E: JubjubEngine, Subgroup> Clone for Point<E, Subgroup>
Source§impl<'de, E: JubjubEngine, Subgroup> Deserialize<'de> for Point<E, Subgroup>where
E::Fr: Deserialize<'de>,
impl<'de, E: JubjubEngine, Subgroup> Deserialize<'de> for Point<E, Subgroup>where
E::Fr: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<E: JubjubEngine> From<Point<E, PrimeOrder>> for Point<E, Unknown>
impl<E: JubjubEngine> From<Point<E, PrimeOrder>> for Point<E, Unknown>
Source§impl<E: JubjubEngine, Subgroup> PartialEq for Point<E, Subgroup>
impl<E: JubjubEngine, Subgroup> PartialEq for Point<E, Subgroup>
Auto Trait Implementations§
impl<E, Subgroup> Freeze for Point<E, Subgroup>
impl<E, Subgroup> RefUnwindSafe for Point<E, Subgroup>
impl<E, Subgroup> Send for Point<E, Subgroup>where
Subgroup: Send,
impl<E, Subgroup> Sync for Point<E, Subgroup>where
Subgroup: Sync,
impl<E, Subgroup> Unpin for Point<E, Subgroup>
impl<E, Subgroup> UnwindSafe for Point<E, Subgroup>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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