package mirage-crypto-rng
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A cryptographically secure PRNG
Install
dune-project
Dependency
Authors
Maintainers
Sources
mirage-crypto-2.4.1.tbz
sha256=332886c365c6035077e3ce676a63da8f7500c15a1628b3c07e139b0e551f1f6f
sha512=cb8f4de93241cde0582bcd0283766c681a02dbcb9f3b4786eb0656c651f42ba2db467ff63bff79c5eacfd410e410d77dc31bfc51049c39e1e86685ec0a884c1f
doc/src/mirage-crypto-rng/entropy_test.ml.html
Source file entropy_test.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39let data = ref "" let cpu_bootstrap_check () = match Entropy.cpu_rng_bootstrap with | Error `Not_supported -> print_endline "no CPU RNG bootstrap" | Ok cpu_rng_bootstrap -> match cpu_rng_bootstrap 1 with | exception Failure f -> print_endline ("bad CPU RNG: " ^ f) | data' -> data := data'; for i = 0 to 10 do try let data' = cpu_rng_bootstrap 1 in if String.equal !data data' then failwith ("same data from CPU bootstrap at " ^ string_of_int i ^ ": " ^ String.escaped data'); data := data' with Failure f -> failwith ("CPU RNG failed at " ^ string_of_int i ^ " with " ^ f) done let whirlwind_bootstrap_check () = for i = 0 to 10 do let data' = Entropy.whirlwind_bootstrap 1 in if String.equal !data data' then failwith ("same data from whirlwind bootstrap at " ^ string_of_int i ^ " with " ^ String.escaped data'); data := data' done let timer_check () = for i = 0 to 10 do let data' = Entropy.interrupt_hook () in if String.equal !data data' then failwith ("same data from timer at " ^ string_of_int i ^ " with: " ^ String.escaped data'); data := data' done let test () = timer_check (); cpu_bootstrap_check (); whirlwind_bootstrap_check ()
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>