android_kernel_oneplus_msm8998/arch
Eric Biggers 0223de3a24 ANDROID: arm64/crypto: add ARMv8-CE optimized poly_hash algorithm
poly_hash is part of the HEH (Hash-Encrypt-Hash) encryption mode,
proposed in Internet Draft
https://tools.ietf.org/html/draft-cope-heh-01.  poly_hash is very
similar to GHASH; besides the swapping of the last two coefficients
which we opted to handle in the HEH template, poly_hash just uses a
different finite field representation.  As with GHASH, poly_hash becomes
much faster and more secure against timing attacks when implemented
using carryless multiplication instructions instead of tables.  This
patch adds an ARMv8-CE optimized version of poly_hash, based roughly on
the existing ARMv8-CE optimized version of GHASH.

Benchmark results are shown below, but note that the resistance to
timing attacks may be even more important than the performance gain.

poly_hash only:

    poly_hash-generic:
        1,000,000 setkey() takes 1185 ms
        hashing is 328 MB/s

    poly_hash-ce:
        1,000,000 setkey() takes 8 ms
        hashing is 1756 MB/s

heh(aes) with 4096-byte inputs (this is the ideal case, as the
improvement is less significant with smaller inputs):

    encryption with "heh_base(cmac(aes-ce),poly_hash-generic,ecb-aes-ce)": 118 MB/s
    decryption with "heh_base(cmac(aes-ce),poly_hash-generic,ecb-aes-ce)": 120 MB/s

    encryption with "heh_base(cmac(aes-ce),poly_hash-ce,ecb-aes-ce)": 291 MB/s
    decryption with "heh_base(cmac(aes-ce),poly_hash-ce,ecb-aes-ce)": 293 MB/s

Bug: 32508661
Signed-off-by: Eric Biggers <ebiggers@google.com>
Change-Id: I621ec0e1115df7e6f5cbd7e864a4a9d8d2e94cf2
2017-02-10 20:09:13 +00:00
..
alpha mm: mlock: add mlock flags to enable VM_LOCKONFAULT usage 2015-11-05 19:34:48 -08:00
arc ARC: dw2 unwind: Catch Dwarf SNAFUs early 2015-12-21 14:01:49 +05:30
arm UPSTREAM: arm/arm64: crypto: assure that ECB modes don't require an IV 2017-02-10 20:07:49 +00:00
arm64 ANDROID: arm64/crypto: add ARMv8-CE optimized poly_hash algorithm 2017-02-10 20:09:13 +00:00
avr32 dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00
blackfin treewide: Remove old email address 2015-11-23 09:44:58 +01:00
c6x
cris cris: Drop reference to get_cmos_time() 2015-11-02 20:03:05 +01:00
frv kmap_atomic_to_page() has no users, remove it 2015-11-09 15:11:24 -08:00
h8300 h8300 update for v4.4 2015-11-12 15:26:39 -08:00
hexagon
ia64 UPSTREAM: ia64: split off early_ioremap() declarations into asm/early_ioremap.h 2016-10-03 13:43:52 -07:00
m32r m32r: add io*_rep helpers 2015-12-29 17:45:49 -08:00
m68k m68k: Wire up mlock2 2015-11-22 11:35:26 +01:00
metag Metag architecture changes for v4.4 2015-11-10 16:24:25 -08:00
microblaze Revert "scatterlist: use sg_phys()" 2015-12-15 12:54:06 -08:00
mips MIPS: Prevent "restoration" of MSA context in non-MSA kernels 2017-01-09 23:15:10 +00:00
mn10300 mn10300: Select CONFIG_HAVE_UID16 to fix build failure 2015-11-30 07:01:40 -08:00
nios2 nios2: fix cache coherency 2015-11-26 22:25:58 +08:00
openrisc
parisc UPSTREAM: arch: Introduce post-init read-only memory 2016-09-23 10:04:12 -07:00
powerpc FROMLIST: mm: ASLR: use get_random_long() 2016-03-16 16:50:34 -07:00
s390 s390/dis: Fix handling of format specifiers 2015-12-18 14:43:21 +01:00
score
sh sh64: fix __NR_fgetxattr 2015-12-12 10:15:34 -08:00
sparc FROMLIST: mm: ASLR: use get_random_long() 2016-03-16 16:50:34 -07:00
tile tile: provide CONFIG_PAGE_SIZE_64KB etc for tilepro 2016-01-05 08:16:09 -05:00
um um: fix returns without va_end 2015-12-08 22:26:00 +01:00
unicore32 pwm: Changes for v4.4-rc1 2015-11-11 09:16:10 -08:00
x86 goldfish: enable CONFIG_INET_DIAG_DESTROY 2016-12-09 18:46:03 +00:00
xtensa Merge branch 'for-4.4/io-poll' of git://git.kernel.dk/linux-block 2015-11-10 17:23:49 -08:00
.gitignore
Kconfig BACKPORT: mm: Implement stack frame object validation 2016-09-06 15:53:23 +00:00