From 0d95d9eee85cdc0cd0a7cdf60cb8a349b8af27da Mon Sep 17 00:00:00 2001 From: Facundo Date: Mon, 12 Aug 2024 10:30:16 +0100 Subject: [PATCH] chore(avm): do not generate subtrace row (#7894) It wasn't really being used, and doing this allow for upcoming codegen improvements/simplifications. ...and, well, less pressure on the compiler! If we need it we can bring it back for the event-based-gen_trace model. --- .../vm/avm/generated/relations/alu.hpp | 123 --- .../vm/avm/generated/relations/binary.hpp | 18 - .../vm/avm/generated/relations/conversion.hpp | 4 - .../avm/generated/relations/keccakf1600.hpp | 4 - .../vm/avm/generated/relations/kernel.hpp | 34 - .../vm/avm/generated/relations/main.hpp | 124 --- .../vm/avm/generated/relations/mem.hpp | 50 - .../vm/avm/generated/relations/mem_slice.hpp | 21 - .../vm/avm/generated/relations/pedersen.hpp | 4 - .../vm/avm/generated/relations/poseidon2.hpp | 282 ------ .../vm/avm/generated/relations/sha256.hpp | 4 - .../vm/avm/trace/gadgets/poseidon2.hpp | 868 ++++++------------ .../src/barretenberg/vm/avm/trace/trace.cpp | 3 +- .../bb-pil-backend/templates/relation.hpp.hbs | 2 + 14 files changed, 293 insertions(+), 1248 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/alu.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/alu.hpp index be6b7555425..45fd6737f8c 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/alu.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/alu.hpp @@ -6,129 +6,6 @@ namespace bb::Avm_vm { -template struct AluRow { - FF alu_a_hi{}; - FF alu_a_hi_shift{}; - FF alu_a_lo{}; - FF alu_a_lo_shift{}; - FF alu_b_hi{}; - FF alu_b_hi_shift{}; - FF alu_b_lo{}; - FF alu_b_lo_shift{}; - FF alu_borrow{}; - FF alu_cf{}; - FF alu_cmp_rng_ctr{}; - FF alu_cmp_rng_ctr_shift{}; - FF alu_div_u16_r0{}; - FF alu_div_u16_r0_shift{}; - FF alu_div_u16_r1{}; - FF alu_div_u16_r1_shift{}; - FF alu_div_u16_r2{}; - FF alu_div_u16_r2_shift{}; - FF alu_div_u16_r3{}; - FF alu_div_u16_r3_shift{}; - FF alu_div_u16_r4{}; - FF alu_div_u16_r4_shift{}; - FF alu_div_u16_r5{}; - FF alu_div_u16_r5_shift{}; - FF alu_div_u16_r6{}; - FF alu_div_u16_r6_shift{}; - FF alu_div_u16_r7{}; - FF alu_div_u16_r7_shift{}; - FF alu_divisor_hi{}; - FF alu_divisor_lo{}; - FF alu_ff_tag{}; - FF alu_ia{}; - FF alu_ib{}; - FF alu_ic{}; - FF alu_in_tag{}; - FF alu_op_add{}; - FF alu_op_add_shift{}; - FF alu_op_cast{}; - FF alu_op_cast_prev{}; - FF alu_op_cast_prev_shift{}; - FF alu_op_cast_shift{}; - FF alu_op_div{}; - FF alu_op_div_a_lt_b{}; - FF alu_op_div_shift{}; - FF alu_op_div_std{}; - FF alu_op_eq{}; - FF alu_op_eq_diff_inv{}; - FF alu_op_lt{}; - FF alu_op_lte{}; - FF alu_op_mul{}; - FF alu_op_mul_shift{}; - FF alu_op_not{}; - FF alu_op_shl{}; - FF alu_op_shl_shift{}; - FF alu_op_shr{}; - FF alu_op_shr_shift{}; - FF alu_op_sub{}; - FF alu_op_sub_shift{}; - FF alu_p_a_borrow{}; - FF alu_p_b_borrow{}; - FF alu_p_sub_a_hi{}; - FF alu_p_sub_a_hi_shift{}; - FF alu_p_sub_a_lo{}; - FF alu_p_sub_a_lo_shift{}; - FF alu_p_sub_b_hi{}; - FF alu_p_sub_b_hi_shift{}; - FF alu_p_sub_b_lo{}; - FF alu_p_sub_b_lo_shift{}; - FF alu_partial_prod_hi{}; - FF alu_partial_prod_lo{}; - FF alu_quotient_hi{}; - FF alu_quotient_lo{}; - FF alu_remainder{}; - FF alu_res_hi{}; - FF alu_res_lo{}; - FF alu_sel_alu{}; - FF alu_sel_alu_shift{}; - FF alu_sel_cmp{}; - FF alu_sel_cmp_shift{}; - FF alu_sel_div_rng_chk{}; - FF alu_sel_div_rng_chk_shift{}; - FF alu_sel_rng_chk{}; - FF alu_sel_rng_chk_lookup_shift{}; - FF alu_sel_rng_chk_shift{}; - FF alu_sel_shift_which{}; - FF alu_shift_lt_bit_len{}; - FF alu_t_sub_s_bits{}; - FF alu_two_pow_s{}; - FF alu_two_pow_t_sub_s{}; - FF alu_u128_tag{}; - FF alu_u16_r0{}; - FF alu_u16_r0_shift{}; - FF alu_u16_r1{}; - FF alu_u16_r10{}; - FF alu_u16_r11{}; - FF alu_u16_r12{}; - FF alu_u16_r13{}; - FF alu_u16_r14{}; - FF alu_u16_r1_shift{}; - FF alu_u16_r2{}; - FF alu_u16_r2_shift{}; - FF alu_u16_r3{}; - FF alu_u16_r3_shift{}; - FF alu_u16_r4{}; - FF alu_u16_r4_shift{}; - FF alu_u16_r5{}; - FF alu_u16_r5_shift{}; - FF alu_u16_r6{}; - FF alu_u16_r6_shift{}; - FF alu_u16_r7{}; - FF alu_u16_r8{}; - FF alu_u16_r9{}; - FF alu_u16_tag{}; - FF alu_u32_tag{}; - FF alu_u64_tag{}; - FF alu_u8_r0{}; - FF alu_u8_r0_shift{}; - FF alu_u8_r1{}; - FF alu_u8_r1_shift{}; - FF alu_u8_tag{}; -}; - template class aluImpl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/binary.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/binary.hpp index 585b3e02ad3..6ec622b1232 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/binary.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/binary.hpp @@ -6,24 +6,6 @@ namespace bb::Avm_vm { -template struct BinaryRow { - FF binary_acc_ia{}; - FF binary_acc_ia_shift{}; - FF binary_acc_ib{}; - FF binary_acc_ib_shift{}; - FF binary_acc_ic{}; - FF binary_acc_ic_shift{}; - FF binary_ia_bytes{}; - FF binary_ib_bytes{}; - FF binary_ic_bytes{}; - FF binary_mem_tag_ctr{}; - FF binary_mem_tag_ctr_inv{}; - FF binary_mem_tag_ctr_shift{}; - FF binary_op_id{}; - FF binary_op_id_shift{}; - FF binary_sel_bin{}; -}; - template class binaryImpl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/conversion.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/conversion.hpp index 76108aeeb0b..e3b496a6f7a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/conversion.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/conversion.hpp @@ -6,10 +6,6 @@ namespace bb::Avm_vm { -template struct ConversionRow { - FF conversion_sel_to_radix_le{}; -}; - template class conversionImpl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/keccakf1600.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/keccakf1600.hpp index 0da7033cb6d..978204515c4 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/keccakf1600.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/keccakf1600.hpp @@ -6,10 +6,6 @@ namespace bb::Avm_vm { -template struct Keccakf1600Row { - FF keccakf1600_sel_keccakf1600{}; -}; - template class keccakf1600Impl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/kernel.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/kernel.hpp index 37716d25a87..688844fba16 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/kernel.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/kernel.hpp @@ -6,40 +6,6 @@ namespace bb::Avm_vm { -template struct KernelRow { - FF kernel_emit_l2_to_l1_msg_write_offset{}; - FF kernel_emit_l2_to_l1_msg_write_offset_shift{}; - FF kernel_emit_note_hash_write_offset{}; - FF kernel_emit_note_hash_write_offset_shift{}; - FF kernel_emit_nullifier_write_offset{}; - FF kernel_emit_nullifier_write_offset_shift{}; - FF kernel_emit_unencrypted_log_write_offset{}; - FF kernel_emit_unencrypted_log_write_offset_shift{}; - FF kernel_l1_to_l2_msg_exists_write_offset{}; - FF kernel_l1_to_l2_msg_exists_write_offset_shift{}; - FF kernel_note_hash_exist_write_offset{}; - FF kernel_note_hash_exist_write_offset_shift{}; - FF kernel_nullifier_exists_write_offset{}; - FF kernel_nullifier_exists_write_offset_shift{}; - FF kernel_nullifier_non_exists_write_offset{}; - FF kernel_nullifier_non_exists_write_offset_shift{}; - FF kernel_sload_write_offset{}; - FF kernel_sload_write_offset_shift{}; - FF kernel_sstore_write_offset{}; - FF kernel_sstore_write_offset_shift{}; - FF main_ib{}; - FF main_sel_last{}; - FF main_sel_op_emit_l2_to_l1_msg{}; - FF main_sel_op_emit_note_hash{}; - FF main_sel_op_emit_nullifier{}; - FF main_sel_op_emit_unencrypted_log{}; - FF main_sel_op_l1_to_l2_msg_exists{}; - FF main_sel_op_note_hash_exists{}; - FF main_sel_op_nullifier_exists{}; - FF main_sel_op_sload{}; - FF main_sel_op_sstore{}; -}; - template class kernelImpl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp index 25fc0d01cc3..9ba706f3210 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp @@ -6,130 +6,6 @@ namespace bb::Avm_vm { -template struct MainRow { - FF kernel_emit_l2_to_l1_msg_write_offset{}; - FF kernel_emit_note_hash_write_offset{}; - FF kernel_emit_nullifier_write_offset{}; - FF kernel_emit_unencrypted_log_write_offset{}; - FF kernel_kernel_in_offset{}; - FF kernel_kernel_out_offset{}; - FF kernel_l1_to_l2_msg_exists_write_offset{}; - FF kernel_note_hash_exist_write_offset{}; - FF kernel_nullifier_exists_write_offset{}; - FF kernel_nullifier_non_exists_write_offset{}; - FF kernel_side_effect_counter{}; - FF kernel_side_effect_counter_shift{}; - FF kernel_sload_write_offset{}; - FF kernel_sstore_write_offset{}; - FF main_abs_da_rem_gas_hi{}; - FF main_abs_da_rem_gas_lo{}; - FF main_abs_l2_rem_gas_hi{}; - FF main_abs_l2_rem_gas_lo{}; - FF main_alu_in_tag{}; - FF main_bin_op_id{}; - FF main_call_ptr{}; - FF main_da_gas_op_cost{}; - FF main_da_gas_remaining{}; - FF main_da_gas_remaining_shift{}; - FF main_da_out_of_gas{}; - FF main_ia{}; - FF main_ib{}; - FF main_ic{}; - FF main_id{}; - FF main_id_zero{}; - FF main_internal_return_ptr{}; - FF main_internal_return_ptr_shift{}; - FF main_inv{}; - FF main_l2_gas_op_cost{}; - FF main_l2_gas_remaining{}; - FF main_l2_gas_remaining_shift{}; - FF main_l2_out_of_gas{}; - FF main_mem_addr_a{}; - FF main_mem_addr_b{}; - FF main_op_err{}; - FF main_pc{}; - FF main_pc_shift{}; - FF main_r_in_tag{}; - FF main_rwa{}; - FF main_rwb{}; - FF main_rwc{}; - FF main_rwd{}; - FF main_sel_alu{}; - FF main_sel_bin{}; - FF main_sel_first{}; - FF main_sel_gas_accounting_active{}; - FF main_sel_mem_op_a{}; - FF main_sel_mem_op_b{}; - FF main_sel_mem_op_c{}; - FF main_sel_mem_op_d{}; - FF main_sel_mov_ia_to_ic{}; - FF main_sel_mov_ib_to_ic{}; - FF main_sel_op_add{}; - FF main_sel_op_address{}; - FF main_sel_op_and{}; - FF main_sel_op_block_number{}; - FF main_sel_op_calldata_copy{}; - FF main_sel_op_cast{}; - FF main_sel_op_chain_id{}; - FF main_sel_op_cmov{}; - FF main_sel_op_coinbase{}; - FF main_sel_op_dagasleft{}; - FF main_sel_op_div{}; - FF main_sel_op_emit_l2_to_l1_msg{}; - FF main_sel_op_emit_note_hash{}; - FF main_sel_op_emit_nullifier{}; - FF main_sel_op_emit_unencrypted_log{}; - FF main_sel_op_eq{}; - FF main_sel_op_external_call{}; - FF main_sel_op_external_return{}; - FF main_sel_op_fdiv{}; - FF main_sel_op_fee_per_da_gas{}; - FF main_sel_op_fee_per_l2_gas{}; - FF main_sel_op_function_selector{}; - FF main_sel_op_get_contract_instance{}; - FF main_sel_op_halt{}; - FF main_sel_op_internal_call{}; - FF main_sel_op_internal_return{}; - FF main_sel_op_jump{}; - FF main_sel_op_jumpi{}; - FF main_sel_op_keccak{}; - FF main_sel_op_l1_to_l2_msg_exists{}; - FF main_sel_op_l2gasleft{}; - FF main_sel_op_lt{}; - FF main_sel_op_lte{}; - FF main_sel_op_mov{}; - FF main_sel_op_mul{}; - FF main_sel_op_not{}; - FF main_sel_op_note_hash_exists{}; - FF main_sel_op_nullifier_exists{}; - FF main_sel_op_or{}; - FF main_sel_op_pedersen{}; - FF main_sel_op_poseidon2{}; - FF main_sel_op_radix_le{}; - FF main_sel_op_sender{}; - FF main_sel_op_sha256{}; - FF main_sel_op_shl{}; - FF main_sel_op_shr{}; - FF main_sel_op_sload{}; - FF main_sel_op_sstore{}; - FF main_sel_op_storage_address{}; - FF main_sel_op_sub{}; - FF main_sel_op_timestamp{}; - FF main_sel_op_transaction_fee{}; - FF main_sel_op_version{}; - FF main_sel_op_xor{}; - FF main_sel_q_kernel_lookup{}; - FF main_sel_q_kernel_output_lookup{}; - FF main_sel_resolve_ind_addr_a{}; - FF main_sel_resolve_ind_addr_b{}; - FF main_sel_resolve_ind_addr_c{}; - FF main_sel_resolve_ind_addr_d{}; - FF main_sel_slice_gadget{}; - FF main_space_id{}; - FF main_tag_err{}; - FF main_w_in_tag{}; -}; - template class mainImpl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem.hpp index 6265b06c87b..ed64e248681 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem.hpp @@ -6,56 +6,6 @@ namespace bb::Avm_vm { -template struct MemRow { - FF main_sel_first{}; - FF mem_addr{}; - FF mem_clk{}; - FF mem_diff_hi{}; - FF mem_diff_lo{}; - FF mem_diff_mid{}; - FF mem_glob_addr{}; - FF mem_glob_addr_shift{}; - FF mem_last{}; - FF mem_lastAccess{}; - FF mem_one_min_inv{}; - FF mem_r_in_tag{}; - FF mem_rw{}; - FF mem_rw_shift{}; - FF mem_sel_mem{}; - FF mem_sel_mem_shift{}; - FF mem_sel_mov_ia_to_ic{}; - FF mem_sel_mov_ib_to_ic{}; - FF mem_sel_op_a{}; - FF mem_sel_op_b{}; - FF mem_sel_op_c{}; - FF mem_sel_op_cmov{}; - FF mem_sel_op_d{}; - FF mem_sel_op_poseidon_read_a{}; - FF mem_sel_op_poseidon_read_b{}; - FF mem_sel_op_poseidon_read_c{}; - FF mem_sel_op_poseidon_read_d{}; - FF mem_sel_op_poseidon_write_a{}; - FF mem_sel_op_poseidon_write_b{}; - FF mem_sel_op_poseidon_write_c{}; - FF mem_sel_op_poseidon_write_d{}; - FF mem_sel_op_slice{}; - FF mem_sel_resolve_ind_addr_a{}; - FF mem_sel_resolve_ind_addr_b{}; - FF mem_sel_resolve_ind_addr_c{}; - FF mem_sel_resolve_ind_addr_d{}; - FF mem_sel_rng_chk{}; - FF mem_skip_check_tag{}; - FF mem_space_id{}; - FF mem_tag{}; - FF mem_tag_err{}; - FF mem_tag_shift{}; - FF mem_tsp{}; - FF mem_tsp_shift{}; - FF mem_val{}; - FF mem_val_shift{}; - FF mem_w_in_tag{}; -}; - template class memImpl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem_slice.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem_slice.hpp index d494daec4b7..4c3c8e971f5 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem_slice.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem_slice.hpp @@ -6,27 +6,6 @@ namespace bb::Avm_vm { -template struct MemSliceRow { - FF slice_addr{}; - FF slice_addr_shift{}; - FF slice_clk{}; - FF slice_clk_shift{}; - FF slice_cnt{}; - FF slice_cnt_shift{}; - FF slice_col_offset{}; - FF slice_col_offset_shift{}; - FF slice_one_min_inv{}; - FF slice_sel_cd_cpy{}; - FF slice_sel_cd_cpy_shift{}; - FF slice_sel_mem_active{}; - FF slice_sel_mem_active_shift{}; - FF slice_sel_return{}; - FF slice_sel_return_shift{}; - FF slice_sel_start_shift{}; - FF slice_space_id{}; - FF slice_space_id_shift{}; -}; - template class mem_sliceImpl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/pedersen.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/pedersen.hpp index d0d0998fec7..a458e6f8933 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/pedersen.hpp @@ -6,10 +6,6 @@ namespace bb::Avm_vm { -template struct PedersenRow { - FF pedersen_sel_pedersen{}; -}; - template class pedersenImpl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/poseidon2.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/poseidon2.hpp index 08909d0808e..383312a30e4 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/poseidon2.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/poseidon2.hpp @@ -6,288 +6,6 @@ namespace bb::Avm_vm { -template struct Poseidon2Row { - FF poseidon2_B_10_0{}; - FF poseidon2_B_10_1{}; - FF poseidon2_B_10_2{}; - FF poseidon2_B_10_3{}; - FF poseidon2_B_11_0{}; - FF poseidon2_B_11_1{}; - FF poseidon2_B_11_2{}; - FF poseidon2_B_11_3{}; - FF poseidon2_B_12_0{}; - FF poseidon2_B_12_1{}; - FF poseidon2_B_12_2{}; - FF poseidon2_B_12_3{}; - FF poseidon2_B_13_0{}; - FF poseidon2_B_13_1{}; - FF poseidon2_B_13_2{}; - FF poseidon2_B_13_3{}; - FF poseidon2_B_14_0{}; - FF poseidon2_B_14_1{}; - FF poseidon2_B_14_2{}; - FF poseidon2_B_14_3{}; - FF poseidon2_B_15_0{}; - FF poseidon2_B_15_1{}; - FF poseidon2_B_15_2{}; - FF poseidon2_B_15_3{}; - FF poseidon2_B_16_0{}; - FF poseidon2_B_16_1{}; - FF poseidon2_B_16_2{}; - FF poseidon2_B_16_3{}; - FF poseidon2_B_17_0{}; - FF poseidon2_B_17_1{}; - FF poseidon2_B_17_2{}; - FF poseidon2_B_17_3{}; - FF poseidon2_B_18_0{}; - FF poseidon2_B_18_1{}; - FF poseidon2_B_18_2{}; - FF poseidon2_B_18_3{}; - FF poseidon2_B_19_0{}; - FF poseidon2_B_19_1{}; - FF poseidon2_B_19_2{}; - FF poseidon2_B_19_3{}; - FF poseidon2_B_20_0{}; - FF poseidon2_B_20_1{}; - FF poseidon2_B_20_2{}; - FF poseidon2_B_20_3{}; - FF poseidon2_B_21_0{}; - FF poseidon2_B_21_1{}; - FF poseidon2_B_21_2{}; - FF poseidon2_B_21_3{}; - FF poseidon2_B_22_0{}; - FF poseidon2_B_22_1{}; - FF poseidon2_B_22_2{}; - FF poseidon2_B_22_3{}; - FF poseidon2_B_23_0{}; - FF poseidon2_B_23_1{}; - FF poseidon2_B_23_2{}; - FF poseidon2_B_23_3{}; - FF poseidon2_B_24_0{}; - FF poseidon2_B_24_1{}; - FF poseidon2_B_24_2{}; - FF poseidon2_B_24_3{}; - FF poseidon2_B_25_0{}; - FF poseidon2_B_25_1{}; - FF poseidon2_B_25_2{}; - FF poseidon2_B_25_3{}; - FF poseidon2_B_26_0{}; - FF poseidon2_B_26_1{}; - FF poseidon2_B_26_2{}; - FF poseidon2_B_26_3{}; - FF poseidon2_B_27_0{}; - FF poseidon2_B_27_1{}; - FF poseidon2_B_27_2{}; - FF poseidon2_B_27_3{}; - FF poseidon2_B_28_0{}; - FF poseidon2_B_28_1{}; - FF poseidon2_B_28_2{}; - FF poseidon2_B_28_3{}; - FF poseidon2_B_29_0{}; - FF poseidon2_B_29_1{}; - FF poseidon2_B_29_2{}; - FF poseidon2_B_29_3{}; - FF poseidon2_B_30_0{}; - FF poseidon2_B_30_1{}; - FF poseidon2_B_30_2{}; - FF poseidon2_B_30_3{}; - FF poseidon2_B_31_0{}; - FF poseidon2_B_31_1{}; - FF poseidon2_B_31_2{}; - FF poseidon2_B_31_3{}; - FF poseidon2_B_32_0{}; - FF poseidon2_B_32_1{}; - FF poseidon2_B_32_2{}; - FF poseidon2_B_32_3{}; - FF poseidon2_B_33_0{}; - FF poseidon2_B_33_1{}; - FF poseidon2_B_33_2{}; - FF poseidon2_B_33_3{}; - FF poseidon2_B_34_0{}; - FF poseidon2_B_34_1{}; - FF poseidon2_B_34_2{}; - FF poseidon2_B_34_3{}; - FF poseidon2_B_35_0{}; - FF poseidon2_B_35_1{}; - FF poseidon2_B_35_2{}; - FF poseidon2_B_35_3{}; - FF poseidon2_B_36_0{}; - FF poseidon2_B_36_1{}; - FF poseidon2_B_36_2{}; - FF poseidon2_B_36_3{}; - FF poseidon2_B_37_0{}; - FF poseidon2_B_37_1{}; - FF poseidon2_B_37_2{}; - FF poseidon2_B_37_3{}; - FF poseidon2_B_38_0{}; - FF poseidon2_B_38_1{}; - FF poseidon2_B_38_2{}; - FF poseidon2_B_38_3{}; - FF poseidon2_B_39_0{}; - FF poseidon2_B_39_1{}; - FF poseidon2_B_39_2{}; - FF poseidon2_B_39_3{}; - FF poseidon2_B_40_0{}; - FF poseidon2_B_40_1{}; - FF poseidon2_B_40_2{}; - FF poseidon2_B_40_3{}; - FF poseidon2_B_41_0{}; - FF poseidon2_B_41_1{}; - FF poseidon2_B_41_2{}; - FF poseidon2_B_41_3{}; - FF poseidon2_B_42_0{}; - FF poseidon2_B_42_1{}; - FF poseidon2_B_42_2{}; - FF poseidon2_B_42_3{}; - FF poseidon2_B_43_0{}; - FF poseidon2_B_43_1{}; - FF poseidon2_B_43_2{}; - FF poseidon2_B_43_3{}; - FF poseidon2_B_44_0{}; - FF poseidon2_B_44_1{}; - FF poseidon2_B_44_2{}; - FF poseidon2_B_44_3{}; - FF poseidon2_B_45_0{}; - FF poseidon2_B_45_1{}; - FF poseidon2_B_45_2{}; - FF poseidon2_B_45_3{}; - FF poseidon2_B_46_0{}; - FF poseidon2_B_46_1{}; - FF poseidon2_B_46_2{}; - FF poseidon2_B_46_3{}; - FF poseidon2_B_47_0{}; - FF poseidon2_B_47_1{}; - FF poseidon2_B_47_2{}; - FF poseidon2_B_47_3{}; - FF poseidon2_B_48_0{}; - FF poseidon2_B_48_1{}; - FF poseidon2_B_48_2{}; - FF poseidon2_B_48_3{}; - FF poseidon2_B_49_0{}; - FF poseidon2_B_49_1{}; - FF poseidon2_B_49_2{}; - FF poseidon2_B_49_3{}; - FF poseidon2_B_4_0{}; - FF poseidon2_B_4_1{}; - FF poseidon2_B_4_2{}; - FF poseidon2_B_4_3{}; - FF poseidon2_B_50_0{}; - FF poseidon2_B_50_1{}; - FF poseidon2_B_50_2{}; - FF poseidon2_B_50_3{}; - FF poseidon2_B_51_0{}; - FF poseidon2_B_51_1{}; - FF poseidon2_B_51_2{}; - FF poseidon2_B_51_3{}; - FF poseidon2_B_52_0{}; - FF poseidon2_B_52_1{}; - FF poseidon2_B_52_2{}; - FF poseidon2_B_52_3{}; - FF poseidon2_B_53_0{}; - FF poseidon2_B_53_1{}; - FF poseidon2_B_53_2{}; - FF poseidon2_B_53_3{}; - FF poseidon2_B_54_0{}; - FF poseidon2_B_54_1{}; - FF poseidon2_B_54_2{}; - FF poseidon2_B_54_3{}; - FF poseidon2_B_55_0{}; - FF poseidon2_B_55_1{}; - FF poseidon2_B_55_2{}; - FF poseidon2_B_55_3{}; - FF poseidon2_B_56_0{}; - FF poseidon2_B_56_1{}; - FF poseidon2_B_56_2{}; - FF poseidon2_B_56_3{}; - FF poseidon2_B_57_0{}; - FF poseidon2_B_57_1{}; - FF poseidon2_B_57_2{}; - FF poseidon2_B_57_3{}; - FF poseidon2_B_58_0{}; - FF poseidon2_B_58_1{}; - FF poseidon2_B_58_2{}; - FF poseidon2_B_58_3{}; - FF poseidon2_B_59_0{}; - FF poseidon2_B_59_1{}; - FF poseidon2_B_59_2{}; - FF poseidon2_B_59_3{}; - FF poseidon2_B_5_0{}; - FF poseidon2_B_5_1{}; - FF poseidon2_B_5_2{}; - FF poseidon2_B_5_3{}; - FF poseidon2_B_6_0{}; - FF poseidon2_B_6_1{}; - FF poseidon2_B_6_2{}; - FF poseidon2_B_6_3{}; - FF poseidon2_B_7_0{}; - FF poseidon2_B_7_1{}; - FF poseidon2_B_7_2{}; - FF poseidon2_B_7_3{}; - FF poseidon2_B_8_0{}; - FF poseidon2_B_8_1{}; - FF poseidon2_B_8_2{}; - FF poseidon2_B_8_3{}; - FF poseidon2_B_9_0{}; - FF poseidon2_B_9_1{}; - FF poseidon2_B_9_2{}; - FF poseidon2_B_9_3{}; - FF poseidon2_EXT_LAYER_4{}; - FF poseidon2_EXT_LAYER_5{}; - FF poseidon2_EXT_LAYER_6{}; - FF poseidon2_EXT_LAYER_7{}; - FF poseidon2_T_0_4{}; - FF poseidon2_T_0_5{}; - FF poseidon2_T_0_6{}; - FF poseidon2_T_0_7{}; - FF poseidon2_T_1_4{}; - FF poseidon2_T_1_5{}; - FF poseidon2_T_1_6{}; - FF poseidon2_T_1_7{}; - FF poseidon2_T_2_4{}; - FF poseidon2_T_2_5{}; - FF poseidon2_T_2_6{}; - FF poseidon2_T_2_7{}; - FF poseidon2_T_3_4{}; - FF poseidon2_T_3_5{}; - FF poseidon2_T_3_6{}; - FF poseidon2_T_3_7{}; - FF poseidon2_T_60_4{}; - FF poseidon2_T_60_5{}; - FF poseidon2_T_60_6{}; - FF poseidon2_T_60_7{}; - FF poseidon2_T_61_4{}; - FF poseidon2_T_61_5{}; - FF poseidon2_T_61_6{}; - FF poseidon2_T_61_7{}; - FF poseidon2_T_62_4{}; - FF poseidon2_T_62_5{}; - FF poseidon2_T_62_6{}; - FF poseidon2_T_62_7{}; - FF poseidon2_T_63_4{}; - FF poseidon2_T_63_5{}; - FF poseidon2_T_63_6{}; - FF poseidon2_T_63_7{}; - FF poseidon2_a_0{}; - FF poseidon2_a_1{}; - FF poseidon2_a_2{}; - FF poseidon2_a_3{}; - FF poseidon2_b_0{}; - FF poseidon2_b_1{}; - FF poseidon2_b_2{}; - FF poseidon2_b_3{}; - FF poseidon2_input_addr{}; - FF poseidon2_mem_addr_read_a{}; - FF poseidon2_mem_addr_read_b{}; - FF poseidon2_mem_addr_read_c{}; - FF poseidon2_mem_addr_read_d{}; - FF poseidon2_mem_addr_write_a{}; - FF poseidon2_mem_addr_write_b{}; - FF poseidon2_mem_addr_write_c{}; - FF poseidon2_mem_addr_write_d{}; - FF poseidon2_output_addr{}; - FF poseidon2_sel_poseidon_perm{}; -}; - template class poseidon2Impl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/sha256.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/sha256.hpp index 8b0b6896871..63c4ab3f179 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/sha256.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/sha256.hpp @@ -6,10 +6,6 @@ namespace bb::Avm_vm { -template struct Sha256Row { - FF sha256_sel_sha256_compression{}; -}; - template class sha256Impl { public: using FF = FF_; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/poseidon2.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/poseidon2.hpp index 6c88f2c3cb4..7953b2a3a6e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/poseidon2.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/poseidon2.hpp @@ -11,7 +11,6 @@ namespace bb::avm_trace { class AvmPoseidon2TraceBuilder { public: - using Poseidon2Row = bb::Avm_vm::Poseidon2Row; struct Poseidon2TraceEntry { uint32_t clk = 0; std::array input; @@ -32,586 +31,299 @@ class AvmPoseidon2TraceBuilder { uint32_t input_addr, uint32_t output_addr); - Poseidon2Row static into_canonical(Poseidon2TraceEntry const& src) - { - // The primary input row, which is used to read the input of the permutation from memory - Poseidon2Row dest; - // Mem Stuff - dest.poseidon2_a_0 = src.input[0]; - dest.poseidon2_a_1 = src.input[1]; - dest.poseidon2_a_2 = src.input[2]; - dest.poseidon2_a_3 = src.input[3]; - dest.poseidon2_b_0 = src.output[0]; - dest.poseidon2_b_1 = src.output[1]; - dest.poseidon2_b_2 = src.output[2]; - dest.poseidon2_b_3 = src.output[3]; - dest.poseidon2_input_addr = src.input_addr; - dest.poseidon2_output_addr = src.output_addr; - dest.poseidon2_mem_addr_read_a = src.input_addr; - dest.poseidon2_mem_addr_read_b = src.input_addr + 1; - dest.poseidon2_mem_addr_read_c = src.input_addr + 2; - dest.poseidon2_mem_addr_read_d = src.input_addr + 3; - dest.poseidon2_mem_addr_write_a = src.output_addr; - dest.poseidon2_mem_addr_write_b = src.output_addr + 1; - dest.poseidon2_mem_addr_write_c = src.output_addr + 2; - dest.poseidon2_mem_addr_write_d = src.output_addr + 3; - dest.poseidon2_sel_poseidon_perm = FF(1); - // First Ext Round - dest.poseidon2_EXT_LAYER_6 = src.first_ext[0]; - dest.poseidon2_EXT_LAYER_5 = src.first_ext[1]; - dest.poseidon2_EXT_LAYER_7 = src.first_ext[2]; - dest.poseidon2_EXT_LAYER_4 = src.first_ext[3]; - // Full rounds - dest.poseidon2_T_0_6 = src.interm_round_vals[0][0]; - dest.poseidon2_T_0_5 = src.interm_round_vals[0][1]; - dest.poseidon2_T_0_7 = src.interm_round_vals[0][2]; - dest.poseidon2_T_0_4 = src.interm_round_vals[0][3]; - dest.poseidon2_T_1_6 = src.interm_round_vals[1][0]; - dest.poseidon2_T_1_5 = src.interm_round_vals[1][1]; - dest.poseidon2_T_1_7 = src.interm_round_vals[1][2]; - dest.poseidon2_T_1_4 = src.interm_round_vals[1][3]; - dest.poseidon2_T_2_6 = src.interm_round_vals[2][0]; - dest.poseidon2_T_2_5 = src.interm_round_vals[2][1]; - dest.poseidon2_T_2_7 = src.interm_round_vals[2][2]; - dest.poseidon2_T_2_4 = src.interm_round_vals[2][3]; - dest.poseidon2_T_3_6 = src.interm_round_vals[3][0]; - dest.poseidon2_T_3_5 = src.interm_round_vals[3][1]; - dest.poseidon2_T_3_7 = src.interm_round_vals[3][2]; - dest.poseidon2_T_3_4 = src.interm_round_vals[3][3]; - // Partial rounds - dest.poseidon2_B_4_0 = src.interm_round_vals[4][0]; - dest.poseidon2_B_4_1 = src.interm_round_vals[4][1]; - dest.poseidon2_B_4_2 = src.interm_round_vals[4][2]; - dest.poseidon2_B_4_3 = src.interm_round_vals[4][3]; - dest.poseidon2_B_5_0 = src.interm_round_vals[5][0]; - dest.poseidon2_B_5_1 = src.interm_round_vals[5][1]; - dest.poseidon2_B_5_2 = src.interm_round_vals[5][2]; - dest.poseidon2_B_5_3 = src.interm_round_vals[5][3]; - dest.poseidon2_B_6_0 = src.interm_round_vals[6][0]; - dest.poseidon2_B_6_1 = src.interm_round_vals[6][1]; - dest.poseidon2_B_6_2 = src.interm_round_vals[6][2]; - dest.poseidon2_B_6_3 = src.interm_round_vals[6][3]; - dest.poseidon2_B_7_0 = src.interm_round_vals[7][0]; - dest.poseidon2_B_7_1 = src.interm_round_vals[7][1]; - dest.poseidon2_B_7_2 = src.interm_round_vals[7][2]; - dest.poseidon2_B_7_3 = src.interm_round_vals[7][3]; - dest.poseidon2_B_8_0 = src.interm_round_vals[8][0]; - dest.poseidon2_B_8_1 = src.interm_round_vals[8][1]; - dest.poseidon2_B_8_2 = src.interm_round_vals[8][2]; - dest.poseidon2_B_8_3 = src.interm_round_vals[8][3]; - dest.poseidon2_B_9_0 = src.interm_round_vals[9][0]; - dest.poseidon2_B_9_1 = src.interm_round_vals[9][1]; - dest.poseidon2_B_9_2 = src.interm_round_vals[9][2]; - dest.poseidon2_B_9_3 = src.interm_round_vals[9][3]; - dest.poseidon2_B_10_0 = src.interm_round_vals[10][0]; - dest.poseidon2_B_10_1 = src.interm_round_vals[10][1]; - dest.poseidon2_B_10_2 = src.interm_round_vals[10][2]; - dest.poseidon2_B_10_3 = src.interm_round_vals[10][3]; - dest.poseidon2_B_11_0 = src.interm_round_vals[11][0]; - dest.poseidon2_B_11_1 = src.interm_round_vals[11][1]; - dest.poseidon2_B_11_2 = src.interm_round_vals[11][2]; - dest.poseidon2_B_11_3 = src.interm_round_vals[11][3]; - dest.poseidon2_B_12_0 = src.interm_round_vals[12][0]; - dest.poseidon2_B_12_1 = src.interm_round_vals[12][1]; - dest.poseidon2_B_12_2 = src.interm_round_vals[12][2]; - dest.poseidon2_B_12_3 = src.interm_round_vals[12][3]; - dest.poseidon2_B_13_0 = src.interm_round_vals[13][0]; - dest.poseidon2_B_13_1 = src.interm_round_vals[13][1]; - dest.poseidon2_B_13_2 = src.interm_round_vals[13][2]; - dest.poseidon2_B_13_3 = src.interm_round_vals[13][3]; - dest.poseidon2_B_14_0 = src.interm_round_vals[14][0]; - dest.poseidon2_B_14_1 = src.interm_round_vals[14][1]; - dest.poseidon2_B_14_2 = src.interm_round_vals[14][2]; - dest.poseidon2_B_14_3 = src.interm_round_vals[14][3]; - dest.poseidon2_B_15_0 = src.interm_round_vals[15][0]; - dest.poseidon2_B_15_1 = src.interm_round_vals[15][1]; - dest.poseidon2_B_15_2 = src.interm_round_vals[15][2]; - dest.poseidon2_B_15_3 = src.interm_round_vals[15][3]; - dest.poseidon2_B_16_0 = src.interm_round_vals[16][0]; - dest.poseidon2_B_16_1 = src.interm_round_vals[16][1]; - dest.poseidon2_B_16_2 = src.interm_round_vals[16][2]; - dest.poseidon2_B_16_3 = src.interm_round_vals[16][3]; - dest.poseidon2_B_17_0 = src.interm_round_vals[17][0]; - dest.poseidon2_B_17_1 = src.interm_round_vals[17][1]; - dest.poseidon2_B_17_2 = src.interm_round_vals[17][2]; - dest.poseidon2_B_17_3 = src.interm_round_vals[17][3]; - dest.poseidon2_B_18_0 = src.interm_round_vals[18][0]; - dest.poseidon2_B_18_1 = src.interm_round_vals[18][1]; - dest.poseidon2_B_18_2 = src.interm_round_vals[18][2]; - dest.poseidon2_B_18_3 = src.interm_round_vals[18][3]; - dest.poseidon2_B_19_0 = src.interm_round_vals[19][0]; - dest.poseidon2_B_19_1 = src.interm_round_vals[19][1]; - dest.poseidon2_B_19_2 = src.interm_round_vals[19][2]; - dest.poseidon2_B_19_3 = src.interm_round_vals[19][3]; - dest.poseidon2_B_20_0 = src.interm_round_vals[20][0]; - dest.poseidon2_B_20_1 = src.interm_round_vals[20][1]; - dest.poseidon2_B_20_2 = src.interm_round_vals[20][2]; - dest.poseidon2_B_20_3 = src.interm_round_vals[20][3]; - dest.poseidon2_B_21_0 = src.interm_round_vals[21][0]; - dest.poseidon2_B_21_1 = src.interm_round_vals[21][1]; - dest.poseidon2_B_21_2 = src.interm_round_vals[21][2]; - dest.poseidon2_B_21_3 = src.interm_round_vals[21][3]; - dest.poseidon2_B_22_0 = src.interm_round_vals[22][0]; - dest.poseidon2_B_22_1 = src.interm_round_vals[22][1]; - dest.poseidon2_B_22_2 = src.interm_round_vals[22][2]; - dest.poseidon2_B_22_3 = src.interm_round_vals[22][3]; - dest.poseidon2_B_23_0 = src.interm_round_vals[23][0]; - dest.poseidon2_B_23_1 = src.interm_round_vals[23][1]; - dest.poseidon2_B_23_2 = src.interm_round_vals[23][2]; - dest.poseidon2_B_23_3 = src.interm_round_vals[23][3]; - dest.poseidon2_B_24_0 = src.interm_round_vals[24][0]; - dest.poseidon2_B_24_1 = src.interm_round_vals[24][1]; - dest.poseidon2_B_24_2 = src.interm_round_vals[24][2]; - dest.poseidon2_B_24_3 = src.interm_round_vals[24][3]; - dest.poseidon2_B_25_0 = src.interm_round_vals[25][0]; - dest.poseidon2_B_25_1 = src.interm_round_vals[25][1]; - dest.poseidon2_B_25_2 = src.interm_round_vals[25][2]; - dest.poseidon2_B_25_3 = src.interm_round_vals[25][3]; - dest.poseidon2_B_26_0 = src.interm_round_vals[26][0]; - dest.poseidon2_B_26_1 = src.interm_round_vals[26][1]; - dest.poseidon2_B_26_2 = src.interm_round_vals[26][2]; - dest.poseidon2_B_26_3 = src.interm_round_vals[26][3]; - dest.poseidon2_B_27_0 = src.interm_round_vals[27][0]; - dest.poseidon2_B_27_1 = src.interm_round_vals[27][1]; - dest.poseidon2_B_27_2 = src.interm_round_vals[27][2]; - dest.poseidon2_B_27_3 = src.interm_round_vals[27][3]; - dest.poseidon2_B_28_0 = src.interm_round_vals[28][0]; - dest.poseidon2_B_28_1 = src.interm_round_vals[28][1]; - dest.poseidon2_B_28_2 = src.interm_round_vals[28][2]; - dest.poseidon2_B_28_3 = src.interm_round_vals[28][3]; - dest.poseidon2_B_29_0 = src.interm_round_vals[29][0]; - dest.poseidon2_B_29_1 = src.interm_round_vals[29][1]; - dest.poseidon2_B_29_2 = src.interm_round_vals[29][2]; - dest.poseidon2_B_29_3 = src.interm_round_vals[29][3]; - dest.poseidon2_B_30_0 = src.interm_round_vals[30][0]; - dest.poseidon2_B_30_1 = src.interm_round_vals[30][1]; - dest.poseidon2_B_30_2 = src.interm_round_vals[30][2]; - dest.poseidon2_B_30_3 = src.interm_round_vals[30][3]; - dest.poseidon2_B_31_0 = src.interm_round_vals[31][0]; - dest.poseidon2_B_31_1 = src.interm_round_vals[31][1]; - dest.poseidon2_B_31_2 = src.interm_round_vals[31][2]; - dest.poseidon2_B_31_3 = src.interm_round_vals[31][3]; - dest.poseidon2_B_32_0 = src.interm_round_vals[32][0]; - dest.poseidon2_B_32_1 = src.interm_round_vals[32][1]; - dest.poseidon2_B_32_2 = src.interm_round_vals[32][2]; - dest.poseidon2_B_32_3 = src.interm_round_vals[32][3]; - dest.poseidon2_B_33_0 = src.interm_round_vals[33][0]; - dest.poseidon2_B_33_1 = src.interm_round_vals[33][1]; - dest.poseidon2_B_33_2 = src.interm_round_vals[33][2]; - dest.poseidon2_B_33_3 = src.interm_round_vals[33][3]; - dest.poseidon2_B_34_0 = src.interm_round_vals[34][0]; - dest.poseidon2_B_34_1 = src.interm_round_vals[34][1]; - dest.poseidon2_B_34_2 = src.interm_round_vals[34][2]; - dest.poseidon2_B_34_3 = src.interm_round_vals[34][3]; - dest.poseidon2_B_35_0 = src.interm_round_vals[35][0]; - dest.poseidon2_B_35_1 = src.interm_round_vals[35][1]; - dest.poseidon2_B_35_2 = src.interm_round_vals[35][2]; - dest.poseidon2_B_35_3 = src.interm_round_vals[35][3]; - dest.poseidon2_B_36_0 = src.interm_round_vals[36][0]; - dest.poseidon2_B_36_1 = src.interm_round_vals[36][1]; - dest.poseidon2_B_36_2 = src.interm_round_vals[36][2]; - dest.poseidon2_B_36_3 = src.interm_round_vals[36][3]; - dest.poseidon2_B_37_0 = src.interm_round_vals[37][0]; - dest.poseidon2_B_37_1 = src.interm_round_vals[37][1]; - dest.poseidon2_B_37_2 = src.interm_round_vals[37][2]; - dest.poseidon2_B_37_3 = src.interm_round_vals[37][3]; - dest.poseidon2_B_38_0 = src.interm_round_vals[38][0]; - dest.poseidon2_B_38_1 = src.interm_round_vals[38][1]; - dest.poseidon2_B_38_2 = src.interm_round_vals[38][2]; - dest.poseidon2_B_38_3 = src.interm_round_vals[38][3]; - dest.poseidon2_B_39_0 = src.interm_round_vals[39][0]; - dest.poseidon2_B_39_1 = src.interm_round_vals[39][1]; - dest.poseidon2_B_39_2 = src.interm_round_vals[39][2]; - dest.poseidon2_B_39_3 = src.interm_round_vals[39][3]; - dest.poseidon2_B_40_0 = src.interm_round_vals[40][0]; - dest.poseidon2_B_40_1 = src.interm_round_vals[40][1]; - dest.poseidon2_B_40_2 = src.interm_round_vals[40][2]; - dest.poseidon2_B_40_3 = src.interm_round_vals[40][3]; - dest.poseidon2_B_41_0 = src.interm_round_vals[41][0]; - dest.poseidon2_B_41_1 = src.interm_round_vals[41][1]; - dest.poseidon2_B_41_2 = src.interm_round_vals[41][2]; - dest.poseidon2_B_41_3 = src.interm_round_vals[41][3]; - dest.poseidon2_B_42_0 = src.interm_round_vals[42][0]; - dest.poseidon2_B_42_1 = src.interm_round_vals[42][1]; - dest.poseidon2_B_42_2 = src.interm_round_vals[42][2]; - dest.poseidon2_B_42_3 = src.interm_round_vals[42][3]; - dest.poseidon2_B_43_0 = src.interm_round_vals[43][0]; - dest.poseidon2_B_43_1 = src.interm_round_vals[43][1]; - dest.poseidon2_B_43_2 = src.interm_round_vals[43][2]; - dest.poseidon2_B_43_3 = src.interm_round_vals[43][3]; - dest.poseidon2_B_44_0 = src.interm_round_vals[44][0]; - dest.poseidon2_B_44_1 = src.interm_round_vals[44][1]; - dest.poseidon2_B_44_2 = src.interm_round_vals[44][2]; - dest.poseidon2_B_44_3 = src.interm_round_vals[44][3]; - dest.poseidon2_B_45_0 = src.interm_round_vals[45][0]; - dest.poseidon2_B_45_1 = src.interm_round_vals[45][1]; - dest.poseidon2_B_45_2 = src.interm_round_vals[45][2]; - dest.poseidon2_B_45_3 = src.interm_round_vals[45][3]; - dest.poseidon2_B_46_0 = src.interm_round_vals[46][0]; - dest.poseidon2_B_46_1 = src.interm_round_vals[46][1]; - dest.poseidon2_B_46_2 = src.interm_round_vals[46][2]; - dest.poseidon2_B_46_3 = src.interm_round_vals[46][3]; - dest.poseidon2_B_47_0 = src.interm_round_vals[47][0]; - dest.poseidon2_B_47_1 = src.interm_round_vals[47][1]; - dest.poseidon2_B_47_2 = src.interm_round_vals[47][2]; - dest.poseidon2_B_47_3 = src.interm_round_vals[47][3]; - dest.poseidon2_B_48_0 = src.interm_round_vals[48][0]; - dest.poseidon2_B_48_1 = src.interm_round_vals[48][1]; - dest.poseidon2_B_48_2 = src.interm_round_vals[48][2]; - dest.poseidon2_B_48_3 = src.interm_round_vals[48][3]; - dest.poseidon2_B_49_0 = src.interm_round_vals[49][0]; - dest.poseidon2_B_49_1 = src.interm_round_vals[49][1]; - dest.poseidon2_B_49_2 = src.interm_round_vals[49][2]; - dest.poseidon2_B_49_3 = src.interm_round_vals[49][3]; - dest.poseidon2_B_50_0 = src.interm_round_vals[50][0]; - dest.poseidon2_B_50_1 = src.interm_round_vals[50][1]; - dest.poseidon2_B_50_2 = src.interm_round_vals[50][2]; - dest.poseidon2_B_50_3 = src.interm_round_vals[50][3]; - dest.poseidon2_B_51_0 = src.interm_round_vals[51][0]; - dest.poseidon2_B_51_1 = src.interm_round_vals[51][1]; - dest.poseidon2_B_51_2 = src.interm_round_vals[51][2]; - dest.poseidon2_B_51_3 = src.interm_round_vals[51][3]; - dest.poseidon2_B_52_0 = src.interm_round_vals[52][0]; - dest.poseidon2_B_52_1 = src.interm_round_vals[52][1]; - dest.poseidon2_B_52_2 = src.interm_round_vals[52][2]; - dest.poseidon2_B_52_3 = src.interm_round_vals[52][3]; - dest.poseidon2_B_53_0 = src.interm_round_vals[53][0]; - dest.poseidon2_B_53_1 = src.interm_round_vals[53][1]; - dest.poseidon2_B_53_2 = src.interm_round_vals[53][2]; - dest.poseidon2_B_53_3 = src.interm_round_vals[53][3]; - dest.poseidon2_B_54_0 = src.interm_round_vals[54][0]; - dest.poseidon2_B_54_1 = src.interm_round_vals[54][1]; - dest.poseidon2_B_54_2 = src.interm_round_vals[54][2]; - dest.poseidon2_B_54_3 = src.interm_round_vals[54][3]; - dest.poseidon2_B_55_0 = src.interm_round_vals[55][0]; - dest.poseidon2_B_55_1 = src.interm_round_vals[55][1]; - dest.poseidon2_B_55_2 = src.interm_round_vals[55][2]; - dest.poseidon2_B_55_3 = src.interm_round_vals[55][3]; - dest.poseidon2_B_56_0 = src.interm_round_vals[56][0]; - dest.poseidon2_B_56_1 = src.interm_round_vals[56][1]; - dest.poseidon2_B_56_2 = src.interm_round_vals[56][2]; - dest.poseidon2_B_56_3 = src.interm_round_vals[56][3]; - dest.poseidon2_B_57_0 = src.interm_round_vals[57][0]; - dest.poseidon2_B_57_1 = src.interm_round_vals[57][1]; - dest.poseidon2_B_57_2 = src.interm_round_vals[57][2]; - dest.poseidon2_B_57_3 = src.interm_round_vals[57][3]; - dest.poseidon2_B_58_0 = src.interm_round_vals[58][0]; - dest.poseidon2_B_58_1 = src.interm_round_vals[58][1]; - dest.poseidon2_B_58_2 = src.interm_round_vals[58][2]; - dest.poseidon2_B_58_3 = src.interm_round_vals[58][3]; - dest.poseidon2_B_59_0 = src.interm_round_vals[59][0]; - dest.poseidon2_B_59_1 = src.interm_round_vals[59][1]; - dest.poseidon2_B_59_2 = src.interm_round_vals[59][2]; - dest.poseidon2_B_59_3 = src.interm_round_vals[59][3]; - // Full rounds - dest.poseidon2_T_60_6 = src.interm_round_vals[60][0]; - dest.poseidon2_T_60_5 = src.interm_round_vals[60][1]; - dest.poseidon2_T_60_7 = src.interm_round_vals[60][2]; - dest.poseidon2_T_60_4 = src.interm_round_vals[60][3]; - - dest.poseidon2_T_61_6 = src.interm_round_vals[61][0]; - dest.poseidon2_T_61_5 = src.interm_round_vals[61][1]; - dest.poseidon2_T_61_7 = src.interm_round_vals[61][2]; - dest.poseidon2_T_61_4 = src.interm_round_vals[61][3]; - - dest.poseidon2_T_62_6 = src.interm_round_vals[62][0]; - dest.poseidon2_T_62_5 = src.interm_round_vals[62][1]; - dest.poseidon2_T_62_7 = src.interm_round_vals[62][2]; - dest.poseidon2_T_62_4 = src.interm_round_vals[62][3]; + private: + std::vector poseidon2_trace; +}; - dest.poseidon2_T_63_6 = src.interm_round_vals[63][0]; - dest.poseidon2_T_63_5 = src.interm_round_vals[63][1]; - dest.poseidon2_T_63_7 = src.interm_round_vals[63][2]; - dest.poseidon2_T_63_4 = src.interm_round_vals[63][3]; +template void merge_into(DestRow& dest, const AvmPoseidon2TraceBuilder::Poseidon2TraceEntry& src) +{ + // Mem Stuff + dest.poseidon2_a_0 = src.input[0]; + dest.poseidon2_a_1 = src.input[1]; + dest.poseidon2_a_2 = src.input[2]; + dest.poseidon2_a_3 = src.input[3]; + dest.poseidon2_b_0 = src.output[0]; + dest.poseidon2_b_1 = src.output[1]; + dest.poseidon2_b_2 = src.output[2]; + dest.poseidon2_b_3 = src.output[3]; + dest.poseidon2_input_addr = src.input_addr; + dest.poseidon2_output_addr = src.output_addr; + dest.poseidon2_mem_addr_read_a = src.input_addr; + dest.poseidon2_mem_addr_read_b = src.input_addr + 1; + dest.poseidon2_mem_addr_read_c = src.input_addr + 2; + dest.poseidon2_mem_addr_read_d = src.input_addr + 3; + dest.poseidon2_mem_addr_write_a = src.output_addr; + dest.poseidon2_mem_addr_write_b = src.output_addr + 1; + dest.poseidon2_mem_addr_write_c = src.output_addr + 2; + dest.poseidon2_mem_addr_write_d = src.output_addr + 3; + dest.poseidon2_sel_poseidon_perm = FF(1); + // First Ext Round + dest.poseidon2_EXT_LAYER_6 = src.first_ext[0]; + dest.poseidon2_EXT_LAYER_5 = src.first_ext[1]; + dest.poseidon2_EXT_LAYER_7 = src.first_ext[2]; + dest.poseidon2_EXT_LAYER_4 = src.first_ext[3]; + // Full rounds + dest.poseidon2_T_0_6 = src.interm_round_vals[0][0]; + dest.poseidon2_T_0_5 = src.interm_round_vals[0][1]; + dest.poseidon2_T_0_7 = src.interm_round_vals[0][2]; + dest.poseidon2_T_0_4 = src.interm_round_vals[0][3]; + dest.poseidon2_T_1_6 = src.interm_round_vals[1][0]; + dest.poseidon2_T_1_5 = src.interm_round_vals[1][1]; + dest.poseidon2_T_1_7 = src.interm_round_vals[1][2]; + dest.poseidon2_T_1_4 = src.interm_round_vals[1][3]; + dest.poseidon2_T_2_6 = src.interm_round_vals[2][0]; + dest.poseidon2_T_2_5 = src.interm_round_vals[2][1]; + dest.poseidon2_T_2_7 = src.interm_round_vals[2][2]; + dest.poseidon2_T_2_4 = src.interm_round_vals[2][3]; + dest.poseidon2_T_3_6 = src.interm_round_vals[3][0]; + dest.poseidon2_T_3_5 = src.interm_round_vals[3][1]; + dest.poseidon2_T_3_7 = src.interm_round_vals[3][2]; + dest.poseidon2_T_3_4 = src.interm_round_vals[3][3]; + // Partial rounds + dest.poseidon2_B_4_0 = src.interm_round_vals[4][0]; + dest.poseidon2_B_4_1 = src.interm_round_vals[4][1]; + dest.poseidon2_B_4_2 = src.interm_round_vals[4][2]; + dest.poseidon2_B_4_3 = src.interm_round_vals[4][3]; + dest.poseidon2_B_5_0 = src.interm_round_vals[5][0]; + dest.poseidon2_B_5_1 = src.interm_round_vals[5][1]; + dest.poseidon2_B_5_2 = src.interm_round_vals[5][2]; + dest.poseidon2_B_5_3 = src.interm_round_vals[5][3]; + dest.poseidon2_B_6_0 = src.interm_round_vals[6][0]; + dest.poseidon2_B_6_1 = src.interm_round_vals[6][1]; + dest.poseidon2_B_6_2 = src.interm_round_vals[6][2]; + dest.poseidon2_B_6_3 = src.interm_round_vals[6][3]; + dest.poseidon2_B_7_0 = src.interm_round_vals[7][0]; + dest.poseidon2_B_7_1 = src.interm_round_vals[7][1]; + dest.poseidon2_B_7_2 = src.interm_round_vals[7][2]; + dest.poseidon2_B_7_3 = src.interm_round_vals[7][3]; + dest.poseidon2_B_8_0 = src.interm_round_vals[8][0]; + dest.poseidon2_B_8_1 = src.interm_round_vals[8][1]; + dest.poseidon2_B_8_2 = src.interm_round_vals[8][2]; + dest.poseidon2_B_8_3 = src.interm_round_vals[8][3]; + dest.poseidon2_B_9_0 = src.interm_round_vals[9][0]; + dest.poseidon2_B_9_1 = src.interm_round_vals[9][1]; + dest.poseidon2_B_9_2 = src.interm_round_vals[9][2]; + dest.poseidon2_B_9_3 = src.interm_round_vals[9][3]; + dest.poseidon2_B_10_0 = src.interm_round_vals[10][0]; + dest.poseidon2_B_10_1 = src.interm_round_vals[10][1]; + dest.poseidon2_B_10_2 = src.interm_round_vals[10][2]; + dest.poseidon2_B_10_3 = src.interm_round_vals[10][3]; + dest.poseidon2_B_11_0 = src.interm_round_vals[11][0]; + dest.poseidon2_B_11_1 = src.interm_round_vals[11][1]; + dest.poseidon2_B_11_2 = src.interm_round_vals[11][2]; + dest.poseidon2_B_11_3 = src.interm_round_vals[11][3]; + dest.poseidon2_B_12_0 = src.interm_round_vals[12][0]; + dest.poseidon2_B_12_1 = src.interm_round_vals[12][1]; + dest.poseidon2_B_12_2 = src.interm_round_vals[12][2]; + dest.poseidon2_B_12_3 = src.interm_round_vals[12][3]; + dest.poseidon2_B_13_0 = src.interm_round_vals[13][0]; + dest.poseidon2_B_13_1 = src.interm_round_vals[13][1]; + dest.poseidon2_B_13_2 = src.interm_round_vals[13][2]; + dest.poseidon2_B_13_3 = src.interm_round_vals[13][3]; + dest.poseidon2_B_14_0 = src.interm_round_vals[14][0]; + dest.poseidon2_B_14_1 = src.interm_round_vals[14][1]; + dest.poseidon2_B_14_2 = src.interm_round_vals[14][2]; + dest.poseidon2_B_14_3 = src.interm_round_vals[14][3]; + dest.poseidon2_B_15_0 = src.interm_round_vals[15][0]; + dest.poseidon2_B_15_1 = src.interm_round_vals[15][1]; + dest.poseidon2_B_15_2 = src.interm_round_vals[15][2]; + dest.poseidon2_B_15_3 = src.interm_round_vals[15][3]; + dest.poseidon2_B_16_0 = src.interm_round_vals[16][0]; + dest.poseidon2_B_16_1 = src.interm_round_vals[16][1]; + dest.poseidon2_B_16_2 = src.interm_round_vals[16][2]; + dest.poseidon2_B_16_3 = src.interm_round_vals[16][3]; + dest.poseidon2_B_17_0 = src.interm_round_vals[17][0]; + dest.poseidon2_B_17_1 = src.interm_round_vals[17][1]; + dest.poseidon2_B_17_2 = src.interm_round_vals[17][2]; + dest.poseidon2_B_17_3 = src.interm_round_vals[17][3]; + dest.poseidon2_B_18_0 = src.interm_round_vals[18][0]; + dest.poseidon2_B_18_1 = src.interm_round_vals[18][1]; + dest.poseidon2_B_18_2 = src.interm_round_vals[18][2]; + dest.poseidon2_B_18_3 = src.interm_round_vals[18][3]; + dest.poseidon2_B_19_0 = src.interm_round_vals[19][0]; + dest.poseidon2_B_19_1 = src.interm_round_vals[19][1]; + dest.poseidon2_B_19_2 = src.interm_round_vals[19][2]; + dest.poseidon2_B_19_3 = src.interm_round_vals[19][3]; + dest.poseidon2_B_20_0 = src.interm_round_vals[20][0]; + dest.poseidon2_B_20_1 = src.interm_round_vals[20][1]; + dest.poseidon2_B_20_2 = src.interm_round_vals[20][2]; + dest.poseidon2_B_20_3 = src.interm_round_vals[20][3]; + dest.poseidon2_B_21_0 = src.interm_round_vals[21][0]; + dest.poseidon2_B_21_1 = src.interm_round_vals[21][1]; + dest.poseidon2_B_21_2 = src.interm_round_vals[21][2]; + dest.poseidon2_B_21_3 = src.interm_round_vals[21][3]; + dest.poseidon2_B_22_0 = src.interm_round_vals[22][0]; + dest.poseidon2_B_22_1 = src.interm_round_vals[22][1]; + dest.poseidon2_B_22_2 = src.interm_round_vals[22][2]; + dest.poseidon2_B_22_3 = src.interm_round_vals[22][3]; + dest.poseidon2_B_23_0 = src.interm_round_vals[23][0]; + dest.poseidon2_B_23_1 = src.interm_round_vals[23][1]; + dest.poseidon2_B_23_2 = src.interm_round_vals[23][2]; + dest.poseidon2_B_23_3 = src.interm_round_vals[23][3]; + dest.poseidon2_B_24_0 = src.interm_round_vals[24][0]; + dest.poseidon2_B_24_1 = src.interm_round_vals[24][1]; + dest.poseidon2_B_24_2 = src.interm_round_vals[24][2]; + dest.poseidon2_B_24_3 = src.interm_round_vals[24][3]; + dest.poseidon2_B_25_0 = src.interm_round_vals[25][0]; + dest.poseidon2_B_25_1 = src.interm_round_vals[25][1]; + dest.poseidon2_B_25_2 = src.interm_round_vals[25][2]; + dest.poseidon2_B_25_3 = src.interm_round_vals[25][3]; + dest.poseidon2_B_26_0 = src.interm_round_vals[26][0]; + dest.poseidon2_B_26_1 = src.interm_round_vals[26][1]; + dest.poseidon2_B_26_2 = src.interm_round_vals[26][2]; + dest.poseidon2_B_26_3 = src.interm_round_vals[26][3]; + dest.poseidon2_B_27_0 = src.interm_round_vals[27][0]; + dest.poseidon2_B_27_1 = src.interm_round_vals[27][1]; + dest.poseidon2_B_27_2 = src.interm_round_vals[27][2]; + dest.poseidon2_B_27_3 = src.interm_round_vals[27][3]; + dest.poseidon2_B_28_0 = src.interm_round_vals[28][0]; + dest.poseidon2_B_28_1 = src.interm_round_vals[28][1]; + dest.poseidon2_B_28_2 = src.interm_round_vals[28][2]; + dest.poseidon2_B_28_3 = src.interm_round_vals[28][3]; + dest.poseidon2_B_29_0 = src.interm_round_vals[29][0]; + dest.poseidon2_B_29_1 = src.interm_round_vals[29][1]; + dest.poseidon2_B_29_2 = src.interm_round_vals[29][2]; + dest.poseidon2_B_29_3 = src.interm_round_vals[29][3]; + dest.poseidon2_B_30_0 = src.interm_round_vals[30][0]; + dest.poseidon2_B_30_1 = src.interm_round_vals[30][1]; + dest.poseidon2_B_30_2 = src.interm_round_vals[30][2]; + dest.poseidon2_B_30_3 = src.interm_round_vals[30][3]; + dest.poseidon2_B_31_0 = src.interm_round_vals[31][0]; + dest.poseidon2_B_31_1 = src.interm_round_vals[31][1]; + dest.poseidon2_B_31_2 = src.interm_round_vals[31][2]; + dest.poseidon2_B_31_3 = src.interm_round_vals[31][3]; + dest.poseidon2_B_32_0 = src.interm_round_vals[32][0]; + dest.poseidon2_B_32_1 = src.interm_round_vals[32][1]; + dest.poseidon2_B_32_2 = src.interm_round_vals[32][2]; + dest.poseidon2_B_32_3 = src.interm_round_vals[32][3]; + dest.poseidon2_B_33_0 = src.interm_round_vals[33][0]; + dest.poseidon2_B_33_1 = src.interm_round_vals[33][1]; + dest.poseidon2_B_33_2 = src.interm_round_vals[33][2]; + dest.poseidon2_B_33_3 = src.interm_round_vals[33][3]; + dest.poseidon2_B_34_0 = src.interm_round_vals[34][0]; + dest.poseidon2_B_34_1 = src.interm_round_vals[34][1]; + dest.poseidon2_B_34_2 = src.interm_round_vals[34][2]; + dest.poseidon2_B_34_3 = src.interm_round_vals[34][3]; + dest.poseidon2_B_35_0 = src.interm_round_vals[35][0]; + dest.poseidon2_B_35_1 = src.interm_round_vals[35][1]; + dest.poseidon2_B_35_2 = src.interm_round_vals[35][2]; + dest.poseidon2_B_35_3 = src.interm_round_vals[35][3]; + dest.poseidon2_B_36_0 = src.interm_round_vals[36][0]; + dest.poseidon2_B_36_1 = src.interm_round_vals[36][1]; + dest.poseidon2_B_36_2 = src.interm_round_vals[36][2]; + dest.poseidon2_B_36_3 = src.interm_round_vals[36][3]; + dest.poseidon2_B_37_0 = src.interm_round_vals[37][0]; + dest.poseidon2_B_37_1 = src.interm_round_vals[37][1]; + dest.poseidon2_B_37_2 = src.interm_round_vals[37][2]; + dest.poseidon2_B_37_3 = src.interm_round_vals[37][3]; + dest.poseidon2_B_38_0 = src.interm_round_vals[38][0]; + dest.poseidon2_B_38_1 = src.interm_round_vals[38][1]; + dest.poseidon2_B_38_2 = src.interm_round_vals[38][2]; + dest.poseidon2_B_38_3 = src.interm_round_vals[38][3]; + dest.poseidon2_B_39_0 = src.interm_round_vals[39][0]; + dest.poseidon2_B_39_1 = src.interm_round_vals[39][1]; + dest.poseidon2_B_39_2 = src.interm_round_vals[39][2]; + dest.poseidon2_B_39_3 = src.interm_round_vals[39][3]; + dest.poseidon2_B_40_0 = src.interm_round_vals[40][0]; + dest.poseidon2_B_40_1 = src.interm_round_vals[40][1]; + dest.poseidon2_B_40_2 = src.interm_round_vals[40][2]; + dest.poseidon2_B_40_3 = src.interm_round_vals[40][3]; + dest.poseidon2_B_41_0 = src.interm_round_vals[41][0]; + dest.poseidon2_B_41_1 = src.interm_round_vals[41][1]; + dest.poseidon2_B_41_2 = src.interm_round_vals[41][2]; + dest.poseidon2_B_41_3 = src.interm_round_vals[41][3]; + dest.poseidon2_B_42_0 = src.interm_round_vals[42][0]; + dest.poseidon2_B_42_1 = src.interm_round_vals[42][1]; + dest.poseidon2_B_42_2 = src.interm_round_vals[42][2]; + dest.poseidon2_B_42_3 = src.interm_round_vals[42][3]; + dest.poseidon2_B_43_0 = src.interm_round_vals[43][0]; + dest.poseidon2_B_43_1 = src.interm_round_vals[43][1]; + dest.poseidon2_B_43_2 = src.interm_round_vals[43][2]; + dest.poseidon2_B_43_3 = src.interm_round_vals[43][3]; + dest.poseidon2_B_44_0 = src.interm_round_vals[44][0]; + dest.poseidon2_B_44_1 = src.interm_round_vals[44][1]; + dest.poseidon2_B_44_2 = src.interm_round_vals[44][2]; + dest.poseidon2_B_44_3 = src.interm_round_vals[44][3]; + dest.poseidon2_B_45_0 = src.interm_round_vals[45][0]; + dest.poseidon2_B_45_1 = src.interm_round_vals[45][1]; + dest.poseidon2_B_45_2 = src.interm_round_vals[45][2]; + dest.poseidon2_B_45_3 = src.interm_round_vals[45][3]; + dest.poseidon2_B_46_0 = src.interm_round_vals[46][0]; + dest.poseidon2_B_46_1 = src.interm_round_vals[46][1]; + dest.poseidon2_B_46_2 = src.interm_round_vals[46][2]; + dest.poseidon2_B_46_3 = src.interm_round_vals[46][3]; + dest.poseidon2_B_47_0 = src.interm_round_vals[47][0]; + dest.poseidon2_B_47_1 = src.interm_round_vals[47][1]; + dest.poseidon2_B_47_2 = src.interm_round_vals[47][2]; + dest.poseidon2_B_47_3 = src.interm_round_vals[47][3]; + dest.poseidon2_B_48_0 = src.interm_round_vals[48][0]; + dest.poseidon2_B_48_1 = src.interm_round_vals[48][1]; + dest.poseidon2_B_48_2 = src.interm_round_vals[48][2]; + dest.poseidon2_B_48_3 = src.interm_round_vals[48][3]; + dest.poseidon2_B_49_0 = src.interm_round_vals[49][0]; + dest.poseidon2_B_49_1 = src.interm_round_vals[49][1]; + dest.poseidon2_B_49_2 = src.interm_round_vals[49][2]; + dest.poseidon2_B_49_3 = src.interm_round_vals[49][3]; + dest.poseidon2_B_50_0 = src.interm_round_vals[50][0]; + dest.poseidon2_B_50_1 = src.interm_round_vals[50][1]; + dest.poseidon2_B_50_2 = src.interm_round_vals[50][2]; + dest.poseidon2_B_50_3 = src.interm_round_vals[50][3]; + dest.poseidon2_B_51_0 = src.interm_round_vals[51][0]; + dest.poseidon2_B_51_1 = src.interm_round_vals[51][1]; + dest.poseidon2_B_51_2 = src.interm_round_vals[51][2]; + dest.poseidon2_B_51_3 = src.interm_round_vals[51][3]; + dest.poseidon2_B_52_0 = src.interm_round_vals[52][0]; + dest.poseidon2_B_52_1 = src.interm_round_vals[52][1]; + dest.poseidon2_B_52_2 = src.interm_round_vals[52][2]; + dest.poseidon2_B_52_3 = src.interm_round_vals[52][3]; + dest.poseidon2_B_53_0 = src.interm_round_vals[53][0]; + dest.poseidon2_B_53_1 = src.interm_round_vals[53][1]; + dest.poseidon2_B_53_2 = src.interm_round_vals[53][2]; + dest.poseidon2_B_53_3 = src.interm_round_vals[53][3]; + dest.poseidon2_B_54_0 = src.interm_round_vals[54][0]; + dest.poseidon2_B_54_1 = src.interm_round_vals[54][1]; + dest.poseidon2_B_54_2 = src.interm_round_vals[54][2]; + dest.poseidon2_B_54_3 = src.interm_round_vals[54][3]; + dest.poseidon2_B_55_0 = src.interm_round_vals[55][0]; + dest.poseidon2_B_55_1 = src.interm_round_vals[55][1]; + dest.poseidon2_B_55_2 = src.interm_round_vals[55][2]; + dest.poseidon2_B_55_3 = src.interm_round_vals[55][3]; + dest.poseidon2_B_56_0 = src.interm_round_vals[56][0]; + dest.poseidon2_B_56_1 = src.interm_round_vals[56][1]; + dest.poseidon2_B_56_2 = src.interm_round_vals[56][2]; + dest.poseidon2_B_56_3 = src.interm_round_vals[56][3]; + dest.poseidon2_B_57_0 = src.interm_round_vals[57][0]; + dest.poseidon2_B_57_1 = src.interm_round_vals[57][1]; + dest.poseidon2_B_57_2 = src.interm_round_vals[57][2]; + dest.poseidon2_B_57_3 = src.interm_round_vals[57][3]; + dest.poseidon2_B_58_0 = src.interm_round_vals[58][0]; + dest.poseidon2_B_58_1 = src.interm_round_vals[58][1]; + dest.poseidon2_B_58_2 = src.interm_round_vals[58][2]; + dest.poseidon2_B_58_3 = src.interm_round_vals[58][3]; + dest.poseidon2_B_59_0 = src.interm_round_vals[59][0]; + dest.poseidon2_B_59_1 = src.interm_round_vals[59][1]; + dest.poseidon2_B_59_2 = src.interm_round_vals[59][2]; + dest.poseidon2_B_59_3 = src.interm_round_vals[59][3]; + // Full rounds + dest.poseidon2_T_60_6 = src.interm_round_vals[60][0]; + dest.poseidon2_T_60_5 = src.interm_round_vals[60][1]; + dest.poseidon2_T_60_7 = src.interm_round_vals[60][2]; + dest.poseidon2_T_60_4 = src.interm_round_vals[60][3]; - return dest; - } + dest.poseidon2_T_61_6 = src.interm_round_vals[61][0]; + dest.poseidon2_T_61_5 = src.interm_round_vals[61][1]; + dest.poseidon2_T_61_7 = src.interm_round_vals[61][2]; + dest.poseidon2_T_61_4 = src.interm_round_vals[61][3]; - template void merge_into(DestRow& dest, Poseidon2Row const& src) - { - dest.poseidon2_a_0 = src.poseidon2_a_0; - dest.poseidon2_a_1 = src.poseidon2_a_1; - dest.poseidon2_a_2 = src.poseidon2_a_2; - dest.poseidon2_a_3 = src.poseidon2_a_3; - dest.poseidon2_b_0 = src.poseidon2_b_0; - dest.poseidon2_b_1 = src.poseidon2_b_1; - dest.poseidon2_b_2 = src.poseidon2_b_2; - dest.poseidon2_b_3 = src.poseidon2_b_3; - dest.poseidon2_input_addr = src.poseidon2_input_addr; - dest.poseidon2_output_addr = src.poseidon2_output_addr; - dest.poseidon2_mem_addr_read_a = src.poseidon2_mem_addr_read_a; - dest.poseidon2_mem_addr_read_b = src.poseidon2_mem_addr_read_b; - dest.poseidon2_mem_addr_read_c = src.poseidon2_mem_addr_read_c; - dest.poseidon2_mem_addr_read_d = src.poseidon2_mem_addr_read_d; - dest.poseidon2_mem_addr_write_a = src.poseidon2_mem_addr_write_a; - dest.poseidon2_mem_addr_write_b = src.poseidon2_mem_addr_write_b; - dest.poseidon2_mem_addr_write_c = src.poseidon2_mem_addr_write_c; - dest.poseidon2_mem_addr_write_d = src.poseidon2_mem_addr_write_d; - dest.poseidon2_sel_poseidon_perm = src.poseidon2_sel_poseidon_perm; - dest.poseidon2_B_10_0 = src.poseidon2_B_10_0; - dest.poseidon2_B_10_1 = src.poseidon2_B_10_1; - dest.poseidon2_B_10_2 = src.poseidon2_B_10_2; - dest.poseidon2_B_10_3 = src.poseidon2_B_10_3; - dest.poseidon2_B_11_0 = src.poseidon2_B_11_0; - dest.poseidon2_B_11_1 = src.poseidon2_B_11_1; - dest.poseidon2_B_11_2 = src.poseidon2_B_11_2; - dest.poseidon2_B_11_3 = src.poseidon2_B_11_3; - dest.poseidon2_B_12_0 = src.poseidon2_B_12_0; - dest.poseidon2_B_12_1 = src.poseidon2_B_12_1; - dest.poseidon2_B_12_2 = src.poseidon2_B_12_2; - dest.poseidon2_B_12_3 = src.poseidon2_B_12_3; - dest.poseidon2_B_13_0 = src.poseidon2_B_13_0; - dest.poseidon2_B_13_1 = src.poseidon2_B_13_1; - dest.poseidon2_B_13_2 = src.poseidon2_B_13_2; - dest.poseidon2_B_13_3 = src.poseidon2_B_13_3; - dest.poseidon2_B_14_0 = src.poseidon2_B_14_0; - dest.poseidon2_B_14_1 = src.poseidon2_B_14_1; - dest.poseidon2_B_14_2 = src.poseidon2_B_14_2; - dest.poseidon2_B_14_3 = src.poseidon2_B_14_3; - dest.poseidon2_B_15_0 = src.poseidon2_B_15_0; - dest.poseidon2_B_15_1 = src.poseidon2_B_15_1; - dest.poseidon2_B_15_2 = src.poseidon2_B_15_2; - dest.poseidon2_B_15_3 = src.poseidon2_B_15_3; - dest.poseidon2_B_16_0 = src.poseidon2_B_16_0; - dest.poseidon2_B_16_1 = src.poseidon2_B_16_1; - dest.poseidon2_B_16_2 = src.poseidon2_B_16_2; - dest.poseidon2_B_16_3 = src.poseidon2_B_16_3; - dest.poseidon2_B_17_0 = src.poseidon2_B_17_0; - dest.poseidon2_B_17_1 = src.poseidon2_B_17_1; - dest.poseidon2_B_17_2 = src.poseidon2_B_17_2; - dest.poseidon2_B_17_3 = src.poseidon2_B_17_3; - dest.poseidon2_B_18_0 = src.poseidon2_B_18_0; - dest.poseidon2_B_18_1 = src.poseidon2_B_18_1; - dest.poseidon2_B_18_2 = src.poseidon2_B_18_2; - dest.poseidon2_B_18_3 = src.poseidon2_B_18_3; - dest.poseidon2_B_19_0 = src.poseidon2_B_19_0; - dest.poseidon2_B_19_1 = src.poseidon2_B_19_1; - dest.poseidon2_B_19_2 = src.poseidon2_B_19_2; - dest.poseidon2_B_19_3 = src.poseidon2_B_19_3; - dest.poseidon2_B_20_0 = src.poseidon2_B_20_0; - dest.poseidon2_B_20_1 = src.poseidon2_B_20_1; - dest.poseidon2_B_20_2 = src.poseidon2_B_20_2; - dest.poseidon2_B_20_3 = src.poseidon2_B_20_3; - dest.poseidon2_B_21_0 = src.poseidon2_B_21_0; - dest.poseidon2_B_21_1 = src.poseidon2_B_21_1; - dest.poseidon2_B_21_2 = src.poseidon2_B_21_2; - dest.poseidon2_B_21_3 = src.poseidon2_B_21_3; - dest.poseidon2_B_22_0 = src.poseidon2_B_22_0; - dest.poseidon2_B_22_1 = src.poseidon2_B_22_1; - dest.poseidon2_B_22_2 = src.poseidon2_B_22_2; - dest.poseidon2_B_22_3 = src.poseidon2_B_22_3; - dest.poseidon2_B_23_0 = src.poseidon2_B_23_0; - dest.poseidon2_B_23_1 = src.poseidon2_B_23_1; - dest.poseidon2_B_23_2 = src.poseidon2_B_23_2; - dest.poseidon2_B_23_3 = src.poseidon2_B_23_3; - dest.poseidon2_B_24_0 = src.poseidon2_B_24_0; - dest.poseidon2_B_24_1 = src.poseidon2_B_24_1; - dest.poseidon2_B_24_2 = src.poseidon2_B_24_2; - dest.poseidon2_B_24_3 = src.poseidon2_B_24_3; - dest.poseidon2_B_25_0 = src.poseidon2_B_25_0; - dest.poseidon2_B_25_1 = src.poseidon2_B_25_1; - dest.poseidon2_B_25_2 = src.poseidon2_B_25_2; - dest.poseidon2_B_25_3 = src.poseidon2_B_25_3; - dest.poseidon2_B_26_0 = src.poseidon2_B_26_0; - dest.poseidon2_B_26_1 = src.poseidon2_B_26_1; - dest.poseidon2_B_26_2 = src.poseidon2_B_26_2; - dest.poseidon2_B_26_3 = src.poseidon2_B_26_3; - dest.poseidon2_B_27_0 = src.poseidon2_B_27_0; - dest.poseidon2_B_27_1 = src.poseidon2_B_27_1; - dest.poseidon2_B_27_2 = src.poseidon2_B_27_2; - dest.poseidon2_B_27_3 = src.poseidon2_B_27_3; - dest.poseidon2_B_28_0 = src.poseidon2_B_28_0; - dest.poseidon2_B_28_1 = src.poseidon2_B_28_1; - dest.poseidon2_B_28_2 = src.poseidon2_B_28_2; - dest.poseidon2_B_28_3 = src.poseidon2_B_28_3; - dest.poseidon2_B_29_0 = src.poseidon2_B_29_0; - dest.poseidon2_B_29_1 = src.poseidon2_B_29_1; - dest.poseidon2_B_29_2 = src.poseidon2_B_29_2; - dest.poseidon2_B_29_3 = src.poseidon2_B_29_3; - dest.poseidon2_B_30_0 = src.poseidon2_B_30_0; - dest.poseidon2_B_30_1 = src.poseidon2_B_30_1; - dest.poseidon2_B_30_2 = src.poseidon2_B_30_2; - dest.poseidon2_B_30_3 = src.poseidon2_B_30_3; - dest.poseidon2_B_31_0 = src.poseidon2_B_31_0; - dest.poseidon2_B_31_1 = src.poseidon2_B_31_1; - dest.poseidon2_B_31_2 = src.poseidon2_B_31_2; - dest.poseidon2_B_31_3 = src.poseidon2_B_31_3; - dest.poseidon2_B_32_0 = src.poseidon2_B_32_0; - dest.poseidon2_B_32_1 = src.poseidon2_B_32_1; - dest.poseidon2_B_32_2 = src.poseidon2_B_32_2; - dest.poseidon2_B_32_3 = src.poseidon2_B_32_3; - dest.poseidon2_B_33_0 = src.poseidon2_B_33_0; - dest.poseidon2_B_33_1 = src.poseidon2_B_33_1; - dest.poseidon2_B_33_2 = src.poseidon2_B_33_2; - dest.poseidon2_B_33_3 = src.poseidon2_B_33_3; - dest.poseidon2_B_34_0 = src.poseidon2_B_34_0; - dest.poseidon2_B_34_1 = src.poseidon2_B_34_1; - dest.poseidon2_B_34_2 = src.poseidon2_B_34_2; - dest.poseidon2_B_34_3 = src.poseidon2_B_34_3; - dest.poseidon2_B_35_0 = src.poseidon2_B_35_0; - dest.poseidon2_B_35_1 = src.poseidon2_B_35_1; - dest.poseidon2_B_35_2 = src.poseidon2_B_35_2; - dest.poseidon2_B_35_3 = src.poseidon2_B_35_3; - dest.poseidon2_B_36_0 = src.poseidon2_B_36_0; - dest.poseidon2_B_36_1 = src.poseidon2_B_36_1; - dest.poseidon2_B_36_2 = src.poseidon2_B_36_2; - dest.poseidon2_B_36_3 = src.poseidon2_B_36_3; - dest.poseidon2_B_37_0 = src.poseidon2_B_37_0; - dest.poseidon2_B_37_1 = src.poseidon2_B_37_1; - dest.poseidon2_B_37_2 = src.poseidon2_B_37_2; - dest.poseidon2_B_37_3 = src.poseidon2_B_37_3; - dest.poseidon2_B_38_0 = src.poseidon2_B_38_0; - dest.poseidon2_B_38_1 = src.poseidon2_B_38_1; - dest.poseidon2_B_38_2 = src.poseidon2_B_38_2; - dest.poseidon2_B_38_3 = src.poseidon2_B_38_3; - dest.poseidon2_B_39_0 = src.poseidon2_B_39_0; - dest.poseidon2_B_39_1 = src.poseidon2_B_39_1; - dest.poseidon2_B_39_2 = src.poseidon2_B_39_2; - dest.poseidon2_B_39_3 = src.poseidon2_B_39_3; - dest.poseidon2_B_40_0 = src.poseidon2_B_40_0; - dest.poseidon2_B_40_1 = src.poseidon2_B_40_1; - dest.poseidon2_B_40_2 = src.poseidon2_B_40_2; - dest.poseidon2_B_40_3 = src.poseidon2_B_40_3; - dest.poseidon2_B_41_0 = src.poseidon2_B_41_0; - dest.poseidon2_B_41_1 = src.poseidon2_B_41_1; - dest.poseidon2_B_41_2 = src.poseidon2_B_41_2; - dest.poseidon2_B_41_3 = src.poseidon2_B_41_3; - dest.poseidon2_B_42_0 = src.poseidon2_B_42_0; - dest.poseidon2_B_42_1 = src.poseidon2_B_42_1; - dest.poseidon2_B_42_2 = src.poseidon2_B_42_2; - dest.poseidon2_B_42_3 = src.poseidon2_B_42_3; - dest.poseidon2_B_43_0 = src.poseidon2_B_43_0; - dest.poseidon2_B_43_1 = src.poseidon2_B_43_1; - dest.poseidon2_B_43_2 = src.poseidon2_B_43_2; - dest.poseidon2_B_43_3 = src.poseidon2_B_43_3; - dest.poseidon2_B_44_0 = src.poseidon2_B_44_0; - dest.poseidon2_B_44_1 = src.poseidon2_B_44_1; - dest.poseidon2_B_44_2 = src.poseidon2_B_44_2; - dest.poseidon2_B_44_3 = src.poseidon2_B_44_3; - dest.poseidon2_B_45_0 = src.poseidon2_B_45_0; - dest.poseidon2_B_45_1 = src.poseidon2_B_45_1; - dest.poseidon2_B_45_2 = src.poseidon2_B_45_2; - dest.poseidon2_B_45_3 = src.poseidon2_B_45_3; - dest.poseidon2_B_46_0 = src.poseidon2_B_46_0; - dest.poseidon2_B_46_1 = src.poseidon2_B_46_1; - dest.poseidon2_B_46_2 = src.poseidon2_B_46_2; - dest.poseidon2_B_46_3 = src.poseidon2_B_46_3; - dest.poseidon2_B_47_0 = src.poseidon2_B_47_0; - dest.poseidon2_B_47_1 = src.poseidon2_B_47_1; - dest.poseidon2_B_47_2 = src.poseidon2_B_47_2; - dest.poseidon2_B_47_3 = src.poseidon2_B_47_3; - dest.poseidon2_B_48_0 = src.poseidon2_B_48_0; - dest.poseidon2_B_48_1 = src.poseidon2_B_48_1; - dest.poseidon2_B_48_2 = src.poseidon2_B_48_2; - dest.poseidon2_B_48_3 = src.poseidon2_B_48_3; - dest.poseidon2_B_49_0 = src.poseidon2_B_49_0; - dest.poseidon2_B_49_1 = src.poseidon2_B_49_1; - dest.poseidon2_B_49_2 = src.poseidon2_B_49_2; - dest.poseidon2_B_49_3 = src.poseidon2_B_49_3; - dest.poseidon2_B_4_0 = src.poseidon2_B_4_0; - dest.poseidon2_B_4_1 = src.poseidon2_B_4_1; - dest.poseidon2_B_4_2 = src.poseidon2_B_4_2; - dest.poseidon2_B_4_3 = src.poseidon2_B_4_3; - dest.poseidon2_B_50_0 = src.poseidon2_B_50_0; - dest.poseidon2_B_50_1 = src.poseidon2_B_50_1; - dest.poseidon2_B_50_2 = src.poseidon2_B_50_2; - dest.poseidon2_B_50_3 = src.poseidon2_B_50_3; - dest.poseidon2_B_51_0 = src.poseidon2_B_51_0; - dest.poseidon2_B_51_1 = src.poseidon2_B_51_1; - dest.poseidon2_B_51_2 = src.poseidon2_B_51_2; - dest.poseidon2_B_51_3 = src.poseidon2_B_51_3; - dest.poseidon2_B_52_0 = src.poseidon2_B_52_0; - dest.poseidon2_B_52_1 = src.poseidon2_B_52_1; - dest.poseidon2_B_52_2 = src.poseidon2_B_52_2; - dest.poseidon2_B_52_3 = src.poseidon2_B_52_3; - dest.poseidon2_B_53_0 = src.poseidon2_B_53_0; - dest.poseidon2_B_53_1 = src.poseidon2_B_53_1; - dest.poseidon2_B_53_2 = src.poseidon2_B_53_2; - dest.poseidon2_B_53_3 = src.poseidon2_B_53_3; - dest.poseidon2_B_54_0 = src.poseidon2_B_54_0; - dest.poseidon2_B_54_1 = src.poseidon2_B_54_1; - dest.poseidon2_B_54_2 = src.poseidon2_B_54_2; - dest.poseidon2_B_54_3 = src.poseidon2_B_54_3; - dest.poseidon2_B_55_0 = src.poseidon2_B_55_0; - dest.poseidon2_B_55_1 = src.poseidon2_B_55_1; - dest.poseidon2_B_55_2 = src.poseidon2_B_55_2; - dest.poseidon2_B_55_3 = src.poseidon2_B_55_3; - dest.poseidon2_B_56_0 = src.poseidon2_B_56_0; - dest.poseidon2_B_56_1 = src.poseidon2_B_56_1; - dest.poseidon2_B_56_2 = src.poseidon2_B_56_2; - dest.poseidon2_B_56_3 = src.poseidon2_B_56_3; - dest.poseidon2_B_57_0 = src.poseidon2_B_57_0; - dest.poseidon2_B_57_1 = src.poseidon2_B_57_1; - dest.poseidon2_B_57_2 = src.poseidon2_B_57_2; - dest.poseidon2_B_57_3 = src.poseidon2_B_57_3; - dest.poseidon2_B_58_0 = src.poseidon2_B_58_0; - dest.poseidon2_B_58_1 = src.poseidon2_B_58_1; - dest.poseidon2_B_58_2 = src.poseidon2_B_58_2; - dest.poseidon2_B_58_3 = src.poseidon2_B_58_3; - dest.poseidon2_B_59_0 = src.poseidon2_B_59_0; - dest.poseidon2_B_59_1 = src.poseidon2_B_59_1; - dest.poseidon2_B_59_2 = src.poseidon2_B_59_2; - dest.poseidon2_B_59_3 = src.poseidon2_B_59_3; - dest.poseidon2_B_5_0 = src.poseidon2_B_5_0; - dest.poseidon2_B_5_1 = src.poseidon2_B_5_1; - dest.poseidon2_B_5_2 = src.poseidon2_B_5_2; - dest.poseidon2_B_5_3 = src.poseidon2_B_5_3; - dest.poseidon2_B_6_0 = src.poseidon2_B_6_0; - dest.poseidon2_B_6_1 = src.poseidon2_B_6_1; - dest.poseidon2_B_6_2 = src.poseidon2_B_6_2; - dest.poseidon2_B_6_3 = src.poseidon2_B_6_3; - dest.poseidon2_B_7_0 = src.poseidon2_B_7_0; - dest.poseidon2_B_7_1 = src.poseidon2_B_7_1; - dest.poseidon2_B_7_2 = src.poseidon2_B_7_2; - dest.poseidon2_B_7_3 = src.poseidon2_B_7_3; - dest.poseidon2_B_8_0 = src.poseidon2_B_8_0; - dest.poseidon2_B_8_1 = src.poseidon2_B_8_1; - dest.poseidon2_B_8_2 = src.poseidon2_B_8_2; - dest.poseidon2_B_8_3 = src.poseidon2_B_8_3; - dest.poseidon2_B_9_0 = src.poseidon2_B_9_0; - dest.poseidon2_B_9_1 = src.poseidon2_B_9_1; - dest.poseidon2_B_9_2 = src.poseidon2_B_9_2; - dest.poseidon2_B_9_3 = src.poseidon2_B_9_3; - dest.poseidon2_T_0_4 = src.poseidon2_T_0_4; - dest.poseidon2_T_0_5 = src.poseidon2_T_0_5; - dest.poseidon2_T_0_6 = src.poseidon2_T_0_6; - dest.poseidon2_T_0_7 = src.poseidon2_T_0_7; - dest.poseidon2_T_1_4 = src.poseidon2_T_1_4; - dest.poseidon2_T_1_5 = src.poseidon2_T_1_5; - dest.poseidon2_T_1_6 = src.poseidon2_T_1_6; - dest.poseidon2_T_1_7 = src.poseidon2_T_1_7; - dest.poseidon2_T_2_4 = src.poseidon2_T_2_4; - dest.poseidon2_T_2_5 = src.poseidon2_T_2_5; - dest.poseidon2_T_2_6 = src.poseidon2_T_2_6; - dest.poseidon2_T_2_7 = src.poseidon2_T_2_7; - dest.poseidon2_T_3_4 = src.poseidon2_T_3_4; - dest.poseidon2_T_3_5 = src.poseidon2_T_3_5; - dest.poseidon2_T_3_6 = src.poseidon2_T_3_6; - dest.poseidon2_T_3_7 = src.poseidon2_T_3_7; - dest.poseidon2_T_60_4 = src.poseidon2_T_60_4; - dest.poseidon2_T_60_5 = src.poseidon2_T_60_5; - dest.poseidon2_T_60_6 = src.poseidon2_T_60_6; - dest.poseidon2_T_60_7 = src.poseidon2_T_60_7; - dest.poseidon2_T_61_4 = src.poseidon2_T_61_4; - dest.poseidon2_T_61_5 = src.poseidon2_T_61_5; - dest.poseidon2_T_61_6 = src.poseidon2_T_61_6; - dest.poseidon2_T_61_7 = src.poseidon2_T_61_7; - dest.poseidon2_T_62_4 = src.poseidon2_T_62_4; - dest.poseidon2_T_62_5 = src.poseidon2_T_62_5; - dest.poseidon2_T_62_6 = src.poseidon2_T_62_6; - dest.poseidon2_T_62_7 = src.poseidon2_T_62_7; - dest.poseidon2_T_63_4 = src.poseidon2_T_63_4; - dest.poseidon2_T_63_5 = src.poseidon2_T_63_5; - dest.poseidon2_T_63_6 = src.poseidon2_T_63_6; - dest.poseidon2_T_63_7 = src.poseidon2_T_63_7; - dest.poseidon2_EXT_LAYER_6 = src.poseidon2_EXT_LAYER_6; - dest.poseidon2_EXT_LAYER_5 = src.poseidon2_EXT_LAYER_5; - dest.poseidon2_EXT_LAYER_7 = src.poseidon2_EXT_LAYER_7; - dest.poseidon2_EXT_LAYER_4 = src.poseidon2_EXT_LAYER_4; - } + dest.poseidon2_T_62_6 = src.interm_round_vals[62][0]; + dest.poseidon2_T_62_5 = src.interm_round_vals[62][1]; + dest.poseidon2_T_62_7 = src.interm_round_vals[62][2]; + dest.poseidon2_T_62_4 = src.interm_round_vals[62][3]; - private: - std::vector poseidon2_trace; -}; // namespace bb::avm_trace + dest.poseidon2_T_63_6 = src.interm_round_vals[63][0]; + dest.poseidon2_T_63_5 = src.interm_round_vals[63][1]; + dest.poseidon2_T_63_7 = src.interm_round_vals[63][2]; + dest.poseidon2_T_63_4 = src.interm_round_vals[63][3]; +} } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp index ab3b4d2d550..65e98eae021 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp @@ -3820,9 +3820,8 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c for (size_t i = 0; i < poseidon2_trace_size; i++) { auto& dest = main_trace.at(i); auto const& src = poseidon2_trace.at(i); - auto canonical_trace_row = bb::avm_trace::AvmPoseidon2TraceBuilder::into_canonical(src); dest.poseidon2_clk = FF(src.clk); - poseidon2_trace_builder.merge_into(dest, canonical_trace_row); + merge_into(dest, src); } // Add KeccakF1600 Gadget table diff --git a/bb-pilcom/bb-pil-backend/templates/relation.hpp.hbs b/bb-pilcom/bb-pil-backend/templates/relation.hpp.hbs index aff8f2c7937..38aa905e47b 100644 --- a/bb-pilcom/bb-pil-backend/templates/relation.hpp.hbs +++ b/bb-pilcom/bb-pil-backend/templates/relation.hpp.hbs @@ -6,11 +6,13 @@ namespace bb::{{root_name}}_vm { +{{!-- template struct {{upperCamelCase name}}Row { {{#each all_cols as |col|}} FF {{col}}{}; {{/each}} }; +--}} template class {{name}}Impl { public: