pub type NoteCommitmentUpdate = Fq;
Expand description
The type that is used to update the note commitment tree.
Unfortunately, this is not the same as sapling::NoteCommitment
.
Aliased Type§
struct NoteCommitmentUpdate(/* private fields */);
Implementations
§impl Scalar
impl Scalar
pub const fn zero() -> Scalar
pub const fn zero() -> Scalar
Returns zero, the additive identity.
pub const fn one() -> Scalar
pub const fn one() -> Scalar
Returns one, the multiplicative identity.
pub const fn double(&self) -> Scalar
pub const fn double(&self) -> Scalar
Doubles this field element.
pub fn from_bytes(bytes: &[u8; 32]) -> CtOption<Scalar>
pub fn from_bytes(bytes: &[u8; 32]) -> CtOption<Scalar>
Attempts to convert a little-endian byte representation of
a scalar into a Scalar
, failing if the input is not canonical.
pub fn to_bytes(&self) -> [u8; 32]
pub fn to_bytes(&self) -> [u8; 32]
Converts an element of Scalar
into a byte representation in
little-endian byte order.
pub fn from_bytes_wide(bytes: &[u8; 64]) -> Scalar
pub fn from_bytes_wide(bytes: &[u8; 64]) -> Scalar
Converts a 512-bit little endian integer into
a Scalar
by reducing by the modulus.
pub const fn from_raw(val: [u64; 4]) -> Scalar
pub const fn from_raw(val: [u64; 4]) -> Scalar
Converts from an integer represented in little endian
into its (congruent) Scalar
representation.
pub const fn square(&self) -> Scalar
pub const fn square(&self) -> Scalar
Squares this element.
pub fn pow(&self, by: &[u64; 4]) -> Scalar
pub fn pow(&self, by: &[u64; 4]) -> Scalar
Exponentiates self
by by
, where by
is a
little-endian order integer exponent.
pub fn pow_vartime(&self, by: &[u64; 4]) -> Scalar
pub fn pow_vartime(&self, by: &[u64; 4]) -> Scalar
Exponentiates self
by by
, where by
is a
little-endian order integer exponent.
This operation is variable time with respect to the exponent. If the exponent is fixed, this operation is effectively constant time.
pub fn invert(&self) -> CtOption<Scalar>
pub fn invert(&self) -> CtOption<Scalar>
Computes the multiplicative inverse of this element, failing if the element is zero.
pub const fn mul(&self, rhs: &Scalar) -> Scalar
pub const fn mul(&self, rhs: &Scalar) -> Scalar
Multiplies rhs
by self
, returning the result.
pub const fn sub(&self, rhs: &Scalar) -> Scalar
pub const fn sub(&self, rhs: &Scalar) -> Scalar
Subtracts rhs
from self
, returning the result.
pub const fn add(&self, rhs: &Scalar) -> Scalar
pub const fn add(&self, rhs: &Scalar) -> Scalar
Adds rhs
to self
, returning the result.
pub const fn neg(&self) -> Scalar
pub const fn neg(&self) -> Scalar
Negates self
.
Trait Implementations
§impl<'b> AddAssign<&'b Scalar> for Scalar
impl<'b> AddAssign<&'b Scalar> for Scalar
§fn add_assign(&mut self, rhs: &'b Scalar)
fn add_assign(&mut self, rhs: &'b Scalar)
+=
operation. Read more§impl AddAssign for Scalar
impl AddAssign for Scalar
§fn add_assign(&mut self, rhs: Scalar)
fn add_assign(&mut self, rhs: Scalar)
+=
operation. Read more§impl ConditionallySelectable for Scalar
impl ConditionallySelectable for Scalar
§fn conditional_select(a: &Scalar, b: &Scalar, choice: Choice) -> Scalar
fn conditional_select(a: &Scalar, b: &Scalar, choice: Choice) -> Scalar
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
self
and other
if choice == 1
; otherwise,
reassign both unto themselves. Read more§impl ConstantTimeEq for Scalar
impl ConstantTimeEq for Scalar
§impl Field for Scalar
impl Field for Scalar
§fn random(rng: impl RngCore) -> Scalar
fn random(rng: impl RngCore) -> Scalar
§fn invert(&self) -> CtOption<Scalar>
fn invert(&self) -> CtOption<Scalar>
§fn sqrt_ratio(num: &Scalar, div: &Scalar) -> (Choice, Scalar)
fn sqrt_ratio(num: &Scalar, div: &Scalar) -> (Choice, Scalar)
§fn sqrt(&self) -> CtOption<Scalar>
fn sqrt(&self) -> CtOption<Scalar>
§fn is_zero_vartime(&self) -> bool
fn is_zero_vartime(&self) -> bool
§fn pow_vartime<S>(&self, exp: S) -> Self
fn pow_vartime<S>(&self, exp: S) -> Self
§impl<'b> MulAssign<&'b Scalar> for Scalar
impl<'b> MulAssign<&'b Scalar> for Scalar
§fn mul_assign(&mut self, rhs: &'b Scalar)
fn mul_assign(&mut self, rhs: &'b Scalar)
*=
operation. Read more§impl MulAssign for Scalar
impl MulAssign for Scalar
§fn mul_assign(&mut self, rhs: Scalar)
fn mul_assign(&mut self, rhs: Scalar)
*=
operation. Read more§impl PrimeField for Scalar
impl PrimeField for Scalar
§const MODULUS: &'static str = "0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"
const MODULUS: &'static str = "0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"
§const CAPACITY: u32 = 254u32
const CAPACITY: u32 = 254u32
§const MULTIPLICATIVE_GENERATOR: Scalar = GENERATOR
const MULTIPLICATIVE_GENERATOR: Scalar = GENERATOR
modulus - 1
order. This element must also be
a quadratic nonresidue. Read more§const ROOT_OF_UNITY: Scalar = ROOT_OF_UNITY
const ROOT_OF_UNITY: Scalar = ROOT_OF_UNITY
2^s
root of unity. Read more§const ROOT_OF_UNITY_INV: Scalar = ROOT_OF_UNITY_INV
const ROOT_OF_UNITY_INV: Scalar = ROOT_OF_UNITY_INV
Self::ROOT_OF_UNITY
].§type Repr = [u8; 32]
type Repr = [u8; 32]
§fn from_repr(r: <Scalar as PrimeField>::Repr) -> CtOption<Scalar>
fn from_repr(r: <Scalar as PrimeField>::Repr) -> CtOption<Scalar>
§fn to_repr(&self) -> <Scalar as PrimeField>::Repr
fn to_repr(&self) -> <Scalar as PrimeField>::Repr
§fn from_str_vartime(s: &str) -> Option<Self>
fn from_str_vartime(s: &str) -> Option<Self>
§fn from_repr_vartime(repr: Self::Repr) -> Option<Self>
fn from_repr_vartime(repr: Self::Repr) -> Option<Self>
§impl PrimeFieldBits for Scalar
impl PrimeFieldBits for Scalar
§fn to_le_bits(&self) -> BitArray<<Scalar as PrimeFieldBits>::ReprBits>
fn to_le_bits(&self) -> BitArray<<Scalar as PrimeFieldBits>::ReprBits>
§fn char_le_bits() -> BitArray<<Scalar as PrimeFieldBits>::ReprBits>
fn char_le_bits() -> BitArray<<Scalar as PrimeFieldBits>::ReprBits>
§impl<'b> SubAssign<&'b Scalar> for Scalar
impl<'b> SubAssign<&'b Scalar> for Scalar
§fn sub_assign(&mut self, rhs: &'b Scalar)
fn sub_assign(&mut self, rhs: &'b Scalar)
-=
operation. Read more§impl SubAssign for Scalar
impl SubAssign for Scalar
§fn sub_assign(&mut self, rhs: Scalar)
fn sub_assign(&mut self, rhs: Scalar)
-=
operation. Read more