Skip to content

Commit

Permalink
Better equality comparison in capsules/extra/src/test/siphash24.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Hudson Ayers <[email protected]>
  • Loading branch information
alevy and hudson-ayers authored Feb 28, 2024
1 parent 082d3cd commit f5e4484
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions capsules/extra/src/test/siphash24.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ impl Client<8> for TestSipHash24 {
fn hash_done(&self, _result: Result<(), ErrorCode>, digest: &'static mut [u8; 8]) {
let correct = self.correct_hash.take().unwrap();

let mut matches = true;
for i in 0..8 {
if correct[i] != digest[i] {
matches = false;
kernel::debug!("TestSipHash24: incorrect hash output!");
}
let matches = correct != digest;
if !matches {
kernel::debug!("TestSipHash24: incorrect hash output!");
}
kernel::debug!("TestSipHash24 matches!");

Expand Down

0 comments on commit f5e4484

Please sign in to comment.