13 #ifndef TOR_CRYPTO_DH_H
14 #define TOR_CRYPTO_DH_H
27 #define DH_TYPE_CIRCUIT 1
28 #define DH_TYPE_REND 2
30 void crypto_dh_init(
void);
36 size_t pubkey_out_len);
38 const char *pubkey,
size_t pubkey_len,
39 char *secret_out,
size_t secret_out_len);
41 #define crypto_dh_free(dh) FREE_AND_NULL(crypto_dh_t, crypto_dh_free_, (dh))
44 const char *pubkey,
size_t pubkey_len,
45 unsigned char *secret_out,
46 size_t secret_bytes_out);
48 void crypto_dh_free_all(
void);
57 void crypto_dh_free_all_openssl(
void);
60 void crypto_dh_init_nss(
void);
61 void crypto_dh_free_all_nss(
void);
int crypto_dh_generate_public(crypto_dh_t *dh)
const char OAKLEY_PRIME_2[]
crypto_dh_t * crypto_dh_dup(const crypto_dh_t *dh)
void crypto_dh_free_(crypto_dh_t *dh)
int crypto_dh_get_bytes(crypto_dh_t *dh)
const char TLS_DH_PRIME[]
struct dh_st * crypto_dh_new_openssl_tls(void)
crypto_dh_t * crypto_dh_new(int dh_type)
const unsigned DH_GENERATOR
ssize_t crypto_dh_handshake(int severity, crypto_dh_t *dh, const char *pubkey, size_t pubkey_len, unsigned char *secret_out, size_t secret_bytes_out)
int crypto_dh_get_public(crypto_dh_t *dh, char *pubkey_out, size_t pubkey_out_len)
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)
void crypto_dh_init_openssl(void)
Definitions for sizes of Diffie-Hellman groups elements in Z_p.
Integer definitions used throughout Tor.