Struct fullcodec_plonk::plonkup::MultiSet [−][src]
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
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
Fetches last element in MultiSet. Returns None if there are no elements in the MultiSet.
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.
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
Auto Trait Implementations
impl RefUnwindSafe for MultiSet
impl UnwindSafe for MultiSet
Blanket Implementations
Mutably borrows from an owned value. Read more