aboutsummaryrefslogtreecommitdiffstats
path: root/device/send.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-14 18:30:13 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-07 14:49:44 +0100
commit41cd68416c8f35e80523fb3102b6a9c9982446c4 (patch)
tree643119e80c844893c01453d3f52bf36d50e55b0f /device/send.go
parentdevice: add a helper to generate uapi configs (diff)
downloadwireguard-go-41cd68416c8f35e80523fb3102b6a9c9982446c4.tar.xz
wireguard-go-41cd68416c8f35e80523fb3102b6a9c9982446c4.zip
device: simplify copying counter to nonce
Since we already have it packed into a uint64 in a known byte order, write it back out again the same byte order instead of copying byte by byte. This should also generate more efficient code, because the compiler can do a single uint64 write, instead of eight bounds checks and eight byte writes. Due to a missed optimization, it actually generates a mishmash of smaller writes: 1 byte, 4 bytes, 2 bytes, 1 byte. This is https://golang.org/issue/41663. The code is still better than before, and will get better yet once that compiler bug gets fixed. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Diffstat (limited to 'device/send.go')
0 files changed, 0 insertions, 0 deletions