Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Pedersen Generator indices and subindices. #169

Merged
merged 4 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions cpp/src/aztec/crypto/generators/generator_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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' = 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}
* 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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down