pub struct ElementVar { /* private fields */ }
Expand description
Represents the R1CS equivalent of a decaf377::Element
Generally the suffix -Var
will indicate that the type or variable
represents in R1CS.
Implementations§
Source§impl ElementVar
impl ElementVar
Sourcepub fn compress_to_field(&self) -> Result<FqVar, SynthesisError>
pub fn compress_to_field(&self) -> Result<FqVar, SynthesisError>
R1CS equivalent of Element::vartime_compress_to_field
Sourcepub fn decompress_from_field(s_var: FqVar) -> Result<ElementVar, SynthesisError>
pub fn decompress_from_field(s_var: FqVar) -> Result<ElementVar, SynthesisError>
R1CS equivalent of Encoding::vartime_decompress
Sourcepub fn encode_to_curve(r_var: &FqVar) -> Result<ElementVar, SynthesisError>
pub fn encode_to_curve(r_var: &FqVar) -> Result<ElementVar, SynthesisError>
Maps a field element to a decaf377 ElementVar
suitable for CDH challenges.
Trait Implementations§
Source§impl<'a> Add<&'a ElementVar> for ElementVar
impl<'a> Add<&'a ElementVar> for ElementVar
Source§type Output = ElementVar
type Output = ElementVar
The resulting type after applying the
+
operator.Source§impl Add<Element> for ElementVar
impl Add<Element> for ElementVar
Source§impl Add for ElementVar
impl Add for ElementVar
Source§type Output = ElementVar
type Output = ElementVar
The resulting type after applying the
+
operator.Source§impl<'a> AddAssign<&'a ElementVar> for ElementVar
impl<'a> AddAssign<&'a ElementVar> for ElementVar
Source§fn add_assign(&mut self, rhs: &'a ElementVar)
fn add_assign(&mut self, rhs: &'a ElementVar)
Performs the
+=
operation. Read moreSource§impl AddAssign<Element> for ElementVar
impl AddAssign<Element> for ElementVar
Source§fn add_assign(&mut self, rhs: Element)
fn add_assign(&mut self, rhs: Element)
Performs the
+=
operation. Read moreSource§impl AddAssign for ElementVar
impl AddAssign for ElementVar
Source§fn add_assign(&mut self, rhs: ElementVar)
fn add_assign(&mut self, rhs: ElementVar)
Performs the
+=
operation. Read moreSource§impl Clone for ElementVar
impl Clone for ElementVar
Source§fn clone(&self) -> ElementVar
fn clone(&self) -> ElementVar
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ElementVar
impl Debug for ElementVar
Source§impl<'a> Sub<&'a ElementVar> for ElementVar
impl<'a> Sub<&'a ElementVar> for ElementVar
Source§type Output = ElementVar
type Output = ElementVar
The resulting type after applying the
-
operator.Source§impl Sub<Element> for ElementVar
impl Sub<Element> for ElementVar
Source§impl Sub for ElementVar
impl Sub for ElementVar
Source§type Output = ElementVar
type Output = ElementVar
The resulting type after applying the
-
operator.Source§impl<'a> SubAssign<&'a ElementVar> for ElementVar
impl<'a> SubAssign<&'a ElementVar> for ElementVar
Source§fn sub_assign(&mut self, rhs: &'a ElementVar)
fn sub_assign(&mut self, rhs: &'a ElementVar)
Performs the
-=
operation. Read moreSource§impl SubAssign<Element> for ElementVar
impl SubAssign<Element> for ElementVar
Source§fn sub_assign(&mut self, rhs: Element)
fn sub_assign(&mut self, rhs: Element)
Performs the
-=
operation. Read moreSource§impl SubAssign for ElementVar
impl SubAssign for ElementVar
Source§fn sub_assign(&mut self, rhs: ElementVar)
fn sub_assign(&mut self, rhs: ElementVar)
Performs the
-=
operation. Read moreimpl<'a> GroupOpsBounds<'a, Element, ElementVar> for ElementVar
Auto Trait Implementations§
impl !Freeze for ElementVar
impl !RefUnwindSafe for ElementVar
impl !Send for ElementVar
impl !Sync for ElementVar
impl Unpin for ElementVar
impl !UnwindSafe for ElementVar
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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