<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/crypto/caam/caamhash.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-08-30T08:05:30Z</updated>
<entry>
<title>crypto: caam - make CAAM_PTR_SZ dynamic</title>
<updated>2019-08-30T08:05:30Z</updated>
<author>
<name>Andrey Smirnov</name>
</author>
<published>2019-08-20T20:23:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a3daadce955530df92b1bb22093618dd26a1717'/>
<id>urn:sha1:1a3daadce955530df92b1bb22093618dd26a1717</id>
<content type='text'>
In order to be able to configure CAAM pointer size at run-time, which
needed to support i.MX8MQ, which is 64-bit SoC with 32-bit pointer
size, convert CAAM_PTR_SZ to refer to a global variable of the same
name ("caam_ptr_sz") and adjust the rest of the code accordingly. No
functional change intended.

Signed-off-by: Andrey Smirnov &lt;andrew.smirnov@gmail.com&gt;
Cc: Chris Spencer &lt;christopher.spencer@sea.co.uk&gt;
Cc: Cory Tusar &lt;cory.tusar@zii.aero&gt;
Cc: Chris Healy &lt;cphealy@gmail.com&gt;
Cc: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Cc: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Cc: Aymen Sghaier &lt;aymen.sghaier@nxp.com&gt;
Cc: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - change return value in case CAAM has no MDHA</title>
<updated>2019-08-09T05:11:52Z</updated>
<author>
<name>Iuliana Prodan</name>
</author>
<published>2019-07-31T13:08:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0435d47e2627b76b6dfb59e2e95ffed7232bd0ed'/>
<id>urn:sha1:0435d47e2627b76b6dfb59e2e95ffed7232bd0ed</id>
<content type='text'>
To be consistent with other CAAM modules, caamhash should return 0
instead of -ENODEV in case CAAM has no MDHA.

Based on commit 1b46c90c8e00 ("crypto: caam - convert top level drivers to libraries")
the value returned by entry point is never checked and
the exit point is always executed.

Signed-off-by: Iuliana Prodan &lt;iuliana.prodan@nxp.com&gt;
Reviewed-by: Horia Geanta &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - fix MDHA key derivation for certain user key lengths</title>
<updated>2019-08-09T05:11:49Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-07-31T13:08:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9b4913a5f944b23d6109c44b6f3fc6e092e30ce'/>
<id>urn:sha1:e9b4913a5f944b23d6109c44b6f3fc6e092e30ce</id>
<content type='text'>
Fuzz testing uncovered an issue when |user key| &gt; |derived key|.
Derived key generation has to be fixed in two cases:

1. Era &gt;= 6 (DKP is available)
DKP cannot be used with immediate input key if |user key| &gt; |derived key|,
since the resulting descriptor (after DKP execution) would be invalid -
having a few bytes from user key left in descriptor buffer
as incorrect opcodes.

Fix DKP usage both in standalone hmac and in authenc algorithms.
For authenc the logic is simplified, by always storing both virtual
and dma key addresses.

2. Era &lt; 6
The same case (|user key| &gt; |derived key|) fails when DKP
is not available.
Make sure gen_split_key() dma maps max(|user key|, |derived key|),
since this is an in-place (bidirectional) operation.

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Reviewed-by: Iuliana Prodan &lt;iuliana.prodan@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - keep both virtual and dma key addresses</title>
<updated>2019-08-09T05:11:49Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-07-31T13:08:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a2fb864c042b00debc7696d4459d8058ec7c8013'/>
<id>urn:sha1:a2fb864c042b00debc7696d4459d8058ec7c8013</id>
<content type='text'>
Update alginfo struct to keep both virtual and dma key addresses,
so that descriptors have them at hand.
One example where this is needed is in the xcbc(aes) shared descriptors,
which are updated in current patch.
Another example is the upcoming fix for DKP.

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Reviewed-by: Iuliana Prodan &lt;iuliana.prodan@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - check key length</title>
<updated>2019-08-09T05:11:46Z</updated>
<author>
<name>Iuliana Prodan</name>
</author>
<published>2019-07-31T13:08:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=836d8f43c5e529935bb3140edc710c23ffd1d54a'/>
<id>urn:sha1:836d8f43c5e529935bb3140edc710c23ffd1d54a</id>
<content type='text'>
Check key length to solve the extra tests that expect -EINVAL to be
returned when the key size is not valid.

Validated AES keylen for skcipher, ahash and aead.

