Outdated or incorrect comments

In some places, comments have not been updated to reflect changes to the code or include minor mistakes. We list some such instances that we came across below.

In circuits/src/batch_verify/universal/mod.rs, the struct UniversalBatchVerifyCircuit has a documenting comment that outlines what the public inputs to the circuit are, but that comment has not been updated to include the commitment hash and limbs.

Similarly, also in circuits/src/batch_verify/universal/mod.rs, UniversalBatchVerifyCircuit::compute_instance has a comment in the implementation repeating the structure of the public inputs to the circuit that is not updated.

In circuits/src/batch_verify/universal/native.rs, in the function compute_pairing_check_pairs, the comments within the function about the option

// Option:
//  [
//   ( factor * M, h1),
//   ( factor * pok, h2)
// ]

are missing t (it should be t * factor * M and t * factor * pok).

In circuits/src/keccak/utils.rs, the function encode_digest_as_field_elements has comments as follows:

// Overflow is not possible here because:
// 2^{8*15} (highest byte decomposition power)
// * 2^8 (byte value upper bound)
// * 2 (the rest of the terms together, at most, will equal the highest one)
// = 2^130, which is strictly less than the number of bits of F, 254.

In the last line, the result should be 2^129 instead of 2^130. The sentence in the last line also reads as comparing 2^130 (or now 2^129) to 254, while it should be the exponent that is compared. The last line should thus read as this: = 2^129, and 129 is strictly less than the number of bits of F, 254.

In circuits/src/keccak/mod.rs, the function KeccakPaddedCircuitInput::to_instance_values has deprecated documentation comments — similarly for KeccakPaddedCircuitInput and KeccakPaddedCircuitInput::from_var_len_input.

Zellic © 2025Back to top ↑