[tor-bugs] #28878 [Core Tor/Tor]: WTF-PAD: Improve deterministic randomness in tests

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Mar 8 09:26:45 UTC 2019


#28878: WTF-PAD: Improve deterministic randomness in tests
-------------------------------------------------+-------------------------
 Reporter:  asn                                  |          Owner:  (none)
     Type:  defect                               |         Status:  new
 Priority:  Low                                  |      Milestone:  Tor:
                                                 |  unspecified
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  wtf-pad, tor-relay, tor-cell,        |  Actual Points:
  padding, tor-tests                             |
Parent ID:  #28631                               |         Points:  2
 Reviewer:                                       |        Sponsor:
                                                 |  Sponsor2
-------------------------------------------------+-------------------------

Old description:

> As part of test_prob_distr.c in #28142, we implemented a deterministic
> randomness system for the stochastic tests. There are various things we
> can improve there:
>
> a) Make it into its own subsystem so that other tests can also use it.
> b) Don't use a uint32_t counter as the seed, because the byte order is
> machine dependent. Instead make it a uint8_t[32] or something.
> c) Allow users to overwrite the seed using environment variables or the
> CLI. For now users have to tweak the `init_deterministic_rand()` func.

New description:

 As part of test_prob_distr.c in #28142, we implemented a deterministic
 randomness system for the stochastic tests. There are various things we
 can improve there:

 a) Make it into its own subsystem so that other tests can also use it.
 b) Don't use a uint32_t counter as the seed, because the byte order is
 machine dependent. Instead make it a `uint8_t[4]` or something.
 c) Allow users to overwrite the seed using environment variables or the
 CLI. For now users have to tweak the `init_deterministic_rand()` func.

--

Comment (by teor):

 Fix calculation

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


More information about the tor-bugs mailing list