Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2
[tor/rransom.git] / src / or / onion.h
blob7f603b8147af777c07de8bf9c0d5b9dda481b68e
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-2011, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 /**
8 * \file onion.h
9 * \brief Header file for onion.c.
10 **/
12 #ifndef _TOR_ONION_H
13 #define _TOR_ONION_H
15 int onion_pending_add(or_circuit_t *circ, char *onionskin);
16 or_circuit_t *onion_next_task(char **onionskin_out);
17 void onion_pending_remove(or_circuit_t *circ);
19 int onion_skin_create(crypto_pk_env_t *router_key,
20 crypto_dh_env_t **handshake_state_out,
21 char *onion_skin_out);
23 int onion_skin_server_handshake(const char *onion_skin,
24 crypto_pk_env_t *private_key,
25 crypto_pk_env_t *prev_private_key,
26 char *handshake_reply_out,
27 char *key_out,
28 size_t key_out_len);
30 int onion_skin_client_handshake(crypto_dh_env_t *handshake_state,
31 const char *handshake_reply,
32 char *key_out,
33 size_t key_out_len);
35 int fast_server_handshake(const uint8_t *key_in,
36 uint8_t *handshake_reply_out,
37 uint8_t *key_out,
38 size_t key_out_len);
40 int fast_client_handshake(const uint8_t *handshake_state,
41 const uint8_t *handshake_reply_out,
42 uint8_t *key_out,
43 size_t key_out_len);
45 void clear_pending_onions(void);
47 #endif