From 0bb46be70090d539c83f252d144e3a3095c98bde Mon Sep 17 00:00:00 2001 From: Suyash Bagad Date: Mon, 20 Feb 2023 09:28:53 +0000 Subject: [PATCH 1/4] Increase ped gen indices and subindices. --- cpp/src/aztec/crypto/generators/generator_data.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/aztec/crypto/generators/generator_data.cpp b/cpp/src/aztec/crypto/generators/generator_data.cpp index 514489f117..fbd7c23bcd 100644 --- a/cpp/src/aztec/crypto/generators/generator_data.cpp +++ b/cpp/src/aztec/crypto/generators/generator_data.cpp @@ -12,8 +12,8 @@ constexpr size_t num_default_generators = 2048; #endif constexpr size_t hash_indices_generator_offset = 2048; -constexpr size_t num_hash_indices = 16; -constexpr size_t num_generators_per_hash_index = 8; +constexpr size_t num_hash_indices = 32; +constexpr size_t num_generators_per_hash_index = 64; constexpr size_t num_indexed_generators = num_hash_indices * num_generators_per_hash_index; constexpr size_t size_of_generator_data_array = hash_indices_generator_offset + num_indexed_generators; constexpr size_t num_generator_types = 3; From b1fde1c339491bad147cb07b3466ba2875786215 Mon Sep 17 00:00:00 2001 From: Suyash Bagad Date: Mon, 20 Feb 2023 09:57:11 +0000 Subject: [PATCH 2/4] Change js circuit vk. --- .../join_split_example/proofs/join_split/join_split.test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/aztec/join_split_example/proofs/join_split/join_split.test.cpp b/cpp/src/aztec/join_split_example/proofs/join_split/join_split.test.cpp index a8575e7a57..66d50e0216 100644 --- a/cpp/src/aztec/join_split_example/proofs/join_split/join_split.test.cpp +++ b/cpp/src/aztec/join_split_example/proofs/join_split/join_split.test.cpp @@ -700,7 +700,7 @@ TEST_F(join_split_tests, test_0_input_notes_and_detect_circuit_change) // The below part detects any changes in the join-split circuit constexpr uint32_t CIRCUIT_GATE_COUNT = 59175; constexpr uint32_t GATES_NEXT_POWER_OF_TWO = 65536; - const uint256_t VK_HASH("edcee79f9736d8a9dcc7a5c822a49bc930315bdad7f7b67accc60ab196eb63d9"); + const uint256_t VK_HASH("7c5f17b829f8a6b17292a998ec06b2481abb82923e838d7422c3aec5cd5edd95"); auto number_of_gates_js = result.number_of_gates; auto vk_hash_js = get_verification_key()->sha256_hash(); From 1d9cf30d4471878c472e8cefce75efef3690e53c Mon Sep 17 00:00:00 2001 From: Suyash Bagad Date: Mon, 20 Feb 2023 10:11:20 +0000 Subject: [PATCH 3/4] Update comment. --- .../crypto/generators/generator_data.cpp | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/cpp/src/aztec/crypto/generators/generator_data.cpp b/cpp/src/aztec/crypto/generators/generator_data.cpp index fbd7c23bcd..7074f03b3a 100644 --- a/cpp/src/aztec/crypto/generators/generator_data.cpp +++ b/cpp/src/aztec/crypto/generators/generator_data.cpp @@ -235,21 +235,26 @@ const fixed_base_ladder* get_g1_ladder(const size_t num_bits) /** * Generator indexing: * + * Number of default generators (index = 0): N = 2048 + * Number of hash indices: H = 32 + * Number of sub indices for a given hash index: h = 64. + * Number of types of generators needed per hash index: t = 3 + * * Default generators: - * 0: P_0 P_1 P_2 ... P_{2047} + * 0: P_0 P_1 P_2 ... P_{N'-1} * - * Hash-index dependent generators: - * 1: P_{2048 + 0*8} P_{2049} ... P_{2055} - * 2: P_{2048 + 1*8} P_{2048 + 1*8 + 1} ... P_{2048 + 1*8 + 7} - * 3: + * Hash-index dependent generators: (let N' = 3 * N) + * 1: P_{N' + 0*h*t} P_{N' + 0*h*t + 1*t} ... P_{N' + 0*h*t + (h-1)*t} + * 2: P_{N' + 1*h*t} P_{N' + 1*h*t + 1*t} ... P_{N' + 1*h*t + (h-1)*t} + * 2: P_{N' + 2*h*t} P_{N' + 2*h*t + 1*t} ... P_{N' + 2*h*t + (h-1)*t} * 4: * . * . * . - * 31: P_{2048 + 30*8} P_{2048 + 30*8 + 1} ... P_{2048 + 30*8 + 7} - * 32: P_{2048 + 31*8} P_{2048 + 31*8 + 1} ... P_{2048 + 31*8 + 7} + * H-1: P_{N' + (H-2)*h*t} P_{N' + (H-2)*h*t + 1*t} ... P_{N' + (H-2)*h*t + (h-1)*t} + * H : P_{N' + (H-1)*h*t} P_{N' + (H-1)*h*t + 1*t} ... P_{N' + (H-1)*h*t + (h-1)*t} * - * Total generators = 2048 + 32*8 = 2304 + * Total generators = (N + H * h) * t = 2304 */ generator_data const& get_generator_data(generator_index_t index) { From 821245c151a90072b8679f78bae49c3bd3537627 Mon Sep 17 00:00:00 2001 From: Suyash Bagad Date: Mon, 20 Feb 2023 10:22:37 +0000 Subject: [PATCH 4/4] correction in comment. --- cpp/src/aztec/crypto/generators/generator_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/aztec/crypto/generators/generator_data.cpp b/cpp/src/aztec/crypto/generators/generator_data.cpp index 7074f03b3a..0a2b0d4ab9 100644 --- a/cpp/src/aztec/crypto/generators/generator_data.cpp +++ b/cpp/src/aztec/crypto/generators/generator_data.cpp @@ -243,7 +243,7 @@ const fixed_base_ladder* get_g1_ladder(const size_t num_bits) * Default generators: * 0: P_0 P_1 P_2 ... P_{N'-1} * - * Hash-index dependent generators: (let N' = 3 * N) + * Hash-index dependent generators: (let N' = t * N) * 1: P_{N' + 0*h*t} P_{N' + 0*h*t + 1*t} ... P_{N' + 0*h*t + (h-1)*t} * 2: P_{N' + 1*h*t} P_{N' + 1*h*t + 1*t} ... P_{N' + 1*h*t + (h-1)*t} * 2: P_{N' + 2*h*t} P_{N' + 2*h*t + 1*t} ... P_{N' + 2*h*t + (h-1)*t}