()
| 3870 | |
| 3871 | #[test] |
| 3872 | fn sha256_incremental() { |
| 3873 | let mut hasher = sz::Sha256::new(); |
| 3874 | hasher.update(b"ab"); |
| 3875 | hasher.update(b"c"); |
| 3876 | let hash = hasher.digest(); |
| 3877 | let expected = [ |
| 3878 | 0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23, 0xb0, 0x03, |
| 3879 | 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c, 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad, |
| 3880 | ]; |
| 3881 | assert_eq!(hash, expected); |
| 3882 | } |
| 3883 | |
| 3884 | #[test] |
| 3885 | fn sha256_long() { |