Struct prio::pcp::gadgets::MeanVarUnsigned[][src]

pub struct MeanVarUnsigned<F: FieldElement> { /* fields omitted */ }
Expand description

The gadget for the MeanVarUnsignedVector type. It is not designed for general use.

MeanVarUnsigned is parameterized by a positive integer bits. Its arity is 2*bits+1:

  • The first bits values are interpreted as a vector r_vec.
  • The next bits values are interpreted as a vector x_vec.
  • The last value is interpreted as a singleton x.

The gadget is designed to output x^2 as long as x_vec is a vector comprised of 0s and 1s. It first computes w[l] = p(x_vec[l]) * r_vec[l] for each 0 <= l < bits, where p(x) = x(x-1). It then computes w = w[0] + ... + w[bits-1] and returns w + x^2.

If vec_x[l] == 1 or vec_x[l] == 0, then p(vec_x[l]) == 0; otherwise, p(vec_x[l]) != 0. The validity circuit for MeanVarUnsignedVector sets r_vec[l] = r^(l+1), where r is a uniform random field element. This is ensures that, if p(vec_x[l]) != 0 for some l, then w != 0 with high probability.

Implementations

Constructs a MeanVarUnsigned gadget with parameter bits. num_calls is the number of times this gadget is called by the validity circuit.

Trait Implementations

Evaluates the gadget on input inp and returns the output.

Evaluate the gadget on input of a sequence of polynomials. The output is written to outp.

Returns the arity of the gadget. This is the length of inp passed to call or call_poly. Read more

Returns the circuit’s arithmetic degree. This determines the minimum length the outp buffer passed to call_poly. Read more

This call is used to downcast a Box<dyn Gadget<F>> to a concrete type.

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

Performs the conversion.

Performs the conversion.

Should always be Self

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.