From 018c1a71a21baf71be07c5f7823014b2913fea87 Mon Sep 17 00:00:00 2001 From: Bug Magnet Date: Fri, 10 Jan 2025 08:30:36 +0100 Subject: [PATCH] Generate PQ keys ahead of time on first connections --- mullvad-ios/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mullvad-ios/src/lib.rs b/mullvad-ios/src/lib.rs index 61c47803a405..849905b3d39f 100644 --- a/mullvad-ios/src/lib.rs +++ b/mullvad-ios/src/lib.rs @@ -15,6 +15,7 @@ pub static CONFIG_SERVICE_PORT: u16 = talpid_tunnel_config_client::CONFIG_SERVIC mod ios { use std::sync::OnceLock; + use talpid_tunnel_config_client::classic_mceliece::spawn_keypair_generator; use tokio::runtime::{Builder, Handle, Runtime}; static RUNTIME: OnceLock> = OnceLock::new(); @@ -26,7 +27,11 @@ mod ios { .build() .map_err(|error| ToString::to_string(&error)) }) { - Ok(runtime) => Ok(runtime.handle().clone()), + Ok(runtime) => { + let _guard = runtime.enter(); + spawn_keypair_generator(); + Ok(runtime.handle().clone()) + } Err(error) => Err(error.clone()), } }