tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

tor1_crypt_st.h (1255B)


      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-2021, The Tor Project, Inc. */
      5 /* See LICENSE for licensing information */
      6 
      7 /**
      8 * @file tor1_crypt_st.h
      9 * @brief Structures for tor1 relay cell encryption.
     10 **/
     11 
     12 #ifndef TOR1_CRYPT_ST_H
     13 #define TOR1_CRYPT_ST_H
     14 
     15 struct aes_cnt_cipher_t;
     16 struct crypto_digest_t;
     17 
     18 struct tor1_crypt_t {
     19  /** Encryption key and counter for cells heading towards the OR at this
     20   * step. */
     21  struct aes_cnt_cipher_t *f_crypto;
     22  /** Encryption key and counter for cells heading back from the OR at this
     23   * step. */
     24  struct aes_cnt_cipher_t *b_crypto;
     25 
     26  /** Digest state for cells heading towards the OR at this step. */
     27  struct crypto_digest_t *f_digest; /* for integrity checking */
     28  /** Digest state for cells heading away from the OR at this step. */
     29  struct crypto_digest_t *b_digest;
     30 
     31  /** Digest used for the next SENDME cell if any.
     32   *
     33   * This digest is updated every time a cell is _originated_ or _recognized_
     34   * in either direction.  Any operation with this object may
     35   * invalidate this digest. */
     36  uint8_t sendme_digest[DIGEST_LEN];
     37 };
     38 
     39 #endif /* !defined(TOR1_CRYPT_ST_H) */