pub struct FieldElement(/* private fields */);
Expand description
P-192 field element representing values in š½ā, where p = 2¹ā¹Ā² ā 2ā¶ā“ ā 1. Internally stored as 6 littleāendian 32ābit limbs.
Implementations§
Source§impl FieldElement
impl FieldElement
Sourcepub fn from_bytes(bytes: &[u8; 24]) -> Result<Self>
pub fn from_bytes(bytes: &[u8; 24]) -> Result<Self>
Create a field element from bigāendian bytes. Validates that the value < p. Returns Err if ā„ p.
Sourcepub fn mul(&self, other: &Self) -> Self
pub fn mul(&self, other: &Self) -> Self
Field multiplication: (self * other) mod p Implements schoolbook 6Ć6 ā 12ālimb product, then reduction
Trait Implementations§
Source§impl Clone for FieldElement
impl Clone for FieldElement
Source§fn clone(&self) -> FieldElement
fn clone(&self) -> FieldElement
Returns a duplicate 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 Debug for FieldElement
impl Debug for FieldElement
Source§impl PartialEq for FieldElement
impl PartialEq for FieldElement
impl Eq for FieldElement
impl StructuralPartialEq for FieldElement
Auto Trait Implementations§
impl Freeze for FieldElement
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