pub struct F { /* private fields */ }Expand description
A scalar exponent for the Banderwagon group G: an element of the scalar
field Z/r, where r is the prime group order.
Stored as a canonical little-endian integer in [0, r). The in-circuit
secret is witnessed directly as its bits (F::BITS of them,
enough to cover all of [0, r)), with no recomposition or canonicity
constraint (see G::scalar_mul_bits): the bits simply are the exponent.
A witnessed bit pattern is not itself constrained to [0, r) and so may
exceed r, but that is harmless: every use feeds the bits into a group
scalar multiplication, which is well-defined modulo r, so any alias of the
same residue yields the same result.
Implementations§
Trait Implementations§
Source§impl<'a> AddAssign<&'a F> for F
impl<'a> AddAssign<&'a F> for F
Source§fn add_assign(&mut self, rhs: &'a Self)
fn add_assign(&mut self, rhs: &'a Self)
Performs the
+= operation. Read moreimpl Eq for F
Source§impl<'a> MulAssign<&'a F> for F
impl<'a> MulAssign<&'a F> for F
Source§fn mul_assign(&mut self, rhs: &'a Self)
fn mul_assign(&mut self, rhs: &'a Self)
Performs the
*= operation. Read moreSource§impl<'a> MulAssign<&'a F> for G
impl<'a> MulAssign<&'a F> for G
Source§fn mul_assign(&mut self, rhs: &'a F)
fn mul_assign(&mut self, rhs: &'a F)
Performs the
*= operation. Read moreSource§impl Multiplicative for F
impl Multiplicative for F
impl Object for F
Source§impl Read for F
impl Read for F
impl StructuralPartialEq for F
Source§impl<'a> SubAssign<&'a F> for F
impl<'a> SubAssign<&'a F> for F
Source§fn sub_assign(&mut self, rhs: &'a Self)
fn sub_assign(&mut self, rhs: &'a Self)
Performs the
-= operation. Read moreSource§impl Write for F
impl Write for F
Source§fn write_bufs(&self, buf: &mut impl BufsMut)
fn write_bufs(&self, buf: &mut impl BufsMut)
Writes to a
BufsMut, allowing existing Bytes chunks to be
appended via BufsMut::push instead of written inline. Must encode
to the same format as Write::write. Defaults to Write::write.Auto Trait Implementations§
impl Freeze for F
impl RefUnwindSafe for F
impl Send for F
impl Sync for F
impl Unpin for F
impl UnsafeUnpin for F
impl UnwindSafe for F
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> Codec for T
impl<T> CodecFixed for T
Source§impl<T> DecodeFixed for T
impl<T> DecodeFixed for T
Source§impl<T> Encode for Twhere
T: Write + EncodeSize,
impl<T> Encode for Twhere
T: Write + EncodeSize,
Source§impl<T> EncodeFixed for T
impl<T> EncodeFixed for T
Source§impl<T> EncodeSize for Twhere
T: FixedSize,
impl<T> EncodeSize for Twhere
T: FixedSize,
Source§fn encode_size(&self) -> usize
fn encode_size(&self) -> usize
Returns the encoded size of this value (in bytes).
fn encode_size_slice(values: &[T]) -> usizewhere
T: Sized,
fn encode_inline_size_slice(values: &[T]) -> usizewhere
T: Sized,
Source§fn encode_inline_size(&self) -> usize
fn encode_inline_size(&self) -> usize
Returns the encoded size excluding bytes passed to
BufsMut::push
during Write::write_bufs. Used to size the working buffer for inline
writes. Override alongside Write::write_bufs for types where large
Bytes fields go via push; failing to do so will over-allocate.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
impl<T, Rhs, Output> GroupOpsOwned<Rhs, Output> for T
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>
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