pub async fn timing_safe_operation<T, F, Fut>(
operation: F,
min_duration_ms: u64,
) -> Result<T>Expand description
Wrapper for sensitive authentication operations with timing protection
This function wraps sensitive operations with timing protection, ensuring that both success and failure cases take similar amounts of time.
§Arguments
operation- The async operation to performmin_duration_ms- Minimum time the operation should take
§Returns
The result of the operation
§Security
Ensures that timing differences don’t leak information about the success or failure of the operation.