()
| 485 | |
| 486 | #[test] |
| 487 | fn test_prf_fixed_key() { |
| 488 | || -> Result<()> { |
| 489 | let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"; |
| 490 | let mut prf1 = Prf::new(Some(key.clone()))?; |
| 491 | let mut prf2 = Prf::new(Some(key.clone()))?; |
| 492 | for i in 0..100_000u64 { |
| 493 | assert_eq!(prf1.output_bytes(i, 1)?, prf2.output_bytes(i, 1)?); |
| 494 | assert_eq!(prf1.output_bytes(i, 5)?, prf2.output_bytes(i, 5)?); |
| 495 | } |
| 496 | Ok(()) |
| 497 | }() |
| 498 | .unwrap(); |
| 499 | } |
| 500 | |
| 501 | #[test] |
| 502 | fn test_prf_random_key() { |