pub struct FieldElement(/* private fields */);
Expand description
secp256k1 field element representing values in F_p
Implementations§
Source§impl FieldElement
impl FieldElement
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<Self>
pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self>
Create a field element from its canonical byte representation.
Returns an error if the value is greater than or equal to the field modulus.
Sourcepub fn to_bytes(&self) -> [u8; 32]
pub fn to_bytes(&self) -> [u8; 32]
Convert this field element to its canonical byte representation.
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