summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-31 19:59:58 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-31 19:59:58 +0200
commit5cd3cbd6fc6762869d6fc4ba15d26bcf861c1427 (patch)
treee312ce081b0b2ec83949f7217d3f0c2eb3045859
parentmain: properly name label (diff)
downloadwireguard-monolithic-historical-5cd3cbd6fc6762869d6fc4ba15d26bcf861c1427.tar.xz
wireguard-monolithic-historical-5cd3cbd6fc6762869d6fc4ba15d26bcf861c1427.zip
noise: use hex constant for tai64n offset
Suggested-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
-rw-r--r--src/noise.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/noise.c b/src/noise.c
index 84bde39..1a28b47 100644
--- a/src/noise.c
+++ b/src/noise.c
@@ -360,7 +360,7 @@ static void tai64n_now(u8 output[NOISE_TIMESTAMP_LEN])
getnstimeofday64(&now);
/* https://cr.yp.to/libtai/tai64.html */
- *(__be64 *)output = cpu_to_be64(4611686018427387914ULL + now.tv_sec);
+ *(__be64 *)output = cpu_to_be64(0x400000000000000aULL + now.tv_sec);
*(__be32 *)(output + sizeof(__be64)) = cpu_to_be32(now.tv_nsec);
}