Move EC Key Generation off the main-thread with Isolates#201
Move EC Key Generation off the main-thread with Isolates#201HamdaanAliQuatil wants to merge 1 commit intomasterfrom
Conversation
|
It's been ages since looked at EC stuff, but as I recall creating private key is dirt cheap, the most expensive part is deriving the public key... Thus, if the computational effort is not import public key, because you usually only store a compressed format... I don't recall the details. Anyways, consistency shouldn't determine if offload to a background isolate or not. Computational cost should. If isolate overhead exceeds the cost the offloading is pointless, sha256 is one such case. Copying the data is probably more expensive, than computing on main thread. Or at least close to the same cost. Where RSA key generation is expensive, compared copying operations required to move off the main thread. I don't know a good metric for whether something is worth moving is. But this probably what we should start by figuring out. I propose we continue that discussion in |
Part of #198
EC key generation is faster and less likely to block the main thread because it uses scalar multiplication on elliptic curves, which is significantly less expensive than the prime generation and modular arithmetic involved in RSA. We're making a similar change here to ensure consistency across key generation paths and to ensure responsiveness.