Skip to content

Commit 32821f7

Browse files
authored
comments: apply suggestions from code review
1 parent bab5adf commit 32821f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hasher/src/roinput.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use bitvec::{prelude::*, view::AsBits};
1212
use mina_curves::pasta::{Fp, Fq};
1313
use o1_utils::FieldHelpers;
1414

15-
const SER_HEADER_SIZE: usize = 8;
16-
const SINGLE_HEADER_SIZE: usize = 4;
15+
const SER_HEADER_SIZE: usize = 8; // total number of bytes for the header of the serialized ROInput
16+
const SINGLE_HEADER_SIZE: usize = 4; // number of bytes for each part of the header of the serialized ROInput
1717

1818
/// Random oracle input structure
1919
///
@@ -197,7 +197,7 @@ impl ROInput {
197197
return Err(Error);
198198
}
199199

200-
// read back our two u64 little-endian lengths
200+
// read back our two u32 little-endian lengths
201201
let fields_len =
202202
u32::from_le_bytes(input[0..SINGLE_HEADER_SIZE].try_into().unwrap()) as usize;
203203
let bits_len = u32::from_le_bytes(
@@ -217,7 +217,7 @@ impl ROInput {
217217
return Err(Error);
218218
}
219219

220-
// allocate space for exactly `fields_ctr` elements
220+
// allocate space for exactly `fields_len` elements
221221
let mut fields = Vec::with_capacity(fields_len);
222222

223223
for chunk in bits.chunks(Fp::MODULUS_BIT_SIZE as usize).take(fields_len) {
@@ -1064,7 +1064,7 @@ mod tests {
10641064
let roi = ROInput::new().append_bool(i % 2 == 0);
10651065
let serialized = roi.serialize();
10661066

1067-
// Deserualize and check if it matches
1067+
// Deserialize and check if it matches
10681068
let deserialized_roi =
10691069
ROInput::deserialize(&serialized).expect("Failed to deserialize ROInput");
10701070
assert_eq!(

0 commit comments

Comments
 (0)