File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -446,22 +446,25 @@ impl JitterRng {
446
446
self . stir_pool ( ) ;
447
447
self . data
448
448
}
449
+
450
+ #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
451
+ pub fn test_timer ( & mut self ) -> Result < u8 , TimerError > {
452
+ return Err ( TimerError :: NoTimer ) ;
453
+ }
449
454
450
455
/// Basic quality tests on the timer, by measuring CPU timing jitter a few
451
456
/// hundred times.
452
457
///
453
458
/// If succesful, this will return the estimated number of rounds necessary
454
459
/// to collect 64 bits of entropy. Otherwise a `TimerError` with the cause
455
460
/// of the failure will be returned.
461
+ #[ cfg( not( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ) ]
456
462
pub fn test_timer ( & mut self ) -> Result < u8 , TimerError > {
457
463
debug ! ( "JitterRng: testing timer ..." ) ;
458
464
// We could add a check for system capabilities such as `clock_getres`
459
465
// or check for `CONFIG_X86_TSC`, but it does not make much sense as the
460
466
// following sanity checks verify that we have a high-resolution timer.
461
467
462
- #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
463
- return Err ( TimerError :: NoTimer ) ;
464
-
465
468
let mut delta_sum = 0 ;
466
469
let mut old_delta = 0 ;
467
470
You can’t perform that action at this time.
0 commit comments