pub struct Fs(/* private fields */);
Expand description
This is an element of the scalar field of the Jubjub curve.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Fs
impl<'de> Deserialize<'de> for Fs
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 Field for Fs
impl Field for Fs
Source§fn add_assign(&mut self, other: &Fs)
fn add_assign(&mut self, other: &Fs)
Adds another element to this element.
Source§fn sub_assign(&mut self, other: &Fs)
fn sub_assign(&mut self, other: &Fs)
Subtracts another element from this element.
Source§fn inverse(&self) -> Option<Self>
fn inverse(&self) -> Option<Self>
Computes the multiplicative inverse of this element, if nonzero.
Source§fn frobenius_map(&mut self, _: usize)
fn frobenius_map(&mut self, _: usize)
Exponentiates this element by a power of the base prime modulus via
the Frobenius automorphism.
Source§fn mul_assign(&mut self, other: &Fs)
fn mul_assign(&mut self, other: &Fs)
Multiplies another element by this element.
Source§impl PrimeField for Fs
impl PrimeField for Fs
Source§const CAPACITY: u32 = 251u32
const CAPACITY: u32 = 251u32
How many bits of information can be reliably stored in the field element.
Source§type Repr = FsRepr
type Repr = FsRepr
The prime field can be converted back and forth into this biginteger
representation.
Source§fn from_repr(r: FsRepr) -> Result<Fs, PrimeFieldDecodingError>
fn from_repr(r: FsRepr) -> Result<Fs, PrimeFieldDecodingError>
Convert this prime field element into a biginteger representation.
Source§fn from_raw_repr(r: FsRepr) -> Result<Fs, PrimeFieldDecodingError>
fn from_raw_repr(r: FsRepr) -> Result<Fs, PrimeFieldDecodingError>
Creates an element from raw representation in Montgommery form.
Source§fn into_repr(&self) -> FsRepr
fn into_repr(&self) -> FsRepr
Convert a biginteger representation into a prime field element, if
the number is an element of the field.
Source§fn into_raw_repr(&self) -> FsRepr
fn into_raw_repr(&self) -> FsRepr
Expose Montgommery represendation.
Source§fn multiplicative_generator() -> Self
fn multiplicative_generator() -> Self
Returns the multiplicative generator of
char()
- 1 order. This element
must also be quadratic nonresidue.Source§fn root_of_unity() -> Self
fn root_of_unity() -> Self
Returns the 2^s root of unity computed by exponentiating the
multiplicative_generator()
by t.Source§impl ToUniform for Fs
impl ToUniform for Fs
Source§fn to_uniform(digest: &[u8]) -> Self
fn to_uniform(digest: &[u8]) -> Self
Convert a little endian byte string into a uniform field element. The number is reduced mod s. The caller is responsible for ensuring the input is 64 bytes of Random Oracle output.
Source§fn to_uniform_32(digest: &[u8]) -> Self
fn to_uniform_32(digest: &[u8]) -> Self
Convert a little endian byte string into a uniform field element. The number is reduced mod s. The caller is responsible for ensuring the input is 32 bytes of Random Oracle output.
impl Copy for Fs
impl Eq for Fs
impl StructuralPartialEq for Fs
Auto Trait Implementations§
impl Freeze for Fs
impl RefUnwindSafe for Fs
impl Send for Fs
impl Sync for Fs
impl Unpin for Fs
impl UnwindSafe for Fs
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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