Opened 3 years ago

Closed 3 years ago

#24613 closed enhancement (fixed)

Avoid monotime_coarse_absolute_msec in channelpadding code

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords:
Cc: mikeperry, ahf Actual Points:
Parent ID: Points:
Reviewer: Sponsor: Sponsor8-can


As noted on #24374, monotime_coarse_absolute_msec() can be expensive on 32-bit systems since it has to do a 64-bit division to compute msec. We fixed the use of monotime_coarse_absolute_msec in buf_t and packed_cell_t, but we still have it in the channelpadding system.

Child Tickets

Change History (5)

comment:1 Changed 3 years ago by nickm

Status: assignedneeds_review

My branch xfer_time_coarse makes a start here.
Also reviewable at

comment:2 Changed 3 years ago by nickm

Cc: mikeperry ahf added

comment:3 Changed 3 years ago by mikeperry

The netflow bits look good to me. The various platform-specific monotime diffs I am less confident about, but the unit tests look mostly convincing there. One potential improvemnt to the tests: add 1337 three times, so that we can also be sure that we properly overflow the internal sub-second values into a whole second on platforms that differentiate seconds and sub-seconds internally?

comment:4 Changed 3 years ago by mikeperry

Status: needs_reviewneeds_revision

comment:5 Changed 3 years ago by nickm

Resolution: fixed
Status: needs_revisionclosed

ok, i've made the relevant change to the tests 60bf8f6cf6295808eec542be31649b0bd82ad926; and I'm merging this to master. Thanks!

Note: See TracTickets for help on using tickets.