Skip to content

Commit c281535

Browse files
committed
Crypto/plonk_cs: wrap comments at 80 chars
1 parent 620cfbf commit c281535

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

src/lib/crypto/kimchi_pasta_snarky_backend/plonk_constraint_system.ml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ module Position = struct
9595
Array.append cols padding
9696

9797
(** Converts an array of [Constants.columns] to [Constants.permutation_cols].
98-
This is useful to truncate arrays of cells to the ones that only matter for the permutation argument.
99-
*)
98+
This is useful to truncate arrays of cells to the ones that only matter for
99+
the permutation argument. *)
100100
let cols_to_perms cols = Array.slice cols 0 Constants.permutation_cols
101101

102102
(** Converts a [Position.t] into the Rust-compatible type [Kimchi_types.wire].
@@ -110,15 +110,18 @@ module Gate_spec = struct
110110

111111
(* TODO: split kind/coeffs from row/wired_to *)
112112

113-
(** A gate/row/constraint consists of a type (kind), a row, the other cells its columns/cells are connected to (wired_to), and the selector polynomial associated with the gate. *)
113+
(** A gate/row/constraint consists of a type (kind), a row, the other cells
114+
its columns/cells are connected to (wired_to), and the selector polynomial
115+
associated with the gate. *)
114116
type ('row, 'f) t =
115117
{ kind : Kimchi_gate_type.t
116118
; wired_to : 'row Position.t array
117119
; coeffs : 'f array
118120
}
119121
[@@deriving sexp_of]
120122

121-
(** Applies a function [f] to the [row] of [t] and all the rows of its [wired_to]. *)
123+
(** Applies a function [f] to the [row] of [t] and all the rows of its
124+
[wired_to]. *)
122125
let map_rows (t : (_, _) t) ~f : (_, _) t =
123126
(* { wire with row = f row } *)
124127
let wired_to =
@@ -161,7 +164,8 @@ module Plonk_constraint = struct
161164
; m : 'fp
162165
; c : 'fp
163166
}
164-
(** the Poseidon state is an array of states (and states are arrays of size 3). *)
167+
(** the Poseidon state is an array of states (and states are arrays of
168+
size 3). *)
165169
| Poseidon of { state : 'field_var array array }
166170
| EC_add_complete of
167171
{ p1 : 'field_var * 'field_var
@@ -899,16 +903,21 @@ let finalize_runtime_lookup_tables sys =
899903
| Compiled_runtime_tables_cfg _ ->
900904
failwith "Runtime table configurations have already been finalized"
901905

902-
(* TODO: shouldn't that Make create something bounded by a signature? As we know what a back end should be? Check where this is used *)
906+
(* TODO: shouldn't that Make create something bounded by a signature? As we know
907+
what a back end should be? Check where this is used *)
903908

904-
(* TODO: glossary of terms in this file (terms, reducing, feeding) + module doc *)
909+
(* TODO: glossary of terms in this file (terms, reducing, feeding) + module
910+
doc *)
905911

906912
(* TODO: rename Fp to F or Field *)
907913

908914
(** ? *)
909915
module Make
910916
(Fp : Field.S)
911-
(* We create a type for gate vector, instead of using `Gate.t list`. If we did, we would have to convert it to a `Gate.t array` to pass it across the FFI boundary, where then it gets converted to a `Vec<Gate>`; it's more efficient to just create the `Vec<Gate>` directly.
917+
(* We create a type for gate vector, instead of using `Gate.t list`. If we
918+
did, we would have to convert it to a `Gate.t array` to pass it across the
919+
FFI boundary, where then it gets converted to a `Vec<Gate>`; it's more
920+
efficient to just create the `Vec<Gate>` directly.
912921
*)
913922
(Gates : Gate_vector_intf with type field := Fp.t)
914923
(Params : sig
@@ -1048,7 +1057,8 @@ end = struct
10481057
res
10491058

10501059
(** Compute the witness, given the constraint system `sys`
1051-
and a function that converts the indexed secret inputs to their concrete values.
1060+
and a function that converts the indexed secret inputs to their concrete
1061+
values.
10521062
*)
10531063
let compute_witness (sys : t) (external_values : int -> Fp.t) :
10541064
Fp.t array array * Fp.t Kimchi_types.runtime_table array =
@@ -1199,7 +1209,8 @@ end = struct
11991209
let set_primary_input_size (sys : t) num_pub_inputs =
12001210
Set_once.set_exn sys.public_input_size [%here] num_pub_inputs
12011211

1202-
(** Sets the number of previous challenges. It must and can only be called once. *)
1212+
(** Sets the number of previous challenges. It must and can only be called
1213+
once. *)
12031214
let set_prev_challenges (sys : t) num_prev_challenges =
12041215
Set_once.set_exn sys.prev_challenges [%here] num_prev_challenges
12051216

@@ -1227,9 +1238,11 @@ end = struct
12271238
ignore (union_find sys key : V.t Union_find.t) ;
12281239
V.Table.add_multi sys.equivalence_classes ~key ~data:{ row; col }
12291240

1230-
(* TODO: rename to wire_abs and wire_rel? or wire_public and wire_after_public? or force a single use function that takes a Row.t? *)
1241+
(* TODO: rename to wire_abs and wire_rel? or wire_public and
1242+
wire_after_public? or force a single use function that takes a Row.t? *)
12311243

1232-
(** Same as wire', except that the row must be given relatively to the end of the public-input rows. *)
1244+
(** Same as wire', except that the row must be given relatively to the end of
1245+
the public-input rows. *)
12331246
let wire sys key row col = wire' sys key (Row.After_public_input row) col
12341247

12351248
(** Adds a row/gate/constraint to a constraint system `sys`. *)
@@ -1400,7 +1413,8 @@ end = struct
14001413
if Fp.(equal zero res) then None else Some res ) )
14011414

14021415
(** Converts a [Cvar.t] to a `(terms, terms_length, has_constant)`.
1403-
if `has_constant` is set, then terms start with a constant term in the form of (c, 0).
1416+
if `has_constant` is set, then terms start with a constant term in the
1417+
form of (c, 0).
14041418
*)
14051419
let canonicalize x =
14061420
let c, terms =

0 commit comments

Comments
 (0)