Trait vsss_rs::Polynomial

source ·
pub trait Polynomial<F: PrimeField> {
    // Required methods
    fn create(size_hint: usize) -> Self;
    fn coefficients(&self) -> &[F];
    fn coefficients_mut(&mut self) -> &mut [F];

    // Provided methods
    fn fill(
        &mut self,
        intercept: F,
        rng: impl RngCore + CryptoRng,
        length: usize
    ) -> VsssResult<()> { ... }
    fn evaluate(&self, x: F, threshold: usize) -> F { ... }
}
Expand description

The polynomial used for generating the shares

Required Methods§

source

fn create(size_hint: usize) -> Self

Create a new polynomial with a size hint

source

fn coefficients(&self) -> &[F]

Return the coefficients of the polynomial

source

fn coefficients_mut(&mut self) -> &mut [F]

Return the mutable coefficients of the polynomial

Provided Methods§

source

fn fill( &mut self, intercept: F, rng: impl RngCore + CryptoRng, length: usize ) -> VsssResult<()>

Generate the polynomial coefficients

source

fn evaluate(&self, x: F, threshold: usize) -> F

Evaluate the polynomial with the specified x

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<F: PrimeField> Polynomial<F> for Vec<F>

source§

fn create(size_hint: usize) -> Self

source§

fn coefficients(&self) -> &[F]

source§

fn coefficients_mut(&mut self) -> &mut [F]

source§

impl<F: PrimeField, L: ArrayLength> Polynomial<F> for GenericArray<F, L>

source§

fn create(_size_hint: usize) -> Self

source§

fn coefficients(&self) -> &[F]

source§

fn coefficients_mut(&mut self) -> &mut [F]

source§

impl<F: PrimeField, const L: usize> Polynomial<F> for [F; L]

source§

fn create(_size_hint: usize) -> Self

source§

fn coefficients(&self) -> &[F]

source§

fn coefficients_mut(&mut self) -> &mut [F]

Implementors§