README.tor 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. We've made the following changes to the stock ed25519-donna from
  2. as of 8757bd4cd209cb032853ece0ce413f122eef212c.
  3. * Tor uses copies of `ed25519-donna.h` and `ed25519.c`, named
  4. `ed25519_donna_tor.h` and `ed25591_tor.c`.
  5. The main functional differences between the standard ed25519-donna
  6. and the Tor specific version are:
  7. * The external interface has been reworked to match that provided
  8. by Tor's copy of the SUPERCOP `ref10` code.
  9. * The secret (aka private) key is now stored/used in expanded form.
  10. * The internal math tests from `test-internals.c` have been wrapped
  11. in a function and the entire file is included to allow for
  12. runtime validation.
  13. * There's an implementation of multiplicative key blinding so we
  14. can use it for next-gen hidden service descriptors.
  15. * There's an implementation of 'convert a curve25519 key to an
  16. ed25519 key' so we can do cross-certification with curve25519
  17. keys.
  18. * `ED25519_FN(ed25519_randombytes_unsafe)` is now static.
  19. * `ed25519-randombytes-custom.h` has the appropriate code to call
  20. Tor's `crypto_rand()` routine, instead of directly using OpenSSL's
  21. CSPRNG.
  22. * OSX pollutes the global namespace with an `ALIGN` macro, which is
  23. undef-ed right before the donna `ALIGN` macro is defined.
  24. * If building with Clang's AddressSanitizer, disable inline assembly
  25. since the compilation will fail in `ge25519_scalarmult_base_choose_niels`
  26. on x86_64 targets due to running out of registers.
  27. * On non-x86 targets, GCC's Stack Protector dislikes variables that have
  28. alignment constraints greater than that of other primitive types.
  29. The `ALIGN` macro is thus no-oped for all non-SSE2 builds.
  30. * On 32 bit x86 targets that the compiler thinks supports SSE2, always
  31. enable SSE2 support by force defining ED25519_SSE2 (x86_64 would also
  32. always support this, but that code path is slower).