106 size_t num_operations = (Size) /
sizeof(
FuzzerTuple);
107 if (num_operations == 0) {
112 std::vector<uint8_t> all_fieldvm_data(total_fieldvm_data_size);
113 for (
size_t i = 0; i < num_operations; ++i) {
119 std::vector<Fr> precomputed_scalars;
132 field_vm.
run(all_fieldvm_data.data(), total_fieldvm_data_size);
135 for (
size_t i = 0; i < 32; ++i) {
137 precomputed_scalars.push_back(scalar);
145 for (
size_t i = 0; i < 4; ++i) {
148 for (
size_t j = 0; j < 4; ++j) {
149 Fr scalar = precomputed_scalars[i * 4 + j];
150 combined_point = combined_point + (base_generators[j] * scalar);
152 points.push_back(combined_point);
162 Fq hiding_Px =
Fq(precomputed_scalars[0]);
163 Fq hiding_Py =
Fq(precomputed_scalars[1]);
164 op_queue->append_hiding_op(hiding_Px, hiding_Py);
170 for (
size_t i = 0; i < num_operations; ++i) {
177 size_t generator_index = (op.generator_index & 0x7F) % points.size();
178 bool should_negate = (op.generator_index & 0x80) != 0;
180 typename G1::element point_to_add = points[generator_index];
182 point_to_add = -point_to_add;
185 bool is_infinity = point_to_add.is_point_at_infinity();
186 operation_details.emplace_back(i, op_type, generator_index,
Fr(0), is_infinity, should_negate);
187 op_queue->add_accumulate(point_to_add);
192 size_t generator_index = (op.generator_index & 0x7F) % points.size();
193 bool should_negate = (op.generator_index & 0x80) != 0;
196 Fr scalar = precomputed_scalars[op.scalar_index % precomputed_scalars.size()];
198 typename G1::element point_to_multiply = points[generator_index];
200 point_to_multiply = -point_to_multiply;
203 bool is_infinity = point_to_multiply.is_point_at_infinity();
204 operation_details.emplace_back(i, op_type, generator_index, scalar, is_infinity, should_negate);
205 op_queue->mul_accumulate(point_to_multiply, scalar);
209 operation_details.emplace_back(i, op_type, 0,
Fr(0),
false,
false);
210 op_queue->eq_and_reset();
214 operation_details.emplace_back(i, op_type, 0,
Fr(0),
false,
false);
216 op_queue->eq_and_reset();
221 operation_details.emplace_back(i, op_type, 0,
Fr(0),
false,
false);
222 op_queue->empty_row_for_testing();
226 operation_details.emplace_back(i, op_type, 0,
Fr(0),
false,
false);
233 op_queue->eq_and_reset();
235 operation_details.emplace_back(num_operations + 1,
OpType::MERGE, 0,
Fr(0),
false,
false);
250 for (
size_t i = 0; i < num_operations; ++i) {
255 for (
size_t i = 0; i < num_operations; ++i) {
262 for (
const auto& op : operation_details) {
264 op.op_index, op.op_type, op.generator_index, op.scalar, op.is_infinity, op.should_negate);
268 assert(result ==
true);