Skip to content

Commit

Permalink
Generate PQ keys ahead of time on first connections
Browse files Browse the repository at this point in the history
  • Loading branch information
buggmagnet committed Jan 10, 2025
1 parent b583cb8 commit b98dd0b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mullvad-ios/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Result<Runtime, String>> = OnceLock::new();
Expand All @@ -26,7 +27,12 @@ mod ios {
.build()
.map_err(|error| ToString::to_string(&error))
}) {
Ok(runtime) => Ok(runtime.handle().clone()),
Ok(runtime) => {
runtime.spawn(async {
spawn_keypair_generator();
});
Ok(runtime.handle().clone())
}
Err(error) => Err(error.clone()),
}
}
Expand Down

0 comments on commit b98dd0b

Please sign in to comment.