1. 09 Mar, 2017 1 commit
    • Marcelo Cerri's avatar
      crypto: cbc - Propagate NEED_FALLBACK bit · e6c2e65c
      Marcelo Cerri authored
      When requesting a fallback algorithm, we should propagate the
      NEED_FALLBACK bit when search for the underlying algorithm.
      This will prevents drivers from allocating unnecessary fallbacks that
      are never called. For instance, currently the vmx-crypto driver will use
      the following chain of calls when calling the fallback implementation:
      p8_aes_cbc -> cbc(p8_aes) -> aes-generic
      However p8_aes will always delegate its calls to aes-generic. With this
      patch, p8_aes_cbc will be able to use cbc(aes-generic) directly as its
      fallback. The same applies to aes_s390.
      Signed-off-by: default avatarMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  2. 11 Feb, 2017 1 commit
    • Ard Biesheuvel's avatar
      crypto: algapi - make crypto_xor() and crypto_inc() alignment agnostic · db91af0f
      Ard Biesheuvel authored
      Instead of unconditionally forcing 4 byte alignment for all generic
      chaining modes that rely on crypto_xor() or crypto_inc() (which may
      result in unnecessary copying of data when the underlying hardware
      can perform unaligned accesses efficiently), make those functions
      deal with unaligned input explicitly, but only if the Kconfig symbol
      HAVE_EFFICIENT_UNALIGNED_ACCESS is set. This will allow us to drop
      the alignmasks from the CBC, CMAC, CTR, CTS, PCBC and SEQIV drivers.
      For crypto_inc(), this simply involves making the 4-byte stride
      conditional on HAVE_EFFICIENT_UNALIGNED_ACCESS being set, given that
      it typically operates on 16 byte buffers.
      For crypto_xor(), an algorithm is implemented that simply runs through
      the input using the largest strides possible if unaligned accesses are
      allowed. If they are not, an optimal sequence of memory accesses is
      emitted that takes the relative alignment of the input buffers into
      account, e.g., if the relative misalignment of dst and src is 4 bytes,
      the entire xor operation will be completed using 4 byte loads and stores
      (modulo unaligned bits at the start and end). Note that all expressions
      involving misalign are simply eliminated by the compiler when
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  3. 28 Nov, 2016 2 commits
  4. 26 Nov, 2014 1 commit
  5. 07 Feb, 2008 1 commit
  6. 10 Jan, 2008 2 commits
  7. 02 May, 2007 1 commit
    • Herbert Xu's avatar
      [CRYPTO] templates: Pass type/mask when creating instances · ebc610e5
      Herbert Xu authored
      This patch passes the type/mask along when constructing instances of
      templates.  This is in preparation for templates that may support
      multiple types of instances depending on what is requested.  For example,
      the planned software async crypto driver will use this construct.
      For the moment this allows us to check whether the instance constructed
      is of the correct type and avoid returning success if the type does not
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  8. 06 Feb, 2007 1 commit
  9. 21 Sep, 2006 1 commit
    • Herbert Xu's avatar
      [CRYPTO] cipher: Added block ciphers for CBC/ECB · db131ef9
      Herbert Xu authored
      This patch adds two block cipher algorithms, CBC and ECB.  These
      are implemented as templates on top of existing single-block cipher
      algorithms.  They invoke the single-block cipher through the new
      encrypt_one/decrypt_one interface.
      This also optimises the in-place encryption and decryption to remove
      the cost of an IV copy each round.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>