Skip to content

Commit

Permalink
casting to u64 explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
anupsv committed Feb 10, 2025
1 parent d548356 commit a3096ee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions verifier/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,15 @@ fn compute_r_powers(
data_to_be_hashed[0..24].copy_from_slice(RANDOM_CHALLENGE_KZG_BATCH_DOMAIN);

// Convert number of commitments to bytes and copy to buffer
// Uses configured endianness (Big or Little)
let n_bytes: [u8; 8] = n.to_be_bytes();
let n_bytes: [u8; 8] = (n as u64).to_be_bytes();
data_to_be_hashed[32..40].copy_from_slice(&n_bytes);

let target_slice = &mut data_to_be_hashed[24..24 + (n * 8)];
for (chunk, &length) in target_slice
.chunks_mut(8)
.zip(blobs_as_field_elements_length)
{
chunk.copy_from_slice(&length.to_be_bytes());
chunk.copy_from_slice(&(length as u64).to_be_bytes());
}
initial_data_length += n * 8;

Expand Down

0 comments on commit a3096ee

Please sign in to comment.