From 857a392fcb358801c57172971434eb56beba0f42 Mon Sep 17 00:00:00 2001 From: b-wagn Date: Fri, 16 Aug 2024 09:51:01 +0200 Subject: [PATCH 1/2] KZGSettings docs --- src/setup/settings.h | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/setup/settings.h b/src/setup/settings.h index fc902aa0..b8e55528 100644 --- a/src/setup/settings.h +++ b/src/setup/settings.h @@ -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; From 086183d689942d385d3d81d2af3b9a2217fa44c4 Mon Sep 17 00:00:00 2001 From: b-wagn Date: Fri, 16 Aug 2024 09:58:30 +0200 Subject: [PATCH 2/2] regenerate Rust bindings --- bindings/rust/src/bindings/generated.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bindings/rust/src/bindings/generated.rs b/bindings/rust/src/bindings/generated.rs index 27b9cecd..f0215228 100644 --- a/bindings/rust/src/bindings/generated.rs +++ b/bindings/rust/src/bindings/generated.rs @@ -85,17 +85,17 @@ pub struct Blob { #[repr(C)] #[derive(Debug, Hash, PartialEq, Eq)] pub struct KZGSettings { - #[doc = " Roots of unity for the subgroup of size `domain_size`.\n\n The array contains `domain_size + 1` elements, it starts and ends with Fr::one()."] + #[doc = " Roots of unity for the subgroup of size `FIELD_ELEMENTS_PER_EXT_BLOB`.\n\n The array contains `FIELD_ELEMENTS_PER_EXT_BLOB + 1` elements.\n The array starts and ends with Fr::one()."] roots_of_unity: *mut fr_t, - #[doc = " Roots of unity for the subgroup of size `domain_size` in bit-reversed order.\n\n This array is derived by applying a bit-reversal permutation to `roots_of_unity`\n excluding the last element. Essentially:\n `brp_roots_of_unity = bit_reversal_permutation(roots_of_unity[:-1])`\n\n The array contains `domain_size` elements."] + #[doc = " Roots of unity for the subgroup of size `FIELD_ELEMENTS_PER_EXT_BLOB` in bit-reversed order.\n\n This array is derived by applying a bit-reversal permutation to `roots_of_unity`\n excluding the last element. Essentially:\n `brp_roots_of_unity = bit_reversal_permutation(roots_of_unity[:-1])`\n\n The array contains `FIELD_ELEMENTS_PER_EXT_BLOB` elements."] brp_roots_of_unity: *mut fr_t, - #[doc = " Roots of unity for the subgroup of size `domain_size` in reversed order.\n\n It is the reversed version of `roots_of_unity`. Essentially:\n `reverse_roots_of_unity = reverse(roots_of_unity)`\n\n This array is primarily used in FFTs.\n The array contains `domain_size + 1` elements, it starts and ends with Fr::one()."] + #[doc = " Roots of unity for the subgroup of size `FIELD_ELEMENTS_PER_EXT_BLOB` in reversed order.\n\n It is the reversed version of `roots_of_unity`. Essentially:\n `reverse_roots_of_unity = reverse(roots_of_unity)`\n\n This array is primarily used in FFTs.\n The array contains `FIELD_ELEMENTS_PER_EXT_BLOB + 1` elements.\n The array starts and ends with Fr::one()."] reverse_roots_of_unity: *mut fr_t, - #[doc = " G1 group elements from the trusted setup in monomial form."] + #[doc = " G1 group elements from the trusted setup in monomial form.\n The array contains `NUM_G1_POINTS = FIELD_ELEMENTS_PER_BLOB` elements."] g1_values_monomial: *mut g1_t, - #[doc = " G1 group elements from the trusted setup in Lagrange form and bit-reversed order."] + #[doc = " G1 group elements from the trusted setup in Lagrange form and bit-reversed order.\n The array contains `NUM_G1_POINTS = FIELD_ELEMENTS_PER_BLOB` elements."] g1_values_lagrange_brp: *mut g1_t, - #[doc = " G2 group elements from the trusted setup in monomial form."] + #[doc = " G2 group elements from the trusted setup in monomial form.\n The array contains `NUM_G2_POINTS` elements."] g2_values_monomial: *mut g2_t, #[doc = " Data used during FK20 proof generation."] x_ext_fft_columns: *mut *mut g1_t,