pub struct LagrangePolynomial<I, O> {
pub evaluations: Vec<Evaluation<I, O>>,
}Fields§
§evaluations: Vec<Evaluation<I, O>>Implementations§
Source§impl<I, O> LagrangePolynomial<I, O>
impl<I, O> LagrangePolynomial<I, O>
Sourcepub fn new(evaluations: Vec<Evaluation<I, O>>) -> Self
pub fn new(evaluations: Vec<Evaluation<I, O>>) -> Self
The evaluations are expected to have distinct input values. If two or more evaluations reuse the same input, evaluation and share-issuance will cause panics.
Source§impl LagrangePolynomial<MaybeScalar, MaybeScalar>
impl LagrangePolynomial<MaybeScalar, MaybeScalar>
Issue a share at the given input x.
Source§impl LagrangePolynomial<MaybeScalar, MaybePoint>
impl LagrangePolynomial<MaybeScalar, MaybePoint>
Issue a share at the given input x.
Source§impl LagrangePolynomial<MaybeScalar, MaybePoint>
impl LagrangePolynomial<MaybeScalar, 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 Mul<&LagrangePolynomial<MaybeScalar, MaybeScalar>> for G
Allows multiplying an interpolated secret-sharing polynomial by the secp256k1 generator point.
impl Mul<&LagrangePolynomial<MaybeScalar, MaybeScalar>> for G
Allows multiplying an interpolated secret-sharing polynomial by the secp256k1 generator point.
Source§type Output = LagrangePolynomial<MaybeScalar, MaybePoint>
type Output = LagrangePolynomial<MaybeScalar, MaybePoint>
The resulting type after applying the
* operator.Source§impl Mul<&LagrangePolynomial<MaybeScalar, MaybeScalar>> for Point
Allows multiplying an interpolated secret-sharing polynomial by a given fixed point.
impl Mul<&LagrangePolynomial<MaybeScalar, MaybeScalar>> for Point
Allows multiplying an interpolated secret-sharing polynomial by a given fixed point.
Source§type Output = LagrangePolynomial<MaybeScalar, MaybePoint>
type Output = LagrangePolynomial<MaybeScalar, MaybePoint>
The resulting type after applying the
* operator.Source§impl Mul<LagrangePolynomial<MaybeScalar, MaybeScalar>> for G
impl Mul<LagrangePolynomial<MaybeScalar, MaybeScalar>> for G
Source§type Output = LagrangePolynomial<MaybeScalar, MaybePoint>
type Output = LagrangePolynomial<MaybeScalar, MaybePoint>
The resulting type after applying the
* operator.Source§impl Mul<LagrangePolynomial<MaybeScalar, MaybeScalar>> for Point
impl Mul<LagrangePolynomial<MaybeScalar, MaybeScalar>> for Point
Source§type Output = LagrangePolynomial<MaybeScalar, MaybePoint>
type Output = LagrangePolynomial<MaybeScalar, MaybePoint>
The resulting type after applying the
* operator.Source§impl<I, O> Polynomial<I, O> for LagrangePolynomial<I, O>
impl<I, O> Polynomial<I, O> for LagrangePolynomial<I, O>
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.
Auto Trait Implementations§
impl<I, O> Freeze for LagrangePolynomial<I, O>
impl<I, O> RefUnwindSafe for LagrangePolynomial<I, O>where
I: RefUnwindSafe,
O: RefUnwindSafe,
impl<I, O> Send for LagrangePolynomial<I, O>
impl<I, O> Sync for LagrangePolynomial<I, O>
impl<I, O> Unpin for LagrangePolynomial<I, O>
impl<I, O> UnwindSafe for LagrangePolynomial<I, O>where
I: UnwindSafe,
O: 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