2012-12-04 22:09:52 +01:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2017-03-15 21:13:17 +01:00
|
|
|
* Copyright (c) 2007-2017, The Tor Project, Inc. */
|
2012-12-04 22:09:52 +01:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file onion_fast.h
|
|
|
|
* \brief Header file for onion_fast.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_ONION_FAST_H
|
|
|
|
#define TOR_ONION_FAST_H
|
|
|
|
|
2012-12-04 22:51:31 +01:00
|
|
|
#define CREATE_FAST_LEN DIGEST_LEN
|
2013-02-09 06:14:45 +01:00
|
|
|
#define CREATED_FAST_LEN (DIGEST_LEN*2)
|
2012-12-04 22:51:31 +01:00
|
|
|
|
|
|
|
typedef struct fast_handshake_state_t {
|
|
|
|
uint8_t state[DIGEST_LEN];
|
|
|
|
} fast_handshake_state_t;
|
|
|
|
|
|
|
|
void fast_handshake_state_free(fast_handshake_state_t *victim);
|
|
|
|
|
|
|
|
int fast_onionskin_create(fast_handshake_state_t **handshake_state_out,
|
|
|
|
uint8_t *handshake_out);
|
|
|
|
|
|
|
|
int fast_server_handshake(const uint8_t *message_in,
|
2012-12-04 22:09:52 +01:00
|
|
|
uint8_t *handshake_reply_out,
|
|
|
|
uint8_t *key_out,
|
|
|
|
size_t key_out_len);
|
|
|
|
|
2012-12-04 22:51:31 +01:00
|
|
|
int fast_client_handshake(const fast_handshake_state_t *handshake_state,
|
2012-12-04 22:09:52 +01:00
|
|
|
const uint8_t *handshake_reply_out,
|
|
|
|
uint8_t *key_out,
|
2014-10-16 19:26:42 +02:00
|
|
|
size_t key_out_len,
|
|
|
|
const char **msg_out);
|
2012-12-04 22:09:52 +01:00
|
|
|
|
2017-09-15 22:24:44 +02:00
|
|
|
#endif /* !defined(TOR_ONION_FAST_H) */
|
2012-12-04 22:09:52 +01:00
|
|
|
|