<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/crypto, branch v6.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-10-27T10:04:30Z</updated>
<entry>
<title>crypto: FIPS 202 SHA-3 register in hash info for IMA</title>
<updated>2023-10-27T10:04:30Z</updated>
<author>
<name>Dimitri John Ledkov</name>
<email>dimitri.ledkov@canonical.com</email>
</author>
<published>2023-10-22T18:22:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b057654ebc3e071e2a95ea2edfd15b5682cedba'/>
<id>urn:sha1:4b057654ebc3e071e2a95ea2edfd15b5682cedba</id>
<content type='text'>
Register FIPS 202 SHA-3 hashes in hash info for IMA and other
users. Sizes 256 and up, as 224 is too weak for any practical
purposes.

Signed-off-by: Dimitri John Ledkov &lt;dimitri.ledkov@canonical.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ahash - optimize performance when wrapping shash</title>
<updated>2023-10-27T10:04:30Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2023-10-22T08:11:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2f1f34c1bf7b309b296bc04321a09e6b5dba0673'/>
<id>urn:sha1:2f1f34c1bf7b309b296bc04321a09e6b5dba0673</id>
<content type='text'>
The "ahash" API provides access to both CPU-based and hardware offload-
based implementations of hash algorithms.  Typically the former are
implemented as "shash" algorithms under the hood, while the latter are
implemented as "ahash" algorithms.  The "ahash" API provides access to
both.  Various kernel subsystems use the ahash API because they want to
support hashing hardware offload without using a separate API for it.

Yet, the common case is that a crypto accelerator is not actually being
used, and ahash is just wrapping a CPU-based shash algorithm.

This patch optimizes the ahash API for that common case by eliminating
the extra indirect call for each ahash operation on top of shash.

It also fixes the double-counting of crypto stats in this scenario
(though CONFIG_CRYPTO_STATS should *not* be enabled by anyone interested
in performance anyway...), and it eliminates redundant checking of
CRYPTO_TFM_NEED_KEY.  As a bonus, it also shrinks struct crypto_ahash.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ahash - remove crypto_ahash_alignmask</title>
<updated>2023-10-27T10:04:29Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2023-10-22T08:10:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f8660c82b79af595b056f6b9f4f227edeb88574'/>
<id>urn:sha1:0f8660c82b79af595b056f6b9f4f227edeb88574</id>
<content type='text'>
crypto_ahash_alignmask() no longer has any callers, and it always
returns 0 now that neither ahash nor shash algorithms support nonzero
alignmasks anymore.  Therefore, remove it.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ahash - remove support for nonzero alignmask</title>
<updated>2023-10-27T10:04:29Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2023-10-22T08:10:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c626910f3f1bbce6ad18bc613d895d2a089ed95e'/>
<id>urn:sha1:c626910f3f1bbce6ad18bc613d895d2a089ed95e</id>
<content type='text'>
Currently, the ahash API checks the alignment of all key and result
buffers against the algorithm's declared alignmask, and for any
unaligned buffers it falls back to manually aligned temporary buffers.

This is virtually useless, however.  First, since it does not apply to
the message, its effect is much more limited than e.g. is the case for
the alignmask for "skcipher".  Second, the key and result buffers are
given as virtual addresses and cannot (in general) be DMA'ed into, so
drivers end up having to copy to/from them in software anyway.  As a
result it's easy to use memcpy() or the unaligned access helpers.

The crypto_hash_walk_*() helper functions do use the alignmask to align
the message.  But with one exception those are only used for shash
algorithms being exposed via the ahash API, not for native ahashes, and
aligning the message is not required in this case, especially now that
alignmask support has been removed from shash.  The exception is the
n2_core driver, which doesn't set an alignmask.

In any case, no ahash algorithms actually set a nonzero alignmask
anymore.  Therefore, remove support for it from ahash.  The benefit is
that all the code to handle "misaligned" buffers in the ahash API goes
away, reducing the overhead of the ahash API.

This follows the same change that was made to shash.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: shash - remove crypto_shash_ctx_aligned()</title>
<updated>2023-10-27T10:04:28Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2023-10-22T08:10:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=acd7799574e57f1e494a5b85741eee78d1e93aca'/>
<id>urn:sha1:acd7799574e57f1e494a5b85741eee78d1e93aca</id>
<content type='text'>
crypto_shash_ctx_aligned() is no longer used, and it is useless now that
shash algorithms don't support nonzero alignmasks, so remove it.

Also remove crypto_tfm_ctx_aligned() which was only called by
crypto_shash_ctx_aligned().  It's unlikely to be useful again, since it
seems inappropriate to use cra_alignmask to represent alignment for the
tfm context when it already means alignment for inputs/outputs.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: shash - remove crypto_shash_alignmask</title>
<updated>2023-10-27T10:04:25Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2023-10-19T05:53:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3dca18fcfebf33f2a73876f9314f7621c2e2fb0b'/>
<id>urn:sha1:3dca18fcfebf33f2a73876f9314f7621c2e2fb0b</id>
<content type='text'>
crypto_shash_alignmask() no longer has any callers, and it always
returns 0 now that the shash algorithm type no longer supports nonzero
alignmasks.  Therefore, remove it.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: shash - eliminate indirect call for default import and export</title>
<updated>2023-10-27T10:04:24Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2023-10-18T22:34:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=08debaa5cb31da50725a8cb2f06d3f617a9caa98'/>
<id>urn:sha1:08debaa5cb31da50725a8cb2f06d3f617a9caa98</id>
<content type='text'>
Most shash algorithms don't have custom -&gt;import and -&gt;export functions,
resulting in the memcpy() based default being used.  Yet,
crypto_shash_import() and crypto_shash_export() still make an indirect
call, which is expensive.  Therefore, change how the default import and
export are called to make it so that crypto_shash_import() and
crypto_shash_export() don't do an indirect call in this case.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: skcipher - Remove obsolete skcipher_alg helpers</title>
<updated>2023-10-13T10:27:27Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-10-03T03:43:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c98594373c01739c2a2b3f056b8f2f850c26dc7'/>
<id>urn:sha1:2c98594373c01739c2a2b3f056b8f2f850c26dc7</id>
<content type='text'>
As skcipher spawn users can no longer assume the spawn is of type
struct skcipher_alg, these helpers are no longer used.  Remove them.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: skcipher - Add crypto_spawn_skcipher_alg_common</title>
<updated>2023-10-13T10:27:26Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-10-03T03:43:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ab6223dc3e1b0a842d663abbed400c43ebee07fc'/>
<id>urn:sha1:ab6223dc3e1b0a842d663abbed400c43ebee07fc</id>
<content type='text'>
As skcipher spawns can be of two different types (skcipher vs.
lskcipher), only the common fields can be accessed.  Add a helper
to return the common algorithm object.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: sig - fix kernel-doc typo</title>
<updated>2023-10-05T10:16:31Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2023-10-01T00:00:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18e2ef172cec1680a6736cc7f6e1b92c93b3daa0'/>
<id>urn:sha1:18e2ef172cec1680a6736cc7f6e1b92c93b3daa0</id>
<content type='text'>
Correct typo of "destination".

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
