From ce1d4a8b7e1e5eb714068a8cf44fdc5ae24460d9 Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 19 Jul 2018 13:23:46 +1000 Subject: tor-spec: Fix recognized error, and explain why the field exists Closes 26872. --- tor-spec.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tor-spec.txt') diff --git a/tor-spec.txt b/tor-spec.txt index ea195ad..a685515 100644 --- a/tor-spec.txt +++ b/tor-spec.txt @@ -1443,14 +1443,15 @@ see tor-design.pdf. other nodes in the circuit back to the originator. Commands marked as either can be sent either by the originator or other nodes. - The 'recognized' field is used for a simple indication for if the cell - still encrypted or not. When sending cells, the unencrypted 'recognized' - MUST be set to zero. + The 'recognized' field is used as a simple indication that the cell + is still encrypted. It is an optimization to avoid calculating + expensive digests for every cell. When sending cells, the unencrypted + 'recognized' MUST be set to zero. When receiving and decrypting cells the 'recognized' will always be zero if we're the endpoint that the cell is destined for. For cells that we should relay, the 'recognized' field will usually be nonzero, - but will accidentally be zero with P=2^-32. + but will accidentally be zero with P=2^-16. When handling a relay cell, if the 'recognized' in field in a decrypted relay payload is zero, the 'digest' field is computed as -- cgit v1.2.3-54-g00ecf