MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / test_prf_fixed_key

Function test_prf_fixed_key

ciphercore-base/src/random.rs:487–499  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.80

Tested by

no test coverage detected