0

Could you please explain what the pipe (|) in tor specification means -- is it a bitwise or or a concatenation of the values?

  1. Encoding onion addresses [ONIONADDRESS]

    The onion address of a hidden service includes its identity public key, a version field and a basic checksum. All this information is then base32 encoded as shown below:

    onion_address = base32(PUBKEY | CHECKSUM | VERSION) + ".onion"

    CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2]

    where:

    • PUBKEY is the 32 bytes ed25519 master pubkey of the hidden service.
    • VERSION is an one byte version field (default value '\x03')
    • ".onion checksum" is a constant string
    • CHECKSUM is truncated to two bytes before inserting it in onion_address

From the context, I understand it is a concatenation-- is that so?

If one has a working short Python\Node\Ruby snippet for that, it would be lovely. :)

Patriot
  • 3,162
  • 3
  • 20
  • 66
Mr.
  • 143
  • 1
  • 5

1 Answers1

3

As you suspect, it's a concatenation symbol. Some times it's $|$ and others $||$. Or $+$. Python and PL/SQL examples to confirm. Or a cryptographic example: bottom of page 5 of FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions.

If it were bitwise OR, you'd make a real mess of the public key's use with PUBKEY | CHECKSUM | VERSION.

It can get weird though if you dig deeper as: Is there a common symbol for concatenating two (finite) sequences?

Paul Uszak
  • 15,905
  • 2
  • 32
  • 83