[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #23415 [Core Tor/Tor]: sample_laplace_distribution() should take multiple random inputs
#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:
| 0.2.8.1-alpha
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:
-------------------------------------------------+-------------------------
Comment (by yawning):
Produces random values in the range `(-1.0, 1.0)`, with similar semantics
to my other routine. Timing characteristics depend on how `copysign()` is
implemented, though I expect most libms to use bit twiddling of some sort.
{{{
double
uint64_to_dbl_neg1_1(uint64_t x) {
#if DBL_MANT_DIG > 63
#error System double mantissa is unexpectedly large.
#endif
return copysign(uint64_to_dbl_0_1(x), 0.0 - (x >> 63));
}
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23415#comment:7>
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