Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit f49b3f6

Browse files
authored
Fixed many warnings (#329)
1 parent f6f31cd commit f49b3f6

File tree

65 files changed

+159
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+159
-330
lines changed

include/nil/blueprint/basic_non_native_policy.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ namespace nil {
8181

8282
static non_native_field_type::value_type glue_non_native(chopped_value_type input) {
8383
non_native_field_type::value_type result;
84-
native_field_type::integral_type integral_input;
8584
result = non_native_field_type::value_type(native_field_type::integral_type(input[0].data));
8685
for (std::size_t i = 1; i < ratio; i++) {
8786
std::size_t shift = 0;
@@ -151,7 +150,6 @@ namespace nil {
151150

152151
static non_native_field_type::value_type glue_non_native(chopped_value_type input) {
153152
non_native_field_type::value_type result;
154-
native_field_type::integral_type integral_input;
155153
result = non_native_field_type::value_type(native_field_type::integral_type(input[0].data));
156154
for (std::size_t i = 1; i < ratio; i++) {
157155
std::size_t shift = 0;

include/nil/blueprint/blueprint/plonk/circuit_proxy.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ namespace nil {
5151
using lookup_constraint_type = crypto3::zk::snark::plonk_lookup_constraint<BlueprintFieldType>;
5252
using lookup_table_definition = typename nil::crypto3::zk::snark::lookup_table_definition<BlueprintFieldType>;
5353

54-
std::uint32_t id;
5554
std::shared_ptr<circuit<ArithmetizationType>> circuit_ptr;
55+
std::uint32_t id;
5656
std::set<std::uint32_t> used_gates;
5757
std::set<std::uint32_t> used_copy_constraints;
5858
std::set<std::uint32_t> used_lookup_gates;
@@ -258,7 +258,7 @@ namespace nil {
258258
std::cout << "\nlookup tables:\n";
259259
for (const auto& i : used_lookup_tables) {
260260
bool found = false;
261-
for (const auto it : lookup_table_indexes) {
261+
for (const auto& it : lookup_table_indexes) {
262262
if (it.second == (i + 1)) {
263263
os << i << ": " << it.first << "\n";
264264
found = true;

include/nil/blueprint/component_stretcher.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ namespace nil {
7777
}
7878

7979
void count_zones() {
80-
std::size_t count = 0;
8180
std::set<std::size_t> seen;
8281
for (std::size_t i = 0; i < rows_amount; i++) {
8382
auto zone = zones.find_set(i);
@@ -233,16 +232,18 @@ namespace nil {
233232
return left - right;
234233
case nil::crypto3::math::ArithmeticOperator::MULT:
235234
return left * right;
235+
default:
236+
__builtin_unreachable();
236237
}
237238
}
238239
private:
239240
const component_stretcher *stretcher;
240241
const std::size_t selector;
241242
};
242243

244+
ComponentType &component;
243245
const std::size_t old_witness_amount;
244246
const std::size_t stretched_witness_amount;
245-
ComponentType &component;
246247

247248
mutable std::size_t stretch_coeff;
248249
mutable zone_type zones;

include/nil/blueprint/components/algebra/curves/edwards/plonk/non_native/bool_scalar_multiplication.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,9 @@ namespace nil {
168168
ArithmetizationParams>::input_type &instance_input,
169169
const std::uint32_t start_row_index) {
170170
using Ed25519Type = typename crypto3::algebra::curves::ed25519;
171-
using var = typename plonk_bool_scalar_multiplication<BlueprintFieldType, ArithmetizationParams>::var;
172171

173172
std::size_t row = start_row_index;
174173
typename Ed25519Type::base_field_type::integral_type b = typename Ed25519Type::base_field_type::integral_type(var_value(assignment, instance_input.k).data);
175-
std::array<var, 4> T_x = instance_input.T.x;
176-
std::array<var, 4> T_y = instance_input.T.y;
177174
std::array<typename BlueprintFieldType::value_type, 4> T_x_array = {var_value(assignment, instance_input.T.x[0]),
178175
var_value(assignment, instance_input.T.x[1]), var_value(assignment, instance_input.T.x[2]), var_value(assignment, instance_input.T.x[3])};
179176
std::array<typename BlueprintFieldType::value_type, 4> T_y_array = {var_value(assignment, instance_input.T.y[0]),

include/nil/blueprint/components/algebra/curves/edwards/plonk/non_native/complete_addition.hpp

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ namespace nil {
334334
typename multiplication_component::input_type({T_y, R_y}), row);
335335
row += multiplication_instance.rows_amount;
336336

337-
typename addition_component::result_type z0 = generate_assignments(
337+
generate_assignments( // z0
338338
addition_instance, assignment,
339339
typename addition_component::input_type({t0.output, t1.output}), row);
340340
row += addition_instance.rows_amount;
341341

342-
typename addition_component::result_type z1 = generate_assignments(
342+
generate_assignments( // z1
343343
addition_instance, assignment,
344344
typename addition_component::input_type({t2.output, t3.output}), row);
345345
row += addition_instance.rows_amount;
@@ -349,9 +349,6 @@ namespace nil {
349349
typename multiplication_component::input_type({t0.output, t1.output}), row);
350350
row += multiplication_instance.rows_amount;
351351

352-
typename Ed25519Type::base_field_type::integral_type d =
353-
typename Ed25519Type::base_field_type::integral_type(
354-
0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3_cppui256);
355352
std::array<var, 4> d_var_array = {var(component.C(0), row + 4, false, var::column_type::constant),
356353
var(component.C(0), row + 5, false, var::column_type::constant),
357354
var(component.C(0), row + 6, false, var::column_type::constant),
@@ -372,12 +369,12 @@ namespace nil {
372369
typename multiplication_component::input_type({P_y, k0.output}), row);
373370
row += multiplication_instance.rows_amount;
374371

375-
typename addition_component::result_type k3 = generate_assignments(
372+
generate_assignments( // k3
376373
addition_instance, assignment,
377374
typename addition_component::input_type({P_x, k1.output}), row);
378375
row += addition_instance.rows_amount;
379376

380-
typename subtraction_component::result_type k4 = generate_assignments(
377+
generate_assignments( // k4
381378
subtraction_instance, assignment,
382379
typename subtraction_component::input_type({P_y, k2.output}), row);
383380
row += subtraction_instance.rows_amount;
@@ -474,12 +471,12 @@ namespace nil {
474471
typename multiplication_component::input_type({T_y, R_y}), row);
475472
row += multiplication_instance.rows_amount;
476473

477-
typename addition_component::result_type z0 = generate_circuit(
474+
generate_circuit( // z0
478475
addition_instance, bp, assignment,
479476
typename addition_component::input_type({t0.output, t1.output}), row);
480477
row += addition_instance.rows_amount;
481478

482-
typename addition_component::result_type z1 = generate_circuit(
479+
generate_circuit( // z1
483480
addition_instance, bp, assignment,
484481
typename addition_component::input_type({t2.output, t3.output}), row);
485482
row += addition_instance.rows_amount;
@@ -509,12 +506,12 @@ namespace nil {
509506
typename multiplication_component::input_type({P_y, k0.output}), row);
510507
row += multiplication_instance.rows_amount;
511508

512-
typename addition_component::result_type k3 = generate_circuit(
509+
generate_circuit( // k3
513510
addition_instance, bp, assignment,
514511
typename addition_component::input_type({P_x, k1.output}), row);
515512
row += addition_instance.rows_amount;
516513

517-
typename subtraction_component::result_type k4 = generate_circuit(
514+
generate_circuit( // k4
518515
subtraction_instance, bp, assignment,
519516
typename subtraction_component::input_type({P_y, k2.output}), row);
520517
row += subtraction_instance.rows_amount;
@@ -575,8 +572,6 @@ namespace nil {
575572
typedef crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>
576573
ArithmetizationType;
577574

578-
using var = typename plonk_ed25519_complete_addition<BlueprintFieldType, ArithmetizationParams, CurveType>::var;
579-
580575
using Ed25519Type = typename crypto3::algebra::curves::ed25519;
581576

582577
using non_native_range_component = components::range<
@@ -585,8 +580,6 @@ namespace nil {
585580
ArithmetizationType, Ed25519Type::base_field_type, non_native_policy_type>;
586581
using addition_component = addition<
587582
ArithmetizationType, Ed25519Type::base_field_type, non_native_policy_type>;
588-
using subtraction_component = subtraction<
589-
ArithmetizationType, Ed25519Type::base_field_type, non_native_policy_type>;
590583

591584
row += non_native_range_component::get_rows_amount(component.witness_amount(), 0);
592585
row += non_native_range_component::get_rows_amount(component.witness_amount(), 0);
@@ -662,11 +655,11 @@ namespace nil {
662655
static var deconvert_var(const input_type &input,
663656
var variable) {
664657
BOOST_ASSERT(variable.type == var::column_type::public_input);
665-
if (variable.rotation < input.T.x.size()) {
658+
if (std::size_t(variable.rotation) < input.T.x.size()) {
666659
return input.T.x[variable.rotation];
667-
} else if (variable.rotation < input.T.x.size() + input.T.y.size()) {
660+
} else if (std::size_t(variable.rotation) < input.T.x.size() + input.T.y.size()) {
668661
return input.T.y[variable.rotation - input.T.x.size()];
669-
} else if (variable.rotation < input.T.x.size() + input.T.y.size() + input.R.x.size()) {
662+
} else if (std::size_t(variable.rotation) < input.T.x.size() + input.T.y.size() + input.R.x.size()) {
670663
return input.R.x[variable.rotation - input.T.x.size() - input.T.y.size()];
671664
} else {
672665
return input.R.y[variable.rotation - input.T.x.size() - input.T.y.size() - input.R.x.size()];

include/nil/blueprint/components/algebra/curves/edwards/plonk/non_native/doubling.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,12 @@ namespace nil {
310310
typename subtraction_component::input_type({t0.output, t1.output}), row);
311311
row += subtraction_instance.rows_amount;
312312

313-
typename addition_component::result_type t4 = generate_assignments(
313+
generate_assignments( // t4
314314
addition_instance, assignment,
315315
typename addition_component::input_type({t2.output, t2.output}), row);
316316
row += addition_instance.rows_amount;
317317

318-
typename addition_component::result_type t5 = generate_assignments(
318+
generate_assignments( // t5
319319
addition_instance, assignment,
320320
typename addition_component::input_type({t1.output, t0.output}), row);
321321
row += addition_instance.rows_amount;
@@ -325,7 +325,7 @@ namespace nil {
325325
typename subtraction_component::input_type({t1.output, t0.output}), row);
326326
row += subtraction_instance.rows_amount;
327327

328-
typename multiplication_component::result_type t7 = generate_assignments(
328+
generate_assignments( // t7
329329
multiplication_instance, assignment,
330330
typename multiplication_component::input_type({P_x, t3.output}), row);
331331
row += multiplication_instance.rows_amount;
@@ -340,7 +340,7 @@ namespace nil {
340340
typename multiplication_component::input_type({P_y, t6.output}), row);
341341
row += multiplication_instance.rows_amount;
342342

343-
typename addition_component::result_type t10 = generate_assignments(
343+
generate_assignments( // t10
344344
addition_instance, assignment,
345345
typename addition_component::input_type({t8.output, t9.output}), row);
346346
row += addition_instance.rows_amount;
@@ -439,12 +439,12 @@ namespace nil {
439439
typename subtraction_component::input_type({t0.output, t1.output}), row);
440440
row += subtraction_instance.rows_amount;
441441

442-
typename addition_component::result_type t4 = generate_circuit(
442+
generate_circuit( // t4
443443
addition_instance, bp, assignment,
444444
typename addition_component::input_type({t2.output, t2.output}), row);
445445
row += addition_instance.rows_amount;
446446

447-
typename addition_component::result_type t5 = generate_circuit(
447+
generate_circuit( // t5
448448
addition_instance, bp, assignment,
449449
typename addition_component::input_type({t1.output, t0.output}), row);
450450
row += addition_instance.rows_amount;
@@ -454,7 +454,7 @@ namespace nil {
454454
typename subtraction_component::input_type({t1.output, t0.output}), row);
455455
row += subtraction_instance.rows_amount;
456456

457-
typename multiplication_component::result_type t7 = generate_circuit(
457+
generate_circuit( // t7
458458
multiplication_instance, bp, assignment,
459459
typename multiplication_component::input_type({P_x, t3.output}), row);
460460
row += multiplication_instance.rows_amount;
@@ -469,7 +469,7 @@ namespace nil {
469469
typename multiplication_component::input_type({P_y, t6.output}), row);
470470
row += multiplication_instance.rows_amount;
471471

472-
typename addition_component::result_type t10 = generate_circuit(
472+
generate_circuit( // t10
473473
addition_instance, bp, assignment,
474474
typename addition_component::input_type({t8.output, t9.output}), row);
475475
row += addition_instance.rows_amount;
@@ -561,7 +561,7 @@ namespace nil {
561561
static var deconvert_var(const input_type &input,
562562
var variable) {
563563
BOOST_ASSERT(variable.type == var::column_type::public_input);
564-
if (variable.rotation < input.T.x.size()) {
564+
if (std::size_t(variable.rotation) < input.T.x.size()) {
565565
return input.T.x[variable.rotation];
566566
} else {
567567
return input.T.y[variable.rotation - input.T.x.size()];

include/nil/blueprint/components/algebra/curves/edwards/plonk/non_native/scalar_non_native_range.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ namespace nil {
143143
ArithmetizationParams>::input_type &instance_input,
144144
const std::uint32_t start_row_index) {
145145
using Ed25519Type = typename crypto3::algebra::curves::ed25519;
146-
using var = typename plonk_scalar_range<BlueprintFieldType, ArithmetizationParams>::var;
147146

148147
std::size_t row = start_row_index;
149148
typename Ed25519Type::scalar_field_type::integral_type base = 1;

include/nil/blueprint/components/algebra/curves/edwards/plonk/non_native/variable_base_multiplication.hpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,7 @@ namespace nil {
225225

226226
using component_type =
227227
plonk_ed25519_var_base_mul<BlueprintFieldType, ArithmetizationParams, CurveType>;
228-
using non_native_policy_type = typename component_type::non_native_policy_type;
229228
using var = typename plonk_ed25519_mul_per_bit<BlueprintFieldType, ArithmetizationParams, CurveType>::var;
230-
using Ed25519Type = typename crypto3::algebra::curves::ed25519;
231-
typedef crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>
232-
ArithmetizationType;
233-
234-
235229

236230
using mul_per_bit_component = typename component_type::mul_per_bit_component;
237231
using decomposition_component_type = typename component_type::decomposition_component_type;
@@ -279,11 +273,7 @@ namespace nil {
279273

280274
using component_type =
281275
plonk_ed25519_var_base_mul<BlueprintFieldType, ArithmetizationParams, CurveType>;
282-
using non_native_policy_type = typename component_type::non_native_policy_type;
283276
using var = typename plonk_ed25519_mul_per_bit<BlueprintFieldType, ArithmetizationParams, CurveType>::var;
284-
using Ed25519Type = typename crypto3::algebra::curves::ed25519;
285-
typedef crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>
286-
ArithmetizationType;
287277

288278
using mul_per_bit_component = typename component_type::mul_per_bit_component;
289279
using decomposition_component_type = typename component_type::decomposition_component_type;
@@ -366,9 +356,9 @@ namespace nil {
366356
static var deconvert_var(const input_type &input,
367357
var variable) {
368358
BOOST_ASSERT(variable.type == var::column_type::public_input);
369-
if (variable.rotation < input.T.x.size()) {
359+
if (std::size_t(variable.rotation) < input.T.x.size()) {
370360
return input.T.x[variable.rotation];
371-
} else if (variable.rotation < input.T.x.size() + input.T.y.size()) {
361+
} else if (std::size_t(variable.rotation) < input.T.x.size() + input.T.y.size()) {
372362
return input.T.y[variable.rotation - input.T.x.size()];
373363
} else {
374364
return input.k;

0 commit comments

Comments
 (0)