Speed up parsing RSA onion keys from microdescriptors
The two functions crypto_pk_read_public_key_from_string()
is about 9% of our startup time when we have directory information, and router_set_rsa_onion_pkey()
is about 2.4%. There is a probably a good chance to save time here, in a few ways:
-
Maybe pem_decode() could be faster. Right now it seems to be eating 3.53% of the startup time, and most of its energy is going into tor_asprintf().
-
We possibly save a decode/encode cycle, since we are parsing asn1 into an RSA key, and then re-encoding that key into an asn1 string in router_set_rsa_onion_pkey().