onion_tap.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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-2017, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file onion_tap.h
  8. * \brief Header file for onion_tap.c.
  9. **/
  10. #ifndef TOR_ONION_TAP_H
  11. #define TOR_ONION_TAP_H
  12. #define TAP_ONIONSKIN_CHALLENGE_LEN (PKCS1_OAEP_PADDING_OVERHEAD+\
  13. CIPHER_KEY_LEN+\
  14. DH_KEY_LEN)
  15. #define TAP_ONIONSKIN_REPLY_LEN (DH_KEY_LEN+DIGEST_LEN)
  16. int onion_skin_TAP_create(crypto_pk_t *router_key,
  17. crypto_dh_t **handshake_state_out,
  18. char *onion_skin_out);
  19. int onion_skin_TAP_server_handshake(const char *onion_skin,
  20. crypto_pk_t *private_key,
  21. crypto_pk_t *prev_private_key,
  22. char *handshake_reply_out,
  23. char *key_out,
  24. size_t key_out_len);
  25. int onion_skin_TAP_client_handshake(crypto_dh_t *handshake_state,
  26. const char *handshake_reply,
  27. char *key_out,
  28. size_t key_out_len,
  29. const char **msg_out);
  30. #endif