linux/include
Jason A. Donenfeld 1ff35ded67 UPSTREAM: crypto: poly1305 - add new 32 and 64-bit generic versions
These two C implementations from Zinc -- a 32x32 one and a 64x64 one,
depending on the platform -- come from Andrew Moon's public domain
poly1305-donna portable code, modified for usage in the kernel. The
precomputation in the 32-bit version and the use of 64x64 multiplies in
the 64-bit version make these perform better than the code it replaces.
Moon's code is also very widespread and has received many eyeballs of
scrutiny.

There's a bit of interference between the x86 implementation, which
relies on internal details of the old scalar implementation. In the next
commit, the x86 implementation will be replaced with a faster one that
doesn't rely on this, so none of this matters much. But for now, to keep
this passing the tests, we inline the bits of the old implementation
that the x86 implementation relied on. Also, since we now support a
slightly larger key space, via the union, some offsets had to be fixed
up.

Nonce calculation was folded in with the emit function, to take
advantage of 64x64 arithmetic. However, Adiantum appeared to rely on no
nonce handling in emit, so this path was conditionalized. We also
introduced a new struct, poly1305_core_key, to represent the precise
amount of space that particular implementation uses.

Testing with kbench9000, depending on the CPU, the update function for
the 32x32 version has been improved by 4%-7%, and for the 64x64 by
19%-30%. The 32x32 gains are small, but I think there's great value in
having a parallel implementation to the 64x64 one so that the two can be
compared side-by-side as nice stand-alone units.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 1c08a10436)
Bug: 152722841
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie53f7e47335863df3d82dbc268c6d8323ae5f559
2020-10-25 11:47:54 +01:00
..
acpi x86: ACPI: fix CPU hotplug deadlock 2020-04-23 10:30:20 +02:00
asm-generic This is the 4.19.140 stable release 2020-08-19 08:43:22 +02:00
clocksource ANDROID: GKI: drivers: clksource: Add API to return cval 2020-04-02 23:32:47 +00:00
crypto UPSTREAM: crypto: poly1305 - add new 32 and 64-bit generic versions 2020-10-25 11:47:54 +01:00
drm Revert "drm/dsi: Fix byte order of DCS set/get brightness" 2020-07-01 18:58:38 +00:00
dt-bindings
keys KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:30:24 +02:00
kvm
linux This is the 4.19.151 stable release 2020-10-14 12:11:08 +02:00
math-emu
media ANDROID: media: increase video max frame number 2020-04-16 23:00:21 +00:00
memory
misc
net This is the 4.19.152 stable release 2020-10-17 10:26:40 +02:00
pcmcia
ras
rdma RDMA/core: Fix double destruction of uobject 2020-06-03 08:19:43 +02:00
scsi ANDROID: GKI: scsi: add Android ABI padding to some structures 2020-05-01 15:18:12 +02:00
soc irqchip/eznps: Fix build error for !ARC700 builds 2020-09-17 13:45:25 +02:00
sound This is the 4.19.135 stable release 2020-07-29 13:22:30 +02:00
target scsi: target: fix hang when multiple threads try to destroy the same iscsi session 2020-04-21 09:03:11 +02:00
trace This is the 4.19.149 stable release 2020-10-01 16:49:05 +02:00
uapi This is the 4.19.147 stable release 2020-09-24 12:48:04 +02:00
vdso UPSTREAM: vdso: Fix clocksource.h macro detection 2020-05-03 16:11:10 +00:00
video
xen