pub struct StandardFormPolynomial<T> {
pub coefficients: Vec<T>,
}
Expand description
Represents a polynomial function expressed in standard form with
coefficients of type T
.
Fields§
§coefficients: Vec<T>
The ordered set of coefficients, starting with the constant term.
Implementations§
Source§impl<T> StandardFormPolynomial<T>
impl<T> StandardFormPolynomial<T>
Source§impl StandardFormPolynomial<MaybeScalar>
impl StandardFormPolynomial<MaybeScalar>
Issue a share at the given input x
.
Source§impl StandardFormPolynomial<MaybePoint>
impl StandardFormPolynomial<MaybePoint>
Issue a share at the given input x
.
Source§impl StandardFormPolynomial<MaybePoint>
impl StandardFormPolynomial<MaybePoint>
Sourcepub fn derive_secret(&self, x: MaybeScalar) -> [u8; 32]
pub fn derive_secret(&self, x: MaybeScalar) -> [u8; 32]
Derive a secret c
by hashing the output point produced by
evaluating the polynomial on x
.
Trait Implementations§
Source§impl<T: Clone> Clone for StandardFormPolynomial<T>
impl<T: Clone> Clone for StandardFormPolynomial<T>
Source§fn clone(&self) -> StandardFormPolynomial<T>
fn clone(&self) -> StandardFormPolynomial<T>
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<T: Debug> Debug for StandardFormPolynomial<T>
impl<T: Debug> Debug for StandardFormPolynomial<T>
Source§impl<T: Default> Default for StandardFormPolynomial<T>
impl<T: Default> Default for StandardFormPolynomial<T>
Source§fn default() -> StandardFormPolynomial<T>
fn default() -> StandardFormPolynomial<T>
Returns the “default value” for a type. Read more
Source§impl<T: Hash> Hash for StandardFormPolynomial<T>
impl<T: Hash> Hash for StandardFormPolynomial<T>
Source§impl Mul<&StandardFormPolynomial<MaybeScalar>> for G
Allows multiplying a secret sharing polynomial by the secp256k1 generator point.
impl Mul<&StandardFormPolynomial<MaybeScalar>> for G
Allows multiplying a secret sharing polynomial by the secp256k1 generator point.
Source§type Output = StandardFormPolynomial<MaybePoint>
type Output = StandardFormPolynomial<MaybePoint>
The resulting type after applying the
*
operator.Source§impl Mul<&StandardFormPolynomial<MaybeScalar>> for Point
Allows multiplying a secret sharing polynomial by a given fixed point.
impl Mul<&StandardFormPolynomial<MaybeScalar>> for Point
Allows multiplying a secret sharing polynomial by a given fixed point.
Source§type Output = StandardFormPolynomial<MaybePoint>
type Output = StandardFormPolynomial<MaybePoint>
The resulting type after applying the
*
operator.Source§impl Mul<StandardFormPolynomial<MaybeScalar>> for G
impl Mul<StandardFormPolynomial<MaybeScalar>> for G
Source§type Output = StandardFormPolynomial<MaybePoint>
type Output = StandardFormPolynomial<MaybePoint>
The resulting type after applying the
*
operator.Source§impl Mul<StandardFormPolynomial<MaybeScalar>> for Point
impl Mul<StandardFormPolynomial<MaybeScalar>> for Point
Source§type Output = StandardFormPolynomial<MaybePoint>
type Output = StandardFormPolynomial<MaybePoint>
The resulting type after applying the
*
operator.Source§impl<T: PartialEq> PartialEq for StandardFormPolynomial<T>
impl<T: PartialEq> PartialEq for StandardFormPolynomial<T>
Source§impl<I, T> Polynomial<I, T> for StandardFormPolynomial<T>
impl<I, T> Polynomial<I, T> for StandardFormPolynomial<T>
Source§fn degree(&self) -> usize
fn degree(&self) -> usize
Returns the degree of the polynomial, which is usually the number of coefficients
minus 1. If the polynomial has no coefficients, it has degree zero.
Source§fn interpolation_threshold(&self) -> usize
fn interpolation_threshold(&self) -> usize
Returns the number of evaluations needed to interpolate this polynomial,
which is just the number of coefficients in the polynomial.
impl<T: Eq> Eq for StandardFormPolynomial<T>
impl<T> StructuralPartialEq for StandardFormPolynomial<T>
Auto Trait Implementations§
impl<T> Freeze for StandardFormPolynomial<T>
impl<T> RefUnwindSafe for StandardFormPolynomial<T>where
T: RefUnwindSafe,
impl<T> Send for StandardFormPolynomial<T>where
T: Send,
impl<T> Sync for StandardFormPolynomial<T>where
T: Sync,
impl<T> Unpin for StandardFormPolynomial<T>where
T: Unpin,
impl<T> UnwindSafe for StandardFormPolynomial<T>where
T: UnwindSafe,
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