chore(csprng): add more assert info

This commit is contained in:
Thomas Montaigu
2026-03-13 17:29:35 +01:00
committed by tmontaigu
parent 8b86d50c11
commit 8a5a63b00f
2 changed files with 4 additions and 4 deletions

View File

@@ -592,7 +592,7 @@ pub mod aes_ctr_generic_test {
let expected_byte = gen1.next().unwrap();
assert_eq!(
byte, expected_byte,
"pre-fork bytes are not equal (byte index {i}), key={k:?}, t={t:?}, offset={offset:?}"
"pre-fork bytes are not equal (byte index {i}), key={k:?}, t={t:?}, offset={offset:?} nc={nc:?}, nb={nb:?}, num_extra_bytes={num_extra_bytes}, bytes_per_parts={bytes_per_parts}"
);
}
@@ -604,7 +604,7 @@ pub mod aes_ctr_generic_test {
let expected_byte = gen1.next().unwrap();
assert_eq!(
byte, expected_byte,
"invalid byte at index {i} for child {child_i}, key={k:?}, t={t:?}, offset={offset:?}"
"invalid byte at index {i} for child {child_i}, key={k:?}, t={t:?}, offset={offset:?}offset={offset:?} nc={nc:?}, nb={nb:?}, num_extra_bytes={num_extra_bytes}, bytes_per_parts={bytes_per_parts}"
);
}
assert!(
@@ -621,7 +621,7 @@ pub mod aes_ctr_generic_test {
for i in 0..bytes_per_parts {
let byte = forked_gen.next().unwrap();
let expected_byte = gen1.next().unwrap();
assert_eq!(byte, expected_byte, "post-fork bytes are not equal (byte index {i}), got {byte}, expected {expected_byte}, key={k:?}, t={t:?}, offset={offset:?}");
assert_eq!(byte, expected_byte, "post-fork bytes are not equal (byte index {i}), got {byte}, expected {expected_byte}, key={k:?}, t={t:?}, offset={offset:?}, offset={offset:?} nc={nc:?}, nb={nb:?}, num_extra_bytes={num_extra_bytes}, bytes_per_parts={bytes_per_parts}");
}
}
}

View File

@@ -584,7 +584,7 @@ mod test {
);
}
// Test when the distance correctly subracts from "saturated" value
// Test when the distance correctly subtracts from "saturated" value
for byte_index in 1..BYTES_PER_AES_CALL {
let larger = TableIndex::FIRST.increased(u128::MAX).increased(1);
let smaller = TableIndex::FIRST.increased(byte_index as u128);