Skip to content

Commit

Permalink
Add DammSum known answer test
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Oct 17, 2024
1 parent c6cbbc1 commit a0039b4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions base_layer/common_types/src/dammsum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,12 @@ mod test {
assert_eq!(validate_checksum(&data_), Err(ChecksumError::InvalidChecksum));
}
}

#[test]
fn known_checksum() {
const SIZE: usize = 33;

// We know what the checksum for all-zero data must be
assert_eq!(compute_checksum(&[0u8; SIZE]), 0u8);
}
}

0 comments on commit a0039b4

Please sign in to comment.