33#include "ext/siphash.h"
41static int have_seeded_siphash = 0;
48 if (have_seeded_siphash)
52 siphash_set_global_key(&key);
53 have_seeded_siphash = 1;
70 crypto_nss_early_init(0);
110 if (crypto_nss_late_init() < 0)
134 crypto_dh_free_all();
140 crypto_nss_global_cleanup();
147 have_seeded_siphash = 0;
148 siphash_unset_global_key();
159 crypto_nss_prefork();
175 crypto_nss_postfork();
197 return crypto_openssl_get_version_str();
200 return crypto_nss_get_version_str();
210 return crypto_openssl_get_header_version_str();
213 return crypto_nss_get_header_version_str();
229subsys_crypto_initialize(
void)
238subsys_crypto_shutdown(
void)
244subsys_crypto_prefork(
void)
250subsys_crypto_postfork(
void)
256subsys_crypto_thread_cleanup(
void)
262#define CRYPTO_OPTIONS_MAGIC 0x68757368
276 *msg_out = tor_strdup(
"Can't use hardware crypto accelerator dir "
277 "without engine name.");
285#define CONF_CONTEXT LL_TABLE
294 .magic = {
"crypto_options_t",
297 .vars = crypto_options_t_vars,
315 log_err(
LD_BUG,
"Unable to initialize the crypto subsystem. Exiting.");
326 .initialize = subsys_crypto_initialize,
327 .shutdown = subsys_crypto_shutdown,
328 .prefork = subsys_crypto_prefork,
329 .postfork = subsys_crypto_postfork,
330 .thread_cleanup = subsys_crypto_thread_cleanup,
Types used to specify configurable options.
void curve25519_init(void)
Header for crypto_curve25519.c.
Header for crypto_ed25519.c.
int crypto_global_cleanup(void)
static int crypto_options_validate(const void *arg, char **msg_out)
void crypto_postfork(void)
int crypto_init_siphash_key(void)
#define CRYPTO_OPTIONS_MAGIC
const char * crypto_get_library_version_string(void)
int crypto_early_init(void)
void crypto_thread_cleanup(void)
int crypto_global_init(int useAccel, const char *accelName, const char *accelDir)
static const config_format_t crypto_options_fmt
static int crypto_set_options(void *arg)
static int crypto_early_initialized_
void crypto_prefork(void)
const char * crypto_get_header_version_string(void)
const char * crypto_get_library_name(void)
static int crypto_global_initialized_
int tor_is_using_nss(void)
Headers for crypto_init.c.
Headers for crypto_nss_mgt.c.
void crypto_openssl_early_init(void)
void crypto_openssl_thread_cleanup(void)
int crypto_openssl_late_init(int useAccel, const char *accelName, const char *accelDir)
void crypto_openssl_global_cleanup(void)
Headers for crypto_openssl_mgt.c.
Declare configuration options for the crypto_ops module.
Header for lib/crypt_ops/crypto_options_st.c.
int crypto_seed_rng(void)
void crypto_rand(char *to, size_t n)
Common functions for using (pseudo-)random number generators.
void destroy_thread_fast_rng(void)
void crypto_rand_fast_init(void)
void crypto_rand_fast_shutdown(void)
Declare subsystem object for the crypto module.
Implementation for polyval universal hash function.
void polyval_detect_implementation(void)
Types used to declare a subsystem.
#define SUBSYS_DECLARE_LOCATION()
Macros to manage assertions, fatal and non-fatal.