tor  0.4.2.0-alpha-dev
onion_tap.h
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
12 #ifndef TOR_ONION_TAP_H
13 #define TOR_ONION_TAP_H
14 
15 #define TAP_ONIONSKIN_CHALLENGE_LEN (PKCS1_OAEP_PADDING_OVERHEAD+\
16  CIPHER_KEY_LEN+\
17  DH1024_KEY_LEN)
18 #define TAP_ONIONSKIN_REPLY_LEN (DH1024_KEY_LEN+DIGEST_LEN)
19 
20 struct crypto_dh_t;
21 struct crypto_pk_t;
22 
23 int onion_skin_TAP_create(struct crypto_pk_t *router_key,
24  struct crypto_dh_t **handshake_state_out,
25  char *onion_skin_out);
26 
27 int onion_skin_TAP_server_handshake(const char *onion_skin,
28  struct crypto_pk_t *private_key,
29  struct crypto_pk_t *prev_private_key,
30  char *handshake_reply_out,
31  char *key_out,
32  size_t key_out_len);
33 
34 int onion_skin_TAP_client_handshake(struct crypto_dh_t *handshake_state,
35  const char *handshake_reply,
36  char *key_out,
37  size_t key_out_len,
38  const char **msg_out);
39 
40 #endif /* !defined(TOR_ONION_TAP_H) */
int onion_skin_TAP_server_handshake(const char *onion_skin, struct crypto_pk_t *private_key, struct crypto_pk_t *prev_private_key, char *handshake_reply_out, char *key_out, size_t key_out_len)
Definition: onion_tap.c:105
int onion_skin_TAP_client_handshake(struct crypto_dh_t *handshake_state, const char *handshake_reply, char *key_out, size_t key_out_len, const char **msg_out)
Definition: onion_tap.c:207
int onion_skin_TAP_create(struct crypto_pk_t *router_key, struct crypto_dh_t **handshake_state_out, char *onion_skin_out)
Definition: onion_tap.c:53