[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #9663 [Tor]: Table-based basepoint multiply optimizations for ntor handshake



#9663: Table-based basepoint multiply optimizations for ntor handshake
-------------------------+-------------------------------------------------
     Reporter:  nickm    |      Owner:
         Type:           |     Status:  needs_revision
  enhancement            |  Milestone:  Tor: 0.2.7.x-final
     Priority:  normal   |    Version:
    Component:  Tor      |   Keywords:  tor-relay, performance, ntor,
   Resolution:           |  026-triaged-0, 027-triaged-1-in
Actual Points:           |  Parent ID:  #9662
       Points:           |
-------------------------+-------------------------------------------------

Comment (by yawning):

 I said I'll look at this, and I've been casually poking at it.  I don't
 have a branch quite ready for merge yet since I need to make things fall
 back to curve25519-donna and ref10.

 Numbers (NB: i5-4250U, Turboboost etc):

  * onion_ntor: Client-side, part 1: 77.590756 usec. -> Client-side, part
 1: 24.009142 usec.
  * ed25519:
    * Generate public key: 60.96 usec -> Generate public key: 22.22 usec
    * Sign a short message: 62.16 usec -> Sign a short message: 23.84 usec
    * Verify signature: 161.53 usec -> Verify signature: 77.68 usec
    * Blind a public key: 139.10 usec -> Blind a public key: 70.78 usec

 I didn't set `-DED25519_SSE2`, so this is the portable 64 bit code.  For
 reference he current ntor code takes ~240 usec in it's entirety, so this
 is still worth doing especially since it gains us a good Ed25519 perf.
 boost and support for batch verification.

 TODO:
  * Cross verification with the slower implementation at startup time, and
 the corresponding fallback code (Benchmark numbers obtained with something
 that only calls the new code, tests pass...).
  * Wire in the Ed25519-donna batch verification code (nickm wrote
 something that claims to do this, but he integrated Ed25519-donna slightly
 differently from how I did, so it needs minor adjustments).  I'll probably
 leave this up to him if/when my WIP branch gets merged.
  * Curve25519->Ed25519 conversion (Not worth doing unless we anticipate
 removing `ref10` entirely).
  * Unbreak the Visual Studio build (I'm not touching this crap, someone
 who cares about windows can).
  * The inevitable "teor files a bunch of bugs because of clang != gcc"
 fixes.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9663#comment:14>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs