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

Function test_prf_random_key

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

Source from the content-addressed store, hash-verified

500
501 #[test]
502 fn test_prf_random_key() {
503 // basic entropy test
504 || -> Result<()> {
505 let mut prf = Prf::new(None)?;
506 let mut counters = [0; 256];
507 let n = 100_000u64;
508 let k = 10u64;
509 for i in 0..n {
510 let out = prf.output_bytes(i, k)?;
511 for byte in out {
512 counters[byte as usize] += 1;
513 }
514 }
515 assert!(entropy_test(counters, n * k as u64));
516 Ok(())
517 }()
518 .unwrap();
519 }
520 #[test]
521 fn test_prf_output_value() {
522 let mut g = Prf::new(None).unwrap();

Callers

nothing calls this directly

Calls 1

output_bytesMethod · 0.80

Tested by

no test coverage detected