]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Rename a couple of relay crypto functions to "tor1".
authorNick Mathewson <nickm@torproject.org>
Wed, 28 May 2025 12:17:37 +0000 (08:17 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 10 Jun 2025 23:06:47 +0000 (19:06 -0400)
(I've designated the existing encryption algorithm "tor1".

src/core/crypto/relay_crypto.c
src/core/crypto/relay_crypto.h
src/core/or/crypt_path.c

index b33d33215f9c36ed2eaf8617bddcfef477a674de..00d8feb360b842d96e3b0e1ef10d7e54e6861f43 100644 (file)
@@ -37,7 +37,7 @@
  * cell.
  */
 void
-relay_set_digest_v0(crypto_digest_t *digest, cell_t *cell)
+tor1_set_digest_v0(crypto_digest_t *digest, cell_t *cell)
 {
   char integrity[V0_DIGEST_LEN];
 
@@ -55,7 +55,7 @@ relay_set_digest_v0(crypto_digest_t *digest, cell_t *cell)
  * and cell to their original state and return 0.
  */
 static int
-relay_digest_matches_v0(crypto_digest_t *digest, cell_t *cell)
+tor1_relay_digest_matches_v0(crypto_digest_t *digest, cell_t *cell)
 {
   uint32_t received_integrity, calculated_integrity;
   crypto_digest_checkpoint_t backup_digest;
@@ -104,7 +104,7 @@ relay_cell_is_recognized_v0(const cell_t *cell)
  * Note that we use the same operation for encrypting and for decrypting.
  */
 void
-relay_crypt_one_payload(crypto_cipher_t *cipher, uint8_t *in)
+tor1_crypt_one_payload(crypto_cipher_t *cipher, uint8_t *in)
 {
   crypto_cipher_crypt_inplace(cipher, (char*) in, CELL_PAYLOAD_SIZE);
 }
@@ -182,7 +182,7 @@ relay_decrypt_cell(circuit_t *circ, cell_t *cell,
 
         if (relay_cell_is_recognized_v0(cell)) {
           /* it's possibly recognized. have to check digest to be sure. */
-          if (relay_digest_matches_v0(cpath_get_incoming_digest(thishop),
+          if (tor1_relay_digest_matches_v0(cpath_get_incoming_digest(thishop),
                                       cell)) {
             *recognized = 1;
             *layer_hint = thishop;
@@ -198,17 +198,17 @@ relay_decrypt_cell(circuit_t *circ, cell_t *cell,
     } else {
       relay_crypto_t *crypto = &TO_OR_CIRCUIT(circ)->crypto;
       /* We're in the middle. Encrypt one layer. */
-      relay_crypt_one_payload(crypto->b_crypto, cell->payload);
+      tor1_crypt_one_payload(crypto->b_crypto, cell->payload);
     }
   } else /* cell_direction == CELL_DIRECTION_OUT */ {
     /* We're in the middle. Decrypt one layer. */
     relay_crypto_t *crypto = &TO_OR_CIRCUIT(circ)->crypto;
 
-    relay_crypt_one_payload(crypto->f_crypto, cell->payload);
+    tor1_crypt_one_payload(crypto->f_crypto, cell->payload);
 
     if (relay_cell_is_recognized_v0(cell)) {
       /* it's possibly recognized. have to check digest to be sure. */
-      if (relay_digest_matches_v0(crypto->f_digest, cell)) {
+      if (tor1_relay_digest_matches_v0(crypto->f_digest, cell)) {
         *recognized = 1;
         return 0;
       }
@@ -257,13 +257,13 @@ void
 relay_encrypt_cell_inbound(cell_t *cell,
                            or_circuit_t *or_circ)
 {
-  relay_set_digest_v0(or_circ->crypto.b_digest, cell);
+  tor1_set_digest_v0(or_circ->crypto.b_digest, cell);
 
   /* Record cell digest as the SENDME digest if need be. */
   sendme_record_sending_cell_digest(TO_CIRCUIT(or_circ), NULL);
 
   /* encrypt one layer */
-  relay_crypt_one_payload(or_circ->crypto.b_crypto, cell->payload);
+  tor1_crypt_one_payload(or_circ->crypto.b_crypto, cell->payload);
 }
 
 /**
index c6eaf28f45e9c3251fe6017141e30954cd408cb7..a735b696ecec84c6cfce44ec619e050b962b6a37 100644 (file)
@@ -33,9 +33,9 @@ void relay_crypto_record_sendme_digest(relay_crypto_t *crypto,
                                        bool is_foward_digest);
 
 void
-relay_crypt_one_payload(crypto_cipher_t *cipher, uint8_t *in);
+tor1_crypt_one_payload(crypto_cipher_t *cipher, uint8_t *in);
 
 void
-relay_set_digest_v0(crypto_digest_t *digest, cell_t *cell);
+tor1_set_digest_v0(crypto_digest_t *digest, cell_t *cell);
 
 #endif /* !defined(TOR_RELAY_CRYPTO_H) */
index 76711a54452a1fd82d48887a2f6e14c97da34f3d..9214bbc26fe4859cd03df7319be858ab0413cbf3 100644 (file)
@@ -183,9 +183,9 @@ void
 cpath_crypt_cell(const crypt_path_t *cpath, uint8_t *payload, bool is_decrypt)
 {
   if (is_decrypt) {
-    relay_crypt_one_payload(cpath->pvt_crypto.b_crypto, payload);
+    tor1_crypt_one_payload(cpath->pvt_crypto.b_crypto, payload);
   } else {
-    relay_crypt_one_payload(cpath->pvt_crypto.f_crypto, payload);
+    tor1_crypt_one_payload(cpath->pvt_crypto.f_crypto, payload);
   }
 }
 
@@ -201,7 +201,7 @@ cpath_get_incoming_digest(const crypt_path_t *cpath)
 void
 cpath_set_cell_forward_digest(crypt_path_t *cpath, cell_t *cell)
 {
-  relay_set_digest_v0(cpath->pvt_crypto.f_digest, cell);
+  tor1_set_digest_v0(cpath->pvt_crypto.f_digest, cell);
 }
 
 /************ cpath sendme API ***************************/