Skip to content
  1. Mar 25, 2014
  2. Mar 21, 2014
    • chandramouli narayanan's avatar
      crypto: sha - SHA1 transform x86_64 AVX2 · 7c1da8d0
      chandramouli narayanan authored
      This git patch adds x86_64 AVX2 optimization of SHA1
      transform to crypto support. The patch has been tested with 3.14.0-rc1
      kernel.
      
      On a Haswell desktop, with turbo disabled and all cpus running
      at maximum frequency, tcrypt shows AVX2 performance improvement
      from 3% for 256 bytes update to 16% for 1024 bytes update over
      AVX implementation.
      
      This patch adds sha1_avx2_transform(), the glue, build and
      configuration changes needed for AVX2 optimization of
      SHA1 transform to crypto support.
      
      sha1-ssse3 is one module which adds the necessary optimization
      support (SSSE3/AVX/AVX2) for the low-level SHA1 transform function.
      With better optimization support, transform function is overridden
      as the case may be. In the case of AVX2, due to performance reasons
      across datablock sizes, the AVX or AVX2 transform function is used
      at run-time as it suits best. The Makefile change therefore appends
      the necessary objects to the linkage. Due to this, the patch merely
      appends AVX2 trans...
      7c1da8d0
    • Tim Chen's avatar
      crypto: crypto_wq - Fix late crypto work queue initialization · 130fa5bc
      Tim Chen authored
      
      
      The crypto algorithm modules utilizing the crypto daemon could
      be used early when the system start up.  Using module_init
      does not guarantee that the daemon's work queue is initialized
      when the cypto alorithm depending on crypto_wq starts.  It is necessary
      to initialize the crypto work queue earlier at the subsystem
      init time to make sure that it is initialized
      when used.
      
      Signed-off-by: default avatarTim Chen <tim.c.chen@linux.intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      130fa5bc
    • Horia Geanta's avatar
      crypto: caam - add missing key_dma unmap · ec31eed7
      Horia Geanta authored
      
      
      (struct caam_ctx) ctx->key_dma needs to be unmapped
      when context is cleaned up.
      
      Signed-off-by: default avatarHoria Geanta <horia.geanta@freescale.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ec31eed7
    • Horia Geanta's avatar
      crypto: caam - add support for aead null encryption · ae4a825f
      Horia Geanta authored
      
      
      Add support for the following combinations:
      -encryption: null
      -authentication: md5, sha* (1, 224, 256, 384, 512)
      
      Signed-off-by: default avatarTudor Ambarus <tudor.ambarus@freescale.com>
      Signed-off-by: default avatarHoria Geanta <horia.geanta@freescale.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ae4a825f
    • Horia Geanta's avatar
      crypto: testmgr - add aead null encryption test vectors · bca4feb0
      Horia Geanta authored
      
      
      Add test vectors for aead with null encryption and md5,
      respectively sha1 authentication.
      Input data is taken from test vectors listed in RFC2410.
      
      Signed-off-by: default avatarHoria Geanta <horia.geanta@freescale.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      bca4feb0
    • Horia Geanta's avatar
      crypto: export NULL algorithms defines · 72567258
      Horia Geanta authored
      
      
      These defines might be needed by crypto drivers.
      
      Signed-off-by: default avatarHoria Geanta <horia.geanta@freescale.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      72567258
    • Horia Geanta's avatar
      crypto: caam - remove error propagation handling · 4464a7d4
      Horia Geanta authored
      Commit 61bb86bb
      
      
      ("crypto: caam - set descriptor sharing type to SERIAL")
      changed the descriptor sharing mode from SHARE_WAIT to SHARE_SERIAL.
      
      All descriptor commands that handle the "ok to share" and
      "error propagation" settings should also go away, since they have no
      meaning for SHARE_SERIAL.
      
      Signed-off-by: default avatarHoria Geanta <horia.geanta@freescale.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      4464a7d4
    • Marek Vasut's avatar
      crypto: hash - Simplify the ahash_finup implementation · d4a7a0fb
      Marek Vasut authored
      
      
      The ahash_def_finup() can make use of the request save/restore functions,
      thus make it so. This simplifies the code a little and unifies the code
      paths.
      
      Note that the same remark about free()ing the req->priv applies here, the
      req->priv can only be free()'d after the original request was restored.
      
      Finally, squash a bug in the invocation of completion in the ASYNC path.
      In both ahash_def_finup_done{1,2}, the function areq->base.complete(X, err);
      was called with X=areq->base.data . This is incorrect , as X=&areq->base
      is the correct value. By analysis of the data structures, we see the areq is
      of type 'struct ahash_request' , areq->base is of type 'struct crypto_async_request'
      and areq->base.completion is of type crypto_completion_t, which is defined in
      include/linux/crypto.h as:
      
        typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err);
      
      This is one lead that the X should be &areq->base . Next up, we can inspect
      other code which calls the completion callback to give us kind-of statistical
      idea of how this callback is used. We can try:
      
        $ git grep base\.complete\( drivers/crypto/
      
      Finally, by inspecting ahash_request_set_callback() implementation defined
      in include/crypto/hash.h , we observe that the .data entry of 'struct
      crypto_async_request' is intended for arbitrary data, not for completion
      argument.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      d4a7a0fb
    • Marek Vasut's avatar
      crypto: hash - Pull out the functions to save/restore request · 1ffc9fbd
      Marek Vasut authored
      
      
      The functions to save original request within a newly adjusted request
      and it's counterpart to restore the original request can be re-used by
      more code in the crypto/ahash.c file. Pull these functions out from the
      code so they're available.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      1ffc9fbd
    • Marek Vasut's avatar
      crypto: hash - Fix the pointer voodoo in unaligned ahash · ab6bf4e5
      Marek Vasut authored
      
      
      Add documentation for the pointer voodoo that is happening in crypto/ahash.c
      in ahash_op_unaligned(). This code is quite confusing, so add a beefy chunk
      of documentation.
      
      Moreover, make sure the mangled request is completely restored after finishing
      this unaligned operation. This means restoring all of .result, .base.data
      and .base.complete .
      
      Also, remove the crypto_completion_t complete = ... line present in the
      ahash_op_unaligned_done() function. This type actually declares a function
      pointer, which is very confusing.
      
      Finally, yet very important nonetheless, make sure the req->priv is free()'d
      only after the original request is restored in ahash_op_unaligned_done().
      The req->priv data must not be free()'d before that in ahash_op_unaligned_finish(),
      since we would be accessing previously free()'d data in ahash_op_unaligned_done()
      and cause corruption.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ab6bf4e5
    • Herbert Xu's avatar
      crypto: caam - Fix first parameter to caam_init_rng · 85e0da92
      Herbert Xu authored
      
      
      Found by the kbuild test robot, the first argument to caam_init_rng
      has a spurious ampersand.
      
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      85e0da92
  3. Mar 10, 2014
  4. Feb 27, 2014