Struct neptune::Scalar[]

pub struct Scalar(_);

Trait Implementations

impl BaseFromRO for Fr

type BaseLength = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>

pub fn from_okm(
    okm: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>
) -> Fr

impl Clone for Fr

pub fn clone(&self) -> Fr

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Fr

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for Fr

pub fn deserialize<D>(d: D) -> Result<Fr, <D as Deserializer<'de>>::Error> where
    D: Deserializer<'de>, 

Deserialize this value from the given Serde deserializer. Read more

impl Display for Fr

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

impl Field for Fr

pub fn random<R>(rng: &mut R) -> Fr where
    R: RngCore

Computes a uniformly random element using rejection sampling.

pub fn zero() -> Fr

Returns the zero element of the field, the additive identity.

pub fn one() -> Fr

Returns the one element of the field, the multiplicative identity.

pub fn is_zero(&self) -> bool

Returns true iff this element is zero.

pub fn add_assign(&mut self, other: &Fr)

Adds another element to this element.

pub fn double(&mut self)

Doubles this element.

pub fn sub_assign(&mut self, other: &Fr)

Subtracts another element from this element.

pub fn negate(&mut self)

Negates this element.

pub fn inverse(&self) -> Option<Fr>

Computes the multiplicative inverse of this element, if nonzero.

pub fn frobenius_map(&mut self, usize)

Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism. Read more

pub fn mul_assign(&mut self, other: &Fr)

Multiplies another element by this element.

pub fn square(&mut self)

Squares this element.

fn pow<S>(&self, exp: S) -> Self where
    S: AsRef<[u64]>, 
[src]

Exponentiates this element by a number represented with u64 limbs, least significant digit first. Read more

impl Ord for Fr

Elements are ordered lexicographically.

pub fn cmp(&self, other: &Fr) -> Ordering

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<Fr> for Fr

pub fn eq(&self, other: &Fr) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialOrd<Fr> for Fr

pub fn partial_cmp(&self, other: &Fr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PrimeField for Fr

type Repr = FrRepr

The prime field can be converted back and forth into this biginteger representation. Read more

pub fn from_repr(r: FrRepr) -> Result<Fr, PrimeFieldDecodingError>

Convert this prime field element into a biginteger representation.

pub fn into_repr(&self) -> FrRepr

Convert a biginteger representation into a prime field element, if the number is an element of the field. Read more

pub fn char() -> FrRepr

Returns the field characteristic; the modulus.

pub const NUM_BITS: u32

How many bits are needed to represent an element of this field.

pub const CAPACITY: u32

How many bits of information can be reliably stored in the field element.

pub fn multiplicative_generator() -> Fr

Returns the multiplicative generator of char() - 1 order. This element must also be quadratic nonresidue. Read more

pub const S: u32

2^s * t = char() - 1 with t odd.

pub fn root_of_unity() -> Fr

Returns the 2^s root of unity computed by exponentiating the multiplicative_generator() by t. Read more

pub fn from_random_bytes(bytes: &[u8]) -> Option<Fr>

fn from_str(s: &str) -> Option<Self>[src]

Interpret a string of numbers as a (congruent) prime field element. Does not accept unnecessary leading zeroes or a blank string. Read more

impl Serialize for Fr

pub fn serialize<S>(
    &self,
    s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
    S: Serializer

Serialize this value into the given Serde serializer. Read more

impl SqrtField for Fr

pub fn legendre(&self) -> LegendreSymbol

Returns the Legendre symbol of the field element.

pub fn sqrt(&self) -> Option<Fr>

Returns the square root of the field element, if it is quadratic residue. Read more

impl Copy for Fr

impl Eq for Fr

Auto Trait Implementations

impl RefUnwindSafe for Fr

impl Send for Fr

impl Sync for Fr

impl Unpin for Fr

impl UnwindSafe for Fr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> FromRO for T where
    T: BaseFromRO, 

type Length = <T as BaseFromRO>::BaseLength

pub fn from_ro(okm: &GenericArray<u8, <T as FromRO>::Length>) -> T

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]