Trait decaf377::FieldExt

source ·
pub trait FieldExt: Sized {
    // Required methods
    fn to_bytes(&self) -> [u8; 32];
    fn from_bytes(bytes: [u8; 32]) -> Result<Self, EncodingError>;
}
Expand description

An extension trait for easy conversion of Fr and Fq elements to and from bytes.

Required Methods§

source

fn to_bytes(&self) -> [u8; 32]

Serializes an element to 32 bytes.

source

fn from_bytes(bytes: [u8; 32]) -> Result<Self, EncodingError>

Deserializes an element from 32 bytes.

Object Safety§

This trait is not object safe.

Implementors§