pub struct PubKeyPoly(pub Polynomial<FalconFelt>);
Tuple Fields§
§0: Polynomial<FalconFelt>
Methods from Deref<Target = Polynomial<FalconFelt>>§
pub fn hadamard_mul(&self, other: &Self) -> Self
pub fn hadamard_div(&self, other: &Self) -> Self
pub fn hadamard_inv(&self) -> Self
pub fn degree(&self) -> Option<usize>
pub fn lc(&self) -> F
sourcepub fn reduce_by_cyclotomic(&self, n: usize) -> Self
pub fn reduce_by_cyclotomic(&self, n: usize) -> Self
Reduce the polynomial by X^n + 1.
sourcepub fn field_norm(&self) -> Self
pub fn field_norm(&self) -> Self
Computes the field norm of the polynomial as an element of the cyclotomic ring F[ X ] / <X^n + 1 > relative to one of half the size, i.e., F[ X ] / <X^(n/2) + 1> .
Corresponds to formula 3.25 in the spec [1, p.30].
sourcepub fn lift_next_cyclotomic(&self) -> Self
pub fn lift_next_cyclotomic(&self) -> Self
Lifts an element from a cyclotomic polynomial ring to one of double the size.
sourcepub fn galois_adjoint(&self) -> Self
pub fn galois_adjoint(&self) -> Self
Computes the galois adjoint of the polynomial in the cyclotomic ring F[ X ] / < X^n + 1 > , which corresponds to f(x^2).
sourcepub fn karatsuba(&self, other: &Self) -> Self
pub fn karatsuba(&self, other: &Self) -> Self
Multiply two polynomials using Karatsuba’s divide-and-conquer algorithm.
pub fn shift(&self, shamt: usize) -> Self
pub fn map<G: Clone, C: FnMut(&F) -> G>(&self, closure: C) -> Polynomial<G>
pub fn fold<G, C: FnMut(G, &F) -> G + Clone>( &self, initial_value: G, closure: C, ) -> G
pub fn norm_squared(&self) -> u64
sourcepub fn to_elements(&self) -> Vec<Felt>
pub fn to_elements(&self) -> Vec<Felt>
Returns the coefficients of this polynomial as field elements.
Trait Implementations§
source§impl Clone for PubKeyPoly
impl Clone for PubKeyPoly
source§fn clone(&self) -> PubKeyPoly
fn clone(&self) -> PubKeyPoly
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 Debug for PubKeyPoly
impl Debug for PubKeyPoly
source§impl Deref for PubKeyPoly
impl Deref for PubKeyPoly
source§impl Deserializable for PubKeyPoly
impl Deserializable for PubKeyPoly
source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
Reads a sequence of bytes from the provided
source
, attempts to deserialize these bytes
into Self
, and returns the result. Read moresource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
source§impl From<Polynomial<FalconFelt>> for PubKeyPoly
impl From<Polynomial<FalconFelt>> for PubKeyPoly
source§fn from(pk_poly: Polynomial<FalconFelt>) -> Self
fn from(pk_poly: Polynomial<FalconFelt>) -> Self
Converts to this type from the input type.
source§impl From<PubKeyPoly> for PublicKey
impl From<PubKeyPoly> for PublicKey
source§fn from(pk_poly: PubKeyPoly) -> Self
fn from(pk_poly: PubKeyPoly) -> Self
Converts to this type from the input type.
source§impl PartialEq for PubKeyPoly
impl PartialEq for PubKeyPoly
source§impl Serializable for &PubKeyPoly
impl Serializable for &PubKeyPoly
source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self
into bytes and writes these bytes into the target
.source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
impl Eq for PubKeyPoly
impl StructuralPartialEq for PubKeyPoly
Auto Trait Implementations§
impl Freeze for PubKeyPoly
impl RefUnwindSafe for PubKeyPoly
impl Send for PubKeyPoly
impl Sync for PubKeyPoly
impl Unpin for PubKeyPoly
impl UnwindSafe for PubKeyPoly
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)