Struct salty::FieldElement
source · pub struct FieldElement(pub [i64; 16]);
Expand description
Element of the base field of the elliptic curve
Tuple Fields§
§0: [i64; 16]
Trait Implementations§
source§impl<'a, 'b> Add<&'b FieldElement> for &'a FieldElement
impl<'a, 'b> Add<&'b FieldElement> for &'a FieldElement
source§fn add(self, other: &'b FieldElement) -> FieldElement
fn add(self, other: &'b FieldElement) -> FieldElement
Addition of field elements
§type Output = FieldElement
type Output = FieldElement
The resulting type after applying the
+
operator.source§impl<'b> AddAssign<&'b FieldElement> for FieldElement
impl<'b> AddAssign<&'b FieldElement> for FieldElement
source§fn add_assign(&mut self, other: &'b FieldElement)
fn add_assign(&mut self, other: &'b FieldElement)
Performs the
+=
operation. Read moresource§impl Clone for FieldElement
impl Clone for FieldElement
source§fn clone(&self) -> FieldElement
fn clone(&self) -> FieldElement
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ConditionallySelectable for FieldElement
impl ConditionallySelectable for FieldElement
source§impl ConstantTimeEq for FieldElement
impl ConstantTimeEq for FieldElement
source§impl Debug for FieldElement
impl Debug for FieldElement
source§impl Default for FieldElement
impl Default for FieldElement
source§fn default() -> FieldElement
fn default() -> FieldElement
Returns the “default value” for a type. Read more
source§impl FieldImplementation for FieldElement
impl FieldImplementation for FieldElement
source§fn pow2523(&self) -> FieldElement
fn pow2523(&self) -> FieldElement
TODO: figure out why this doesn’t pass the test at the end
const ZERO: Self = _
const ONE: Self = _
const D: Self = _
const D2: Self = _
const EDWARDS_BASEPOINT_X: Self = _
const EDWARDS_BASEPOINT_Y: Self = _
const I: Self = _
const APLUS2_OVER_FOUR: Self = _
const MONTGOMERY_BASEPOINT_U: Self = _
source§fn from_bytes_unchecked(bytes: &[u8; 32]) -> FieldElement
fn from_bytes_unchecked(bytes: &[u8; 32]) -> FieldElement
construct from canonical representation as little-endian bytes
fn inverse(&self) -> FieldElement
source§fn from_unreduced_bytes(bytes: &[u8; 32]) -> Self
fn from_unreduced_bytes(bytes: &[u8; 32]) -> Self
construct from possibly non-canonical representation as little-endian bytes
source§impl<'a, 'b> Mul<&'b FieldElement> for &'a FieldElement
impl<'a, 'b> Mul<&'b FieldElement> for &'a FieldElement
§type Output = FieldElement
type Output = FieldElement
The resulting type after applying the
*
operator.source§fn mul(self, other: &'b FieldElement) -> FieldElement
fn mul(self, other: &'b FieldElement) -> FieldElement
Performs the
*
operation. Read moresource§impl<'b> MulAssign<&'b FieldElement> for FieldElement
impl<'b> MulAssign<&'b FieldElement> for FieldElement
source§fn mul_assign(&mut self, other: &'b FieldElement)
fn mul_assign(&mut self, other: &'b FieldElement)
Performs the
*=
operation. Read moresource§impl<'a> Neg for &'a FieldElement
impl<'a> Neg for &'a FieldElement
source§fn neg(self) -> FieldElement
fn neg(self) -> FieldElement
Subition of field elements
§type Output = FieldElement
type Output = FieldElement
The resulting type after applying the
-
operator.source§impl PartialEq for FieldElement
impl PartialEq for FieldElement
source§impl<'a, 'b> Sub<&'b FieldElement> for &'a FieldElement
impl<'a, 'b> Sub<&'b FieldElement> for &'a FieldElement
source§fn sub(self, other: &'b FieldElement) -> FieldElement
fn sub(self, other: &'b FieldElement) -> FieldElement
Subition of field elements
§type Output = FieldElement
type Output = FieldElement
The resulting type after applying the
-
operator.source§impl<'b> SubAssign<&'b FieldElement> for FieldElement
impl<'b> SubAssign<&'b FieldElement> for FieldElement
source§fn sub_assign(&mut self, other: &'b FieldElement)
fn sub_assign(&mut self, other: &'b FieldElement)
Performs the
-=
operation. Read moresource§impl Zeroize for FieldElement
impl Zeroize for FieldElement
impl Copy for FieldElement
Auto Trait Implementations§
impl RefUnwindSafe for FieldElement
impl Send for FieldElement
impl Sync for FieldElement
impl Unpin for FieldElement
impl UnwindSafe for FieldElement
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