[tor-bugs] #23415 [Core Tor/Tor]: sample_laplace_distribution() should take multiple random inputs

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Sep 7 02:09:28 UTC 2017

#23415: sample_laplace_distribution() should take multiple random inputs
 Reporter:  teor                                 |          Owner:  (none)
     Type:  defect                               |         Status:
                                                 |  needs_revision
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.2.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-relay, security-low, privcount,  |  Actual Points:
  031-backport, 030-backport, 029-backport, 028  |
  -backport-maybe, 026-backport-maybe            |
Parent ID:  #23061                               |         Points:  0.5
 Reviewer:                                       |        Sponsor:
Changes (by teor):

 * status:  needs_review => needs_revision


 Replying to [comment:3 catalyst]:
 > Wouldn't it be better to have a function that outputs a random double in
 (-1.0, +1.0)?  If you're only using 53 bits of entropy from a RNG call
 that generates 64, there are spare bits to use for generating the sign.

 sample_laplace_distribution() takes the log of a strictly positive
 floating point number, and then applies a random sign.

 We could use sgn() and abs() to decompose `[-1.0, 1.0]` into `{+, -}` and
 `[0.0, 1.0]`, but we'd still have to reject `0.0` before doing the log,
 and then apply the sign. So it seems more complex than the alternative.

Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23415#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online

More information about the tor-bugs mailing list