Skip to content

Commit

Permalink
KZGSettings docs
Browse files Browse the repository at this point in the history
  • Loading branch information
b-wagn committed Aug 16, 2024
1 parent b58cd9d commit 857a392
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/setup/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,47 @@
/** Stores the setup and parameters needed for computing KZG proofs. */
typedef struct {
/**
* Roots of unity for the subgroup of size `domain_size`.
* Roots of unity for the subgroup of size `FIELD_ELEMENTS_PER_EXT_BLOB`.
*
* The array contains `domain_size + 1` elements, it starts and ends with Fr::one().
* The array contains `FIELD_ELEMENTS_PER_EXT_BLOB + 1` elements.
* The array starts and ends with Fr::one().
*/
fr_t *roots_of_unity;
/**
* Roots of unity for the subgroup of size `domain_size` in bit-reversed order.
* Roots of unity for the subgroup of size `FIELD_ELEMENTS_PER_EXT_BLOB` in bit-reversed order.
*
* This array is derived by applying a bit-reversal permutation to `roots_of_unity`
* excluding the last element. Essentially:
* `brp_roots_of_unity = bit_reversal_permutation(roots_of_unity[:-1])`
*
* The array contains `domain_size` elements.
* The array contains `FIELD_ELEMENTS_PER_EXT_BLOB` elements.
*/
fr_t *brp_roots_of_unity;
/**
* Roots of unity for the subgroup of size `domain_size` in reversed order.
* Roots of unity for the subgroup of size `FIELD_ELEMENTS_PER_EXT_BLOB` in reversed order.
*
* It is the reversed version of `roots_of_unity`. Essentially:
* `reverse_roots_of_unity = reverse(roots_of_unity)`
*
* This array is primarily used in FFTs.
* The array contains `domain_size + 1` elements, it starts and ends with Fr::one().
* The array contains `FIELD_ELEMENTS_PER_EXT_BLOB + 1` elements.
* The array starts and ends with Fr::one().
*/
fr_t *reverse_roots_of_unity;
/** G1 group elements from the trusted setup in monomial form. */
/**
* G1 group elements from the trusted setup in monomial form.
* The array contains `NUM_G1_POINTS = FIELD_ELEMENTS_PER_BLOB` elements.
*/
g1_t *g1_values_monomial;
/** G1 group elements from the trusted setup in Lagrange form and bit-reversed order. */
/**
* G1 group elements from the trusted setup in Lagrange form and bit-reversed order.
* The array contains `NUM_G1_POINTS = FIELD_ELEMENTS_PER_BLOB` elements.
*/
g1_t *g1_values_lagrange_brp;
/** G2 group elements from the trusted setup in monomial form. */
/**
* G2 group elements from the trusted setup in monomial form.
* The array contains `NUM_G2_POINTS` elements.
*/
g2_t *g2_values_monomial;
/** Data used during FK20 proof generation. */
g1_t **x_ext_fft_columns;
Expand Down

0 comments on commit 857a392

Please sign in to comment.