pub struct GVar<'ctx> { /* private fields */ }Expand description
An in circuit representation of a banderwagon point.
Implementations§
Source§impl<'ctx> GVar<'ctx>
impl<'ctx> GVar<'ctx>
Sourcepub fn constant(point: &G) -> Self
pub fn constant(point: &G) -> Self
The in-circuit representation of an out-of-circuit point, as native
constants (its canonical affine coordinates (X/Z, Y/Z)). Folding the
point in as a constant pins its representative, which is what makes
reading a coordinate of a derived point well-defined.
The point is canonicalized first, so the embedded
constants are a function of the group element, not of whichever of its
two affine representatives the caller happens to hold. Two parties folding
in the same element therefore build byte-identical circuits without having
to canonicalize their public inputs themselves.
Sourcepub fn assert_eq(&self, other: &Self)
pub fn assert_eq(&self, other: &Self)
Assert (in circuit) that self and other are the same group element.
Mirrors the out-of-circuit PartialEq for G: two representatives
denote the same quotient element iff x1 * y2 == x2 * y1. Constraining
the affine coordinates directly would be unsound here, because it would
reject the equally-valid twin representative (-x, -y).
Trait Implementations§
Auto Trait Implementations§
impl<'ctx> !RefUnwindSafe for GVar<'ctx>
impl<'ctx> !UnwindSafe for GVar<'ctx>
impl<'ctx> Freeze for GVar<'ctx>
impl<'ctx> Send for GVar<'ctx>
impl<'ctx> Sync for GVar<'ctx>
impl<'ctx> Unpin for GVar<'ctx>
impl<'ctx> UnsafeUnpin for GVar<'ctx>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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