summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-07-02 03:22:34 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-07-02 03:22:34 +0200
commit79d5e05cc8116c6fb90da33db0b3b86ebe2e1f22 (patch)
tree83a71b86f32992a5de0ba97e1519c8178eba3b0e /src
parentd172fddcd5da9014ced3b6d73009a5da2d247cc5 (diff)
tai64n: don't forget to add 2^62, to be in spec
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/noise.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/noise.c b/src/noise.c
index 3762e2d..fd8e7d8 100644
--- a/src/noise.c
+++ b/src/noise.c
@@ -295,8 +295,8 @@ static void tai64n_now(u8 output[NOISE_TIMESTAMP_LEN])
{
struct timeval now;
do_gettimeofday(&now);
- /* http://cr.yp.to/libtai/tai64.html */
- *(__be64 *)output = cpu_to_be64(now.tv_sec);
+ /* https://cr.yp.to/libtai/tai64.html */
+ *(__be64 *)output = cpu_to_be64(4611686018427387914ULL + now.tv_sec);
*(__be32 *)(output + sizeof(__be64)) = cpu_to_be32(1000 * now.tv_usec + 500);
}