1. 10 May, 2024 6 commits
  2. 03 May, 2024 3 commits
  3. 26 Apr, 2024 14 commits
  4. 19 Apr, 2024 15 commits
  5. 12 Apr, 2024 2 commits
    • Eric Biggers's avatar
      crypto: x86/aes-xts - make non-AVX implementation use new glue code · 751fb252
      Eric Biggers authored
      Make the non-AVX implementation of AES-XTS (xts-aes-aesni) use the new
      glue code that was introduced for the AVX implementations of AES-XTS.
      This reduces code size, and it improves the performance of xts-aes-aesni
      due to the optimization for messages that don't span page boundaries.
      
      This required moving the new glue functions higher up in the file and
      allowing the IV encryption function to be specified by the caller.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      751fb252
    • Lukas Wunner's avatar
      X.509: Introduce scope-based x509_certificate allocation · 5c6ca9d9
      Lukas Wunner authored
      Add a DEFINE_FREE() clause for x509_certificate structs and use it in
      x509_cert_parse() and x509_key_preparse().  These are the only functions
      where scope-based x509_certificate allocation currently makes sense.
      A third user will be introduced with the forthcoming SPDM library
      (Security Protocol and Data Model) for PCI device authentication.
      
      Unlike most other DEFINE_FREE() clauses, this one checks for IS_ERR()
      instead of NULL before calling x509_free_certificate() at end of scope.
      That's because the "constructor" of x509_certificate structs,
      x509_cert_parse(), returns a valid pointer or an ERR_PTR(), but never
      NULL.
      
      Comparing the Assembler output before/after has shown they are identical,
      save for the fact that gcc-12 always generates two return paths when
      __cleanup() is used, one for the success case and one for the error case.
      
      In x509_cert_parse(), add a hint for the compiler that kzalloc() never
      returns an ERR_PTR().  Otherwise the compiler adds a gratuitous IS_ERR()
      check on return.  Introduce an assume() macro for this which can be
      re-used elsewhere in the kernel to provide hints for the compiler.
      Suggested-by: default avatarJonathan Cameron <Jonathan.Cameron@Huawei.com>
      Link: https://lore.kernel.org/all/20231003153937.000034ca@Huawei.com/
      Link: https://lwn.net/Articles/934679/Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      5c6ca9d9