1. 04 Dec, 2020 3 commits
    • Herbert Xu's avatar
      crypto: lib/blake2s - Move selftest prototype into header file · ce0d5d63
      Herbert Xu authored
      This patch fixes a missing prototype warning on blake2s_selftest.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ce0d5d63
    • Ard Biesheuvel's avatar
      crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata · f3456b9f
      Ard Biesheuvel authored
      ARM Cortex-A57 and Cortex-A72 cores running in 32-bit mode are affected
      by silicon errata #1742098 and #1655431, respectively, where the second
      instruction of a AES instruction pair may execute twice if an interrupt
      is taken right after the first instruction consumes an input register of
      which a single 32-bit lane has been updated the last time it was modified.
      
      This is not such a rare occurrence as it may seem: in counter mode, only
      the least significant 32-bit word is incremented in the absence of a
      carry, which makes our counter mode implementation susceptible to these
      errata.
      
      So let's shuffle the counter assignments around a bit so that the most
      recent updates when the AES instruction pair executes are 128-bit wide.
      
      [0] ARM-EPM-049219 v23 Cortex-A57 MPCore Software Developers Errata Notice
      [1] ARM-EPM-012079 v11.0 Cortex-A72 MPCore Software Developers Errata Notice
      
      Cc: <stable@vger.kernel.org> # v5.4+
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      f3456b9f
    • Ard Biesheuvel's avatar
      crypto: ecdh - avoid unaligned accesses in ecdh_set_secret() · 17858b14
      Ard Biesheuvel authored
      ecdh_set_secret() casts a void* pointer to a const u64* in order to
      feed it into ecc_is_key_valid(). This is not generally permitted by
      the C standard, and leads to actual misalignment faults on ARMv6
      cores. In some cases, these are fixed up in software, but this still
      leads to performance hits that are entirely avoidable.
      
      So let's copy the key into the ctx buffer first, which we will do
      anyway in the common case, and which guarantees correct alignment.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      17858b14
  2. 27 Nov, 2020 22 commits
  3. 20 Nov, 2020 13 commits
  4. 13 Nov, 2020 2 commits
    • Ard Biesheuvel's avatar
      crypto: arm64/chacha - simplify tail block handling · c4fc6328
      Ard Biesheuvel authored
      Based on lessons learnt from optimizing the 32-bit version of this driver,
      we can simplify the arm64 version considerably, by reordering the final
      two stores when the last block is not a multiple of 64 bytes. This removes
      the need to use permutation instructions to calculate the elements that are
      clobbered by the final overlapping store, given that the store of the
      penultimate block now follows it, and that one carries the correct values
      for those elements already.
      
      While at it, simplify the overlapping loads as well, by calculating the
      address of the final overlapping load upfront, and switching to this
      address for every load that would otherwise extend past the end of the
      source buffer.
      
      There is no impact on performance, but the resulting code is substantially
      smaller and easier to follow.
      
      Cc: Eric Biggers <ebiggers@google.com>
      Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      c4fc6328
    • Jack Xu's avatar
      crypto: qat - add gen4 firmware loader · 9c0cef23
      Jack Xu authored
      Add support for the QAT gen4 devices in the firmware loader.
      Signed-off-by: default avatarJack Xu <jack.xu@intel.com>
      Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      9c0cef23