Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
T
Tor
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,067
    • Issues 1,067
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 17
    • Merge Requests 17
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • The Tor Project
  • Core
  • Tor
  • Issues
  • #23061

Closed
Open
Opened Jul 31, 2017 by teor@teor

crypto_rand_double() should produce all possible outputs on platforms with 32-bit int

On 32-bit platforms, crypto_rand_double() only produces 1 in every 2 million possible values between 0 and 1.

This happens because:

  • crypto_rand_double() divides a random unsigned int by UINT_MAX
  • an unsigned int on 32-bit platforms is 32 bits
  • the mantissa on a double is 53 bits

So crypto_rand_double() doesn't fill the lower 21 bits with random values.

This makes the rep_hist_format_hs_stats() noise more predictable on 32-bit platforms.

This fix shouldn't affect the unit tests, because they pass on 64-bit.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: tpo/core/tor#23061