<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm64/crypto, branch linux-4.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-05-18T05:19:52Z</updated>
<entry>
<title>crypto: arm64/sha - avoid non-standard inline asm tricks</title>
<updated>2017-05-18T05:19:52Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-04-26T16:11:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f4857f4c2ee9aa4e2aacac1a845352b00197fb57'/>
<id>urn:sha1:f4857f4c2ee9aa4e2aacac1a845352b00197fb57</id>
<content type='text'>
Replace the inline asm which exports struct offsets as ELF symbols
with proper const variables exposing the same values. This works
around an issue with Clang which does not interpret the "i" (or "I")
constraints in the same way as GCC.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Tested-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/aes - add NEON/Crypto Extensions CBCMAC/CMAC/XCBC driver</title>
<updated>2017-02-11T09:50:45Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-02-03T14:49:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4860620da7e5752d916737472c40be573aec1869'/>
<id>urn:sha1:4860620da7e5752d916737472c40be573aec1869</id>
<content type='text'>
On ARMv8 implementations that do not support the Crypto Extensions,
such as the Raspberry Pi 3, the CCM driver falls back to the generic
table based AES implementation to perform the MAC part of the
algorithm, which is slow and not time invariant. So add a CBCMAC
implementation to the shared glue code between NEON AES and Crypto
Extensions AES, so that it can be used instead now that the CCM
driver has been updated to look for CBCMAC implementations other
than the one it supplies itself.

Also, given how these algorithms mostly only differ in the way the key
handling and the final encryption are implemented, expose CMAC and XCBC
algorithms as well based on the same core update code.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/crc32 - merge CRC32 and PMULL instruction based drivers</title>
<updated>2017-02-11T09:50:38Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-02-01T15:35:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d3d9c8bda2c74b13185704e504cdf0aa5210723'/>
<id>urn:sha1:5d3d9c8bda2c74b13185704e504cdf0aa5210723</id>
<content type='text'>
The PMULL based CRC32 implementation already contains code based on the
separate, optional CRC32 instructions to fallback to when operating on
small quantities of data. We can expose these routines directly on systems
that lack the 64x64 PMULL instructions but do implement the CRC32 ones,
which makes the driver that is based solely on those CRC32 instructions
redundant. So remove it.

Note that this aligns arm64 with ARM, whose accelerated CRC32 driver
also combines the CRC32 extension based and the PMULL based versions.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Tested-by: Matthias Brugger &lt;mbrugger@suse.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/aes - don't use IV buffer to return final keystream block</title>
<updated>2017-02-03T10:16:20Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-02-02T11:38:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88a3f582bea9e1da0346ea412950bbbdc3125cc1'/>
<id>urn:sha1:88a3f582bea9e1da0346ea412950bbbdc3125cc1</id>
<content type='text'>
The arm64 bit sliced AES core code uses the IV buffer to pass the final
keystream block back to the glue code if the input is not a multiple of
the block size, so that the asm code does not have to deal with anything
except 16 byte blocks. This is done under the assumption that the outgoing
IV is meaningless anyway in this case, given that chaining is no longer
possible under these circumstances.

However, as it turns out, the CCM driver does expect the IV to retain
a value that is equal to the original IV except for the counter value,
and even interprets byte zero as a length indicator, which may result
in memory corruption if the IV is overwritten with something else.

So use a separate buffer to return the final keystream block.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/aes - replace scalar fallback with plain NEON fallback</title>
<updated>2017-02-03T10:16:20Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-01-28T23:25:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12fcd92305880504c9827c99ea128fecf1c99f0d'/>
<id>urn:sha1:12fcd92305880504c9827c99ea128fecf1c99f0d</id>
<content type='text'>
The new bitsliced NEON implementation of AES uses a fallback in two
places: CBC encryption (which is strictly sequential, whereas this
driver can only operate efficiently on 8 blocks at a time), and the
XTS tweak generation, which involves encrypting a single AES block
with a different key schedule.

