25 #define CIPHER_KEY_LEN 16 27 #define CIPHER_IV_LEN 16 29 #define CIPHER256_KEY_LEN 32 31 #define DH_BYTES (1024/8) 35 #define FINGERPRINT_LEN 49 44 const char *accelName,
45 const char *accelPath) ATTR_WUR;
47 int crypto_use_tor_alloc_functions(
void);
62 #define crypto_cipher_free(c) \ 63 FREE_AND_NULL(crypto_cipher_t, crypto_cipher_free_, (c)) 69 const char *from,
size_t fromlen);
71 const char *from,
size_t fromlen);
75 char *to,
size_t tolen,
76 const char *from,
size_t fromlen);
78 char *to,
size_t tolen,
79 const char *from,
size_t fromlen);
82 #define DH_TYPE_CIRCUIT 1 83 #define DH_TYPE_REND 2 90 size_t pubkey_out_len);
92 const char *pubkey,
size_t pubkey_len,
93 char *secret_out,
size_t secret_out_len);
95 #define crypto_dh_free(dh) FREE_AND_NULL(crypto_dh_t, crypto_dh_free_, (dh)) 99 uint8_t *key_out,
size_t key_out_len);
101 const uint8_t *key_in,
size_t key_in_len,
102 const uint8_t *salt_in,
size_t salt_in_len,
103 const uint8_t *info_in,
size_t info_in_len,
104 uint8_t *key_out,
size_t key_out_len);
crypto_cipher_t * crypto_cipher_new_with_iv_and_bits(const uint8_t *key, const uint8_t *iv, int bits)
Definition: crypto.c:321
struct dh_st * crypto_dh_get_dh_(crypto_dh_t *dh)
Definition: crypto.c:312
int crypto_cipher_decrypt_with_iv(const char *key, char *to, size_t tolen, const char *from, size_t fromlen)
Definition: crypto.c:482
int crypto_expand_key_material_TAP(const uint8_t *key_in, size_t key_in_len, uint8_t *key_out, size_t key_out_len)
Definition: crypto.c:960
Headers for crypto_rsa.c.
Header file to define uint32_t and friends.
int crypto_dh_get_public(crypto_dh_t *dh, char *pubkey_out, size_t pubkey_out_len)
Definition: crypto.c:811
int crypto_cipher_encrypt_with_iv(const char *key, char *to, size_t tolen, const char *from, size_t fromlen)
Definition: crypto.c:450
crypto_cipher_t * crypto_cipher_new_with_iv(const char *key, const char *iv)
Definition: crypto.c:336
void crypto_add_spaces_to_fp(char *out, size_t outlen, const char *in)
Definition: crypto.c:376
int crypto_init_siphash_key(void)
Definition: crypto.c:151
int crypto_global_init(int hardwareAccel, const char *accelName, const char *accelPath) ATTR_WUR
Definition: crypto.c:214
int crypto_expand_key_material_rfc5869_sha256(const uint8_t *key_in, size_t key_in_len, const uint8_t *salt_in, size_t salt_in_len, const uint8_t *info_in, size_t info_in_len, uint8_t *key_out, size_t key_out_len)
Definition: crypto.c:995
DH * dh
Definition: crypto.c:78
void crypto_cipher_free_(crypto_cipher_t *env)
Definition: crypto.c:365
void crypto_thread_cleanup(void)
Definition: crypto.c:302
ssize_t crypto_dh_compute_secret(int severity, crypto_dh_t *dh, const char *pubkey, size_t pubkey_len, char *secret_out, size_t secret_out_len)
Definition: crypto.c:899
int crypto_dh_generate_public(crypto_dh_t *dh)
Definition: crypto.c:765
int crypto_global_cleanup(void)
Definition: crypto.c:1063
int crypto_dh_get_bytes(crypto_dh_t *dh)
Definition: crypto.c:755
void crypto_set_tls_dh_prime(void)
Definition: crypto.c:594
int crypto_cipher_encrypt(crypto_cipher_t *env, char *to, const char *from, size_t fromlen)
Definition: crypto.c:400
int crypto_cipher_decrypt(crypto_cipher_t *env, char *to, const char *from, size_t fromlen)
Definition: crypto.c:420
crypto_dh_t * crypto_dh_dup(const crypto_dh_t *dh)
Definition: crypto.c:742
int crypto_early_init(void) ATTR_WUR
Definition: crypto.c:166
crypto_cipher_t * crypto_cipher_new_with_bits(const char *key, int bits)
Definition: crypto.c:346
void crypto_dh_free_(crypto_dh_t *dh)
Definition: crypto.c:1049
crypto_cipher_t * crypto_cipher_new(const char *key)
Definition: crypto.c:357
void crypto_cipher_crypt_inplace(crypto_cipher_t *env, char *d, size_t len)
Definition: crypto.c:437
crypto_dh_t * crypto_dh_new(int dh_type)
Definition: crypto.c:677