I am coding my own version of TOR and I am trying to set up circuit management. I looked at the TOR spec and it says:
To prevent CircID collisions, when one node sends a CREATE/CREATE2 cell to another, it chooses from only one half of the possible values based on the ORs' public identity keys.
I would like to implement this approach in my code as well, but I don't understand how can the node figure out what values are possible, and determine the CircID, using the OR's identity keys?
I interpret from this that there is a way to pass information using identity keys, but I couldn't find any relevant explanation, and checking the TOR-design.html also didn't help.