logo

Struct fullcodec_plonk::plonkup::LookupTable[][src]

pub struct LookupTable(pub Vec<[BlsScalar; 4]>);
Expand description

This struct is a table, contaning a vector, of arity 4 where each of the values is a BlsScalar. The elements of the table are determined by the function g for g(x,y), used to compute tuples.

This struct will be used to determine the outputs of gates within arithmetic circuits.

Tuple Fields

0: Vec<[BlsScalar; 4]>

Implementations

Create a new, empty Plonkup table, with arity 4.

Insert a new row for an addition operation. This function needs to know the upper bound of the amount of addition operations that will be done in the plonkup table.

Insert a new row for an addition operation. This function needs to know the upper bound of the amount of addition operations that will be done in the plonkup table.

Insert a new row for an multiplication operation. This function needs to know the upper bound of the amount of multiplication operations that will be done in the plonkup table.

Insert a new row for an XOR operation. This function needs to know the upper bound of the amount of XOR operations that will be done in the plonkup table.

Insert a new row for an AND operation. This function needs to know the upper bound of the amount of XOR operations that will be done in the plonkup table.

Function builds a table from more than one operation. This is denoted as ‘Multiple Tables’ in the paper. If, for example, we are using lookup tables for both XOR and mul operataions, we can create a table where the rows 0..n/2 use a mul function on all 2^n indices and have the 4th wire storing index 0. For all indices n/2..n, an XOR gate can be added, where the index of the 4th wire is 0. These numbers require exponentiation outside, for the lower bound, otherwise the range cannot start from zero, as 2^0 = 1.

Function builds a table from mutiple operations. If, for example, we are using lookup tables for both XOR and mul operataions, we can create a table where the rows 0..n/2 use a mul function on all 2^n indices and have the 4th wire storing index 0. For all indices n/2..n, an XOR gate can be added, wheren the index of the 4th wire is 0. These numbers require exponentiation outside, for the lower bound, otherwise the range cannot start from zero, as 2^0 = 1. Particular multiplication row(s) can be added with this function.

Function builds a table from mutiple operations. If, for example, we are using lookup tables for both XOR and mul operataions, we can create a table where the rows 0..n/2 use a mul function on all 2^n indices and have the 4th wire storing index 0. For all indices n/2..n, an XOR gate can be added, wheren the index of the 4th wire is 0. These numbers require exponentiation outside, for the lower bound, otherwise the range cannot start from zero, as 2^0 = 1. Particular XOR row(s) can be added with this function.

Function builds a table from mutiple operations. If, for example, we are using lookup tables for both XOR and mul operataions, we can create a table where the rows 0..n/2 use a mul function on all 2^n indices and have the 4th wire storing index 0. For all indices n/2..n, an XOR gate can be added, wheren the index of the 4th wire is 0. These numbers require exponentiation outside, for the lower bound, otherwise the range cannot start from zero, as 2^0 = 1. Particular AND row(s) can be added with this function.

Takes in a table, which is a list of vectors containing 4 elements, and turns them into 4 distinct multisets for a, b, c and d.

Attempts to find an output value, given two input values, by querying the lookup table. The final wire holds the index of the table. The element must be predetermined to be between -1 and 2 depending on the type of table used. If the element does not exist, it will return an error.

Function that creates the table needed for reinforced concrete. Creates one table that is the concatenation T_2 || T_3 || T_1 from the paper

Trait Implementations

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

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.