relay_crypto_st.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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. #ifndef RELAY_CRYPTO_ST_H
  7. #define RELAY_CRYPTO_ST_H
  8. #define crypto_cipher_t aes_cnt_cipher
  9. struct crypto_cipher_t;
  10. struct crypto_digest_t;
  11. struct relay_crypto_t {
  12. /* crypto environments */
  13. /** Encryption key and counter for cells heading towards the OR at this
  14. * step. */
  15. struct crypto_cipher_t *f_crypto;
  16. /** Encryption key and counter for cells heading back from the OR at this
  17. * step. */
  18. struct crypto_cipher_t *b_crypto;
  19. /** Digest state for cells heading towards the OR at this step. */
  20. struct crypto_digest_t *f_digest; /* for integrity checking */
  21. /** Digest state for cells heading away from the OR at this step. */
  22. struct crypto_digest_t *b_digest;
  23. /** Digest used for the next SENDME cell if any. */
  24. uint8_t sendme_digest[DIGEST_LEN];
  25. };
  26. #undef crypto_cipher_t
  27. #endif