summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2018-10-02simd: refactor simd availability handlingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02simd: return a bool from simd_relaxJason A. Donenfeld
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02global: prefix all functions with wg_Jason A. Donenfeld
I understand why this must be done, though I'm not so happy about having to do it. In some places, it puts us over 80 chars and we have to break lines up in further ugly ways. And in general, I think this makes things harder to read. Yet another thing we must do to please upstream. Maybe this can be replaced in the future by some kind of automatic module namespacing logic in the linker, or even combined with LTO and aggressive symbol stripping. Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02poly1305-mips64: use compiler-defined macros in assemblyJason A. Donenfeld
Andy and I agreed it's more correct to use the compiler-defined macros in assembly code, and not the project specific macros. Suggested-by: Andy Polyakov <appro@openssl.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02blake2s: rename arch function and use slicker le32 helperJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02blake2s: feed fpu functions PAGE_SIZE at a timeJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02poly1305: feed fpu functions PAGE_SIZE at a timeJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02chacha20: feed fpu functions PAGE_SIZE at a timeJason A. Donenfeld
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02chacha20: test multiple page span in selftestJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02chacha20: break out of zero loops in selftestJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02crypto: prefer IS_ENABLED to ifdefsJason A. Donenfeld
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02crypto: ignore ARMv3Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02compat: kernels < 3.17 don't have read_cpuid_partNathan Chancellor
Use read_cpuid_part_number, which was the same thing before upstream commit af040ffc9ba1 ("ARM: make it easier to check the CPU part number correctly"). Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-02qemu: support more arm big endian platformsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25crypto: rename DEBUG to SELFTESTJason A. Donenfeld
Also we make selftest errors of type err, so that they're obvious in dmesg. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25poly1305-arm: swap endianness in base 2^26 conversionJason A. Donenfeld
These are actually 32-bit limbs, so we have to swap them back after the 64-bit arithmetic. Also, change type of boolean for 64-bit. Suggested-by: Andy Polyakov <appro@openssl.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25curve25519-arm: disable on big-endianJason A. Donenfeld
The qhasm was only written for little-endian systems, and we don't want disaster to ensue. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25chacha20-arm,poly1305-arm: fix big-endian aarch64Jason A. Donenfeld
Suggested-by: Andy Polyakov <appro@openssl.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25curve25519: show all failures in test caseJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25version: bump snapshotJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25curve25519-hacl64: reduce stack usage under KASANJason A. Donenfeld
Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25chacha20: add bounds checking to selftestsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25chacha20-mips32r2: reduce stack and branches in loop, refactor jumptable ↵René van Dorst
handling Signed-off-by: René van Dorst <opensource@vdorst.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25qemu: bump muslJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25crypto: make constant naming scheme consistentJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25hchacha20: keep in native endian in wordsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-24chacha20-arm: remove unused preamblesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23chacha20-arm: updated scalar code from AndyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23poly1305-mips64: remove useless preprocessor errorJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23crypto-arm: rework KERNEL_MODE_NEON handling againJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23crypto: flatten out makefileJason A. Donenfeld
This brings us more in line with the integration tree's style. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23curve25519-fiat32: work around m68k compiler stack frame bugJason A. Donenfeld
The m68k compiler generates a 1032 byte stack frame. Moving these variables inside the loop fixes that. It also means we're not explicitly memzeroing it any more either, but hopefully that memory is reused anyway by the multiplications. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23allowedips: work around kasan stack frame bug in selftestJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23chacha20-arm: use new scalar implementationJason A. Donenfeld
It turns out this is faster than NEON on some chips, so it's nice to have. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23crypto-arm: rework KERNEL_MODE_NEON handlingJason A. Donenfeld
It might be defined even if the compiler doesn't support it. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23global: reduce stack frame sizeJason A. Donenfeld
This brings it under 1280 on 64-bit and under 1024 on 32-bit systems. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-23chacha20: add chunked selftest and test sliding alignments and hchacha20Jason A. Donenfeld
This ensures we're properly updating state[12] and that we're handling all unaligned acceses (in the jump tables for MIPS). Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-22chacha20-mips32r2: reduce jumptable entry size and stack usageRené van Dorst
Signed-off-by: René van Dorst <opensource@vdorst.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-21chacha20-mips32r2: use simpler calling conventionJason A. Donenfeld
Since we now set up the block in the generic code, we can rely on that to use fewer variables and reduce stack pressure within the MIPS code. This in turn means we have more registers and more uniformity, so we're able to rewrite quite a bit. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-21chacha20-arm: go with Ard's version to optimize for Cortex-A7Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-21chacha20-mips32r2: remove reorder directivesRené van Dorst
This requires some minimal rearranging to make work, but for the most part as does the right thing, provided we pass it an optimization flag. Suggested-by: Paul Burton <paul.burton@mips.com> Signed-off-by: René van Dorst <opensource@vdorst.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-21chacha20-mips32r2: fix typo to allow reorder againRené van Dorst
Reported-by: Paul Burton <paul.burton@mips.com> Signed-off-by: René van Dorst <opensource@vdorst.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-21poly1305-mips32r2: remove all reorder directivesRené van Dorst
This requires some minimal rearranging to make work, but for the most part as does the right thing, provided we pass it an optimization flag. Suggested-by: Paul Burton <paul.burton@mips.com> Signed-off-by: René van Dorst <opensource@vdorst.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-20global: put SPDX identifier on its own lineJason A. Donenfeld
The kernel has very specific rules correlating file type with comment type, and also SPDX identifiers can't be merged with other comments. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-20ratelimiter: disable selftest with KASANJason A. Donenfeld
This this relies on instructions taking a "normal" amount of time, we really can't run this with KASAN, especially inside QEMU, so just disable it for KASAN, since it's hard to make it complete on slow systems. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-20crypto: do not waste space on selftest itemsJason A. Donenfeld
This unfortunately means we have to define symbols, since we want them in __initconst, but it's better than the other two options (no initconst or wasting space for fixed size buffers). Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-20netlink: reverse my christmas treesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-20crypto: explicitly dual licenseJason A. Donenfeld
Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-20poly1305: account for simd being toggled off midwayJason A. Donenfeld
This is a very rare occurance, but we should account for it, so that the calculations aren't wrong. Here we convert from base 2^26 back to base 2^64. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-20allowedips: change from BUG_ON to WARN_ONJason A. Donenfeld
This is never going to hit anyway, and if it does, it's a development problem that will be caught with the selftests anyway. So don't make Andrew Lunn upset, and just change it to a WARN_ON. Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>