Signed-off-by: Iuliana Prodan &lt;iuliana.prodan@nxp.com&gt;
Reviewed-by: Horia Geanta &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - fix return code in completion callbacks</title>
<updated>2019-08-09T05:11:45Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-07-31T13:08:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1984aaeec372fbfb597883074253d290cbd543d4'/>
<id>urn:sha1:1984aaeec372fbfb597883074253d290cbd543d4</id>
<content type='text'>
Modify drive to provide a valid errno (and not the HW error ID)
to the user, via completion callbacks.

A "valid errno" is currently not explicitly mentioned in the docs,
however the error code is expected to match the one returned by the
generic SW implementation.

Note: in most error cases caam/qi and caam/qi2 returned -EIO; align all
caam drivers to return -EINVAL.

While here, ratelimit prints triggered by fuzz testing, such that
console is not flooded.

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Iuliana Prodan &lt;iuliana.prodan@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - use len instead of nents for bulding HW S/G table</title>
<updated>2019-06-20T06:18:33Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-06-10T13:30:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=059d73eea6409873446a858dd64a5bec9bf68b70'/>
<id>urn:sha1:059d73eea6409873446a858dd64a5bec9bf68b70</id>
<content type='text'>
Currently, conversion of SW S/G table into HW S/G layout relies on
nents returned by sg_nents_for_len(sg, len).
However this leaves the possibility of HW S/G referencing more data
then needed: since buffer length in HW S/G entries is filled using
sg_dma_len(sg), the last entry in HW S/G table might have a length
that is bigger than needed for the crypto request.

This way of S/G table conversion is fine, unless after converting a table
more entries have to be appended to the HW S/G table.
In this case, crypto engine would access data from the S/G entry having
the incorrect length, instead of advancing in the S/G table.
This situation doesn't exist, but the upcoming implementation of
IV update for skcipher algorithms needs to add a S/G entry after
req-&gt;dst S/G (corresponding to output IV).

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - print debug messages at debug level</title>
<updated>2019-05-30T07:35:45Z</updated>
<author>
<name>Sascha Hauer</name>
</author>
<published>2019-05-23T08:50:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e005503199b9bf1b385949c05897fd6567b5af4'/>
<id>urn:sha1:6e005503199b9bf1b385949c05897fd6567b5af4</id>
<content type='text'>
The CAAM driver used to put its debug messages inside #ifdef DEBUG and
then prints the messages at KERN_ERR level. Replace this with proper
functions printing at KERN_DEBUG level. The #ifdef DEBUG gets
unnecessary when the right functions are used.

This replaces:

- print_hex_dump(KERN_ERR ...) inside #ifdef DEBUG with
  print_hex_dump_debug(...)
- dev_err() inside #ifdef DEBUG with dev_dbg()
- printk(KERN_ERR ...) inside #ifdef DEBUG with dev_dbg()

Some parts of the driver use these functions already, so it is only
consequent to use the debug function consistently.

Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - remove unused defines</title>
<updated>2019-05-30T07:30:30Z</updated>
<author>
<name>Sascha Hauer</name>
</author>
<published>2019-05-23T08:50:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32f75e67f3457479d79bc5c26b0eb4e2bc150cf0'/>
<id>urn:sha1:32f75e67f3457479d79bc5c26b0eb4e2bc150cf0</id>
<content type='text'>
The CAAM driver defines its own debug() macro, but it is unused. Remove
it.

Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Reviewed-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - convert top level drivers to libraries</title>
<updated>2019-05-23T06:01:03Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-05-03T14:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b46c90c8e002028dc622bf7bd8cf89efcaab274'/>
<id>urn:sha1:1b46c90c8e002028dc622bf7bd8cf89efcaab274</id>
<content type='text'>
Currently we allow top level code, i.e. that which sits between the
low level (HW-specific) drivers and crypto API, to be built as several
drivers: caamalg, caamhash, caam_pkc, caamrng, caamalg_qi.

There is no advantage in this, more it interferes with adding support
for deferred probing (there are no corresponding devices and thus
no bus).

Convert these drivers and call init() / exit() manually at the right
time.
Move algorithms initialization at JR probe / remove time:
-the first probed JR registers the crypto algs
-the last removed JR unregisters the crypto algs

Note: caam_qi_init() is called before JR platform devices creation
(of_populate_bus()), such that QI interface is initialized when
the caam/qi algorithms are registered in the JR driver (by calling
caam_qi_algapi_init().

While here, fix the Kconfig entries under CRYPTO_DEV_FSL_CAAM_JR
to be aligned.

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