The plain (i.e., non-bitsliced) NEON code is more suitable as a fallback,
given that it is faster than scalar on low end cores (which is what
the NEON implementations target, since high end cores have dedicated
instructions for AES), and shows similar behavior in terms of D-cache
footprint and sensitivity to cache timing attacks. So switch the fallback
handling to the plain NEON driver.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/aes-neon-blk - tweak performance for low end cores</title>
<updated>2017-02-03T10:16:20Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-01-28T23:25:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4edd7d015b95abcedde591a0c45965305d7cd524'/>
<id>urn:sha1:4edd7d015b95abcedde591a0c45965305d7cd524</id>
<content type='text'>
The non-bitsliced AES implementation using the NEON is highly sensitive
to micro-architectural details, and, as it turns out, the Cortex-A53 on
the Raspberry Pi 3 is a core that can benefit from this code, given that
its scalar AES performance is abysmal (32.9 cycles per byte).

The new bitsliced AES code manages 19.8 cycles per byte on this core,
but can only operate on 8 blocks at a time, which is not supported by
all chaining modes. With a bit of tweaking, we can get the plain NEON
code to run at 22.0 cycles per byte, making it useful for sequential
modes like CBC encryption. (Like bitsliced NEON, the plain NEON
implementation does not use any lookup tables, which makes it easy on
the D-cache, and invulnerable to cache timing attacks)

So tweak the plain NEON AES code to use tbl instructions rather than
shl/sri pairs, and to avoid the need to reload permutation vectors or
other constants from memory in every round. Also, improve the decryption
performance by switching to 16x8 pmul instructions for the performing
the multiplications in GF(2^8).

To allow the ECB and CBC encrypt routines to be reused by the bitsliced
NEON code in a subsequent patch, export them from the module.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/aes - performance tweak</title>
<updated>2017-02-03T10:16:20Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-01-28T23:25:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c458c4ada0e3e3c898a56d0640d2ef70c9f702e3'/>
<id>urn:sha1:c458c4ada0e3e3c898a56d0640d2ef70c9f702e3</id>
<content type='text'>
Shuffle some instructions around in the __hround macro to shave off
0.1 cycles per byte on Cortex-A57.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/aes - avoid literals for cross-module symbol references</title>
<updated>2017-02-03T10:16:20Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-01-28T23:25:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=262ea4f670b792d0985090b1187b1f1ce2c2c648'/>
<id>urn:sha1:262ea4f670b792d0985090b1187b1f1ce2c2c648</id>
<content type='text'>
Using simple adrp/add pairs to refer to the AES lookup tables exposed by
the generic AES driver (which could be loaded far away from this driver
when KASLR is in effect) was unreliable at module load time before commit
41c066f2c4d4 ("arm64: assembler: make adr_l work in modules under KASLR"),
which is why the AES code used literals instead.

So now we can get rid of the literals, and switch to the adr_l macro.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/chacha20 - remove cra_alignmask</title>
<updated>2017-02-03T10:16:19Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-01-28T23:25:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d1108fd747f88a6555e644073ee5629bad610b9'/>
<id>urn:sha1:4d1108fd747f88a6555e644073ee5629bad610b9</id>
<content type='text'>
Remove the unnecessary alignmask: it is much more efficient to deal with
the misalignment in the core algorithm than relying on the crypto API to
copy the data to a suitably aligned buffer.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: arm64/aes-blk - remove cra_alignmask</title>
<updated>2017-02-03T10:16:19Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2017-01-28T23:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ccc5d51ef968d0d7634d36afbaf0286126e12f09'/>
<id>urn:sha1:ccc5d51ef968d0d7634d36afbaf0286126e12f09</id>
<content type='text'>
Remove the unnecessary alignmask: it is much more efficient to deal with
the misalignment in the core algorithm than relying on the crypto API to
copy the data to a suitably aligned buffer.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
