Struct threshold_crypto::poly::Poly

source ·
pub struct Poly { /* private fields */ }
Expand description

A univariate polynomial in the prime field.

Implementations§

Creates a random polynomial.

Panics

Panics if the degree is too large for the coefficients to fit into a Vec.

Creates a random polynomial. This constructor is identical to the Poly::random() constructor in every way except that this constructor will return an Err where try_random would return an error.

Returns the polynomial with constant value 0.

Returns true if the polynomial is the constant value 0.

Returns the polynomial with constant value 1.

Returns the polynomial with constant value c.

Returns the identity function, i.e. the polynomial “x”.

Returns the (monic) monomial: x.pow(degree).

Returns the unique polynomial f of degree samples.len() - 1 with the given values (x, f(x)).

Returns the degree.

Returns the value at the point i.

Returns the corresponding commitment.

Generates a non-redacted debug string. This method differs from the Debug implementation in that it does leak the secret prime field elements.

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
Performs the += operation. Read more

Creates a new Poly with the same coefficients as another polynomial.

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

A debug statement where the coeff vector of prime field elements has been redacted.

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Executes the destructor for this type. Read more
Converts to this type from the input type.

Creates a new Poly instance from a vector of prime field elements representing the coefficients of the polynomial.

Converts to this type from the input type.
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
Performs the -= operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.