2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 04:03:58 +08:00
linux-next/drivers/crypto/amcc
Christian Lamparter cd4dcd6da7 crypto: crypto4xx - overhaul crypto4xx_build_pd()
This patch overhauls and fixes code related to crypto4xx_build_pd()

 * crypto4xx_build_pd() did not handle chained source scatterlist.
   This is fixed by replacing the buggy indexed-access of &src[idx]
   with sg_next() in the gather array setup loop.

 * The redundant is_hash, direction, save_iv and pd_ctl members
   in the crypto4xx_ctx struct have been removed.
    - is_hash can be derived from the crypto_async_request parameter.
    - direction is already part of the security association's
      bf.dir bitfield.
    - save_iv is unused.
    - pd_ctl always had the host_ready bit enabled anyway.
      (the hash_final case is rather pointless, since the ahash
       code has been deactivated).

 * make crypto4xx_build_pd()'s caller responsible for converting
   the IV to the LE32 format.

 * change crypto4xx_ahash_update() and crypto4xx_ahash_digest() to
   initialize a temporary destination scatterlist. This allows the
   removal of an ugly cast of req->result (which is a pointer to an
   u8-array) to a scatterlist pointer.

 * change crypto4xx_build_pd() return type to int. After all
   it returns -EINPROGRESS/-EBUSY.

 * fix crypto4xx_build_pd() thread-unsafe sa handling.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-10-12 22:55:15 +08:00
..
crypto4xx_alg.c crypto: crypto4xx - overhaul crypto4xx_build_pd() 2017-10-12 22:55:15 +08:00
crypto4xx_core.c crypto: crypto4xx - overhaul crypto4xx_build_pd() 2017-10-12 22:55:15 +08:00
crypto4xx_core.h crypto: crypto4xx - overhaul crypto4xx_build_pd() 2017-10-12 22:55:15 +08:00
crypto4xx_reg_def.h crypto: crypto4xx - rename ce_ring_contol to ce_ring_control 2017-04-24 18:11:06 +08:00
crypto4xx_sa.h crypto: crypto4xx - use the correct LE32 format for IV and key defs 2017-10-12 22:55:13 +08:00
crypto4xx_trng.c crypto4xx: integrate ppc4xx-rng into crypto4xx 2016-04-20 17:50:02 +08:00
crypto4xx_trng.h crypto4xx: integrate ppc4xx-rng into crypto4xx 2016-04-20 17:50:02 +08:00
Makefile crypto: crypto4xx - move and refactor dynamic_contents helpers 2017-09-22 17:43:18 +08:00