summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2018-01-18curve25519: import 64-bit hacl-star implementationJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-18curve25519: import 32-bit fiat-crypto implementationJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-18curve25519: modularize implementationJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-18poly1305: remove indirect callsSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08socket: check for null socket before fishing out sportJason A. Donenfeld
Otherwise we could have a null pointer dereference. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-03global: year bumpJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-03receive: treat packet checking as irrelevant for timersJason A. Donenfeld
Receiving any type of authenticated data is a receive and a traversal. When it isn't a keepalive it's a data. That's our rule. Whether or not it's the correct type of data or has the right IP header shouldn't influence timer decisions. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-21version: bump snapshotJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-21compat: kernels < 3.13 modified genl_opsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-13crypto: compile on UMLJason A. Donenfeld
We basically just don't use FPU in UML. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-11version: bump snapshotJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-11chacha20poly1305: wire up avx512vl for skylake-xJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-11chacha20: avx512vl implementationSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-11poly1305: fix avx512f alignment bugSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-11chacha20poly1305: cleaner generic codeJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-09blake2s-x86_64: fix spacingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-09global: add SPDX tags to all filesGreg Kroah-Hartman
It's good to have SPDX identifiers in all files as the Linux kernel developers are working to add these identifiers to all files. Update all files with the correct SPDX license identifier based on the license text of the project or based on the license in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Modified-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-03chacha20-arm: fix with clang -fno-integrated-as.David Benjamin
The __clang__-guarded #defines cause gas to complain if clang is passed -fno-integrated-as. Emitting .syntax unified when those are used fixes this. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-03poly1305: update x86-64 kernel to AVX512F onlySamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-29netlink: rename symbol to avoid clashesJason A. Donenfeld
At somepoint we may need to wg_ namespace these. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-29device: clear last handshake timer on ifdownJason A. Donenfeld
Otherwise new handshakes might not occur immediately when the interface goes up and down. Also initialize peers to having a proper zeroed handshake jiffies. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-29compat: fix 3.10 backportJason A. Donenfeld
For archs that do not provide the magic csum function, we need to provide the generic function. Also, some obscure 3.10s have backported the int size macros, so we ifndef around that to avoid potentially fatal warnings. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28device: do not clear keys during sleep on AndroidJason A. Donenfeld
This makes sense for the security model of laptops, but not for clicking phones on and off, where we actually want to be able to handle incoming packets. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28curve25519: explictly depend on AS_AVXJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28compat: support RAP in assemblyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28curve25519: modularize dispatchJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27version: bump snapshotJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27qemu: take shared lock for untarringJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-26blake2s: tweak avx512 codeSamuel Neves
This is not as ideal as using zmm, but zmm downclocks. And it's not as fast single-threaded as using the gathers. But it is faster when multithreaded, which is what WireGuard is doing. Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-26compat: support 4.15's netlink and barrier changesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-25allowedips: simplifyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-25allowedips: optimizeJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-25qemu: use netfilter.org https siteJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-23chacha20: directly assign constant and initial stateJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-23compat: fix typo and rangesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-23tools: fix removing preshared keysJason A. Donenfeld
Also clean up related logic quite a bit and add unit tests. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22compat: support AVX512BW+VL by lyingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22blake2s: hmac space optimizationSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22blake2s: AVX512F+VL implementationSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22poly1305-avx512: requires AVX512F+VL+BWSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22compat: support timespec64 on old kernelsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22version: bump snapshotJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22chacha20poly1305: poly cleans up its own stateJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22poly1305-x86_64: unclobber %rbpSamuel Neves
OpenSSL's Poly1305 kernels use %rbp as a scratch register. However, the kernel expects rbp to be a valid frame pointer at any given time in order to do proper unwinding. Thus we need to alter the code in order to preserve it. The most straightforward manner in which this was accomplished was by replacing $d3 in poly1305-x86_64.pl -- formerly %r10 -- by %rdi, and replace %rbp by %r10. Because %rdi, a pointer to the context structure, does not change and is not used by poly1305_iteration, it is safe to use it here, and the overhead of saving and restoring it should be minimal. Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22global: switch from timeval to timespecJason A. Donenfeld
This gets us nanoseconds instead of microseconds, which is better, and we can do this pretty much without freaking out existing userspace, which doesn't actually make use of the nano/micro seconds field: zx2c4@thinkpad ~ $ cat a.c void main() { puts(sizeof(struct timeval) == sizeof(struct timespec) ? "success" : "failure"); } zx2c4@thinkpad ~ $ gcc a.c -m64 && ./a.out success zx2c4@thinkpad ~ $ gcc a.c -m32 && ./a.out success This doesn't solve y2038 problem, but timespec64 isn't yet a thing in userspace. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22poly1305: import MIPS64 primitive from OpenSSLJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22chacha20poly1305: import ARM primitives from OpenSSLJason A. Donenfeld
ARMv4-ARMv8, with NEON for ARMv7 and ARMv8. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22chacha20poly1305: import x86_64 primitives from OpenSSLSamuel Neves
x86_64 only at the moment. SSSE3, AVX, AVX2, AVX512. Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22chacha20poly1305: add more test vectors, some of which are weirdJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22compat: new kernels have netlink fixesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>