[tor-bugs] #24660 [Core Tor/Tor]: Wrap our PRNG interface(s) in Rust with appropriate traits

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed May 2 22:19:21 UTC 2018


#24660: Wrap our PRNG interface(s) in Rust with appropriate traits
-------------------------------------------------+-------------------------
 Reporter:  isis                                 |          Owner:  isis
     Type:  enhancement                          |         Status:
                                                 |  merge_ready
 Priority:  Low                                  |      Milestone:  Tor:
                                                 |  0.3.4.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  rust, tor-crypto, rng, roadmap, 034  |  Actual Points:
  -roadmap-master, 034-triage-20180328,          |
  034-included-20180328                          |
Parent ID:                                       |         Points:  2
 Reviewer:  nickm                                |        Sponsor:
                                                 |  SponsorQ
-------------------------------------------------+-------------------------
Changes (by isis):

 * status:  needs_revision => merge_ready


Comment:

 Replying to [comment:18 nickm]:
 > Lgtm, except that I instead of exposing only crypto_strongest_rand() as
 an Rng, I think we should either expose only crypto_rand(), or expose
 both.  Once that's done I think this is merge_ready.
 >
 > Edited to add: see comment on the pull request for more info.

 Okay, I've exposed both in commit 94dcd38a14 in my bug24660_r1 branch. The
 `TorRng` struct calls `crypto_rand()` and the `TorStrongestRng` struct
 calls `crypto_strongest_rand()`. Also I've changed the pure-Rust RNG used
 when we compile tests to be `rand::ChaChaRng` because that doesn't require
 compiling the rand crate with the `--features="std"` (since that makes it
 pull in a bunch of dependencies).

 Merge ready?

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


More information about the tor-bugs mailing list