From 45349f32521aafca9a9c8be8d723bbb0dfcd181f Mon Sep 17 00:00:00 2001 From: asonix Date: Tue, 21 Apr 2020 14:25:08 -0500 Subject: [PATCH] Precompute private key biguints --- src/data/state.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/data/state.rs b/src/data/state.rs index 6e8b215..9467487 100644 --- a/src/data/state.rs +++ b/src/data/state.rs @@ -171,7 +171,13 @@ impl State { } }; - let (blocks, whitelists, listeners, private_key) = try_join!(f1, f2, f3, f4)?; + let (blocks, whitelists, listeners, mut private_key) = try_join!(f1, f2, f3, f4)?; + + let private_key: RSAPrivateKey = web::block(move || { + private_key.precompute(); + Ok(private_key) as Result<_, std::convert::Infallible> + }) + .await?; let public_key = private_key.to_public_key(); let listeners = Arc::new(RwLock::new(listeners));