diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-01 23:37:48 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-08-10 14:53:27 +0000 |
commit | 463cbcb19a68bc4109285872258d494332bdeaf6 (patch) | |
tree | bca1abb46cc91d3dbe462eed773ed54a0ccba164 /toxcore/mono_time.h | |
parent | afab28f0ff0bd71efcf39bd633770053da99e04a (diff) |
Use the crypto random functions instead of `rand()`.
Presumably the uses of `rand()` were fine because they were not used in
security-sensitive places, but having to think about whether a crappy RNG
is acceptable in each situation requires effort that could better be
spent elsewhere.
Also, this means that once we have a custom deterministic RNG for
testing, that RNG is used everywhere, so all the code is deterministic.
It also allowed us to delete a system-specific function that wasn't used
anywhere except in a call to `srand()`.
Diffstat (limited to 'toxcore/mono_time.h')
-rw-r--r-- | toxcore/mono_time.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/toxcore/mono_time.h b/toxcore/mono_time.h index 63e0f49d..97759560 100644 --- a/toxcore/mono_time.h +++ b/toxcore/mono_time.h | |||
@@ -22,9 +22,6 @@ void unix_time_update(void); | |||
22 | uint64_t unix_time(void); | 22 | uint64_t unix_time(void); |
23 | int is_timeout(uint64_t timestamp, uint64_t timeout); | 23 | int is_timeout(uint64_t timestamp, uint64_t timeout); |
24 | 24 | ||
25 | /* return current UNIX time in microseconds (us). */ | ||
26 | uint64_t current_time_actual(void); | ||
27 | |||
28 | /* return current monotonic time in milliseconds (ms). */ | 25 | /* return current monotonic time in milliseconds (ms). */ |
29 | uint64_t current_time_monotonic(void); | 26 | uint64_t current_time_monotonic(void); |
30 | 27 | ||