logo

Struct fullcodec_plonk::plonkup::MultiSet[][src]

pub struct MultiSet(pub Vec<BlsScalar>);
Expand description

MultiSet is struct containing vectors of scalars, which individually represents either a wire value or an index of a Plonkup table

Tuple Fields

0: Vec<BlsScalar>

Implementations

Creates an empty vector with a multiset wrapper around it

Generate a MultiSet struct from a slice of bytes.

Given a MultiSet, return it in it’s bytes representation element by element.

Extends the length of the multiset to n elements The n will be the size of the arithmetic circuit. This will extend the vectors to the size

Pushes chosen value onto the end of the Multiset

Fetches last element in MultiSet. Returns None if there are no elements in the MultiSet.

Returns the cardinality of the multiset

Returns whether or not the multiset is empty.

Returns the position of the element in the Multiset. Returns None if the element is not found.

Concatenates and sorts two Multisets together. From the Plonkup paper, if we have t: {1,2,4,3} and f: {2,3,4,1}. We first check if all elements of f exist in t Then we combine the multisets together and sort their elements together. The final MultiSet will look as follows, s: {1,1,2,2,3,3,4,4}

Checks whether one mutltiset is a subset of another. This function will be used to check if the all elements in set f, from the paper, are contained inside t.

Checks if an element is in the MultiSet

Splits a multiset into halves as specified by the paper The last element of the first half should be the same as the first element of the second half. Since a multiset can never have an even cardinality, we always split it in the way described above.

Splits a multiset into alternating halves of the same length as specified in the Plonkup paper. A multiset must have even cardinality to be split in this manner.

Turn three multisets into a single multiset using a random challenge, Alpha. Alpha is dervived by hashing the transcript. The function iterates over the given sets and mutiplies by alpha: a + (b * alpha) + (c * alpha^2)

Turn four multisets into a single multiset using a random challenge, Alpha. Alpha is dervived by hashing the transcript. The function iterates over the given sets and mutiplies by alpha: a + (b * alpha) + (c * alpha^2) + (d * alpha^3)

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

The resulting type after applying the * operator.

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 !=.

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.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.