debian/rust-vendor/sha1/tests/mod.rs
raw| 1 | use digest::dev::{feed_rand_16mib, fixed_reset_test}; |
| 2 | use hex_literal::hex; |
| 3 | use sha1::{Digest, Sha1}; |
| 4 | |
| 5 | digest::new_test!(sha1_kat, Sha1, fixed_reset_test); |
| 6 | digest::hash_serialization_test!(sha1_serialization, Sha1); |
| 7 | |
| 8 | #[test] |
| 9 | fn sha1_rand() { |
| 10 | let mut h = Sha1::new(); |
| 11 | feed_rand_16mib(&mut h); |
| 12 | assert_eq!( |
| 13 | h.finalize(), |
| 14 | hex!("7e565a25a8b123e9881addbcedcd927b23377a78"), |
| 15 | ); |
| 16 | } |