tor  0.4.2.1-alpha-dev
onion_fast.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_FAST_H
13 #define TOR_ONION_FAST_H
14 
15 #define CREATE_FAST_LEN DIGEST_LEN
16 #define CREATED_FAST_LEN (DIGEST_LEN*2)
17 
18 typedef struct fast_handshake_state_t {
19  uint8_t state[DIGEST_LEN];
21 
23 #define fast_handshake_state_free(st) \
24  FREE_AND_NULL(fast_handshake_state_t, fast_handshake_state_free_, (st))
25 
26 int fast_onionskin_create(fast_handshake_state_t **handshake_state_out,
27  uint8_t *handshake_out);
28 
29 int fast_server_handshake(const uint8_t *message_in,
30  uint8_t *handshake_reply_out,
31  uint8_t *key_out,
32  size_t key_out_len);
33 
34 int fast_client_handshake(const fast_handshake_state_t *handshake_state,
35  const uint8_t *handshake_reply_out,
36  uint8_t *key_out,
37  size_t key_out_len,
38  const char **msg_out);
39 
40 #endif /* !defined(TOR_ONION_FAST_H) */
41 
int fast_client_handshake(const fast_handshake_state_t *handshake_state, const uint8_t *handshake_reply_out, uint8_t *key_out, size_t key_out_len, const char **msg_out)
Definition: onion_fast.c:109
int fast_onionskin_create(fast_handshake_state_t **handshake_state_out, uint8_t *handshake_out)
Definition: onion_fast.c:49
#define DIGEST_LEN
Definition: digest_sizes.h:20
void fast_handshake_state_free_(fast_handshake_state_t *victim)
Definition: onion_fast.c:38
int fast_server_handshake(const uint8_t *message_in, uint8_t *handshake_reply_out, uint8_t *key_out, size_t key_out_len)
Definition: onion_fast.c:67