All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] crypto: sha256 - Merge 2 separate C implementations into 1, put into separate library
@ 2019-08-17 14:24 Hans de Goede
  2019-08-17 14:24 ` [PATCH v2 1/7] crypto: sha256 - Fix some coding style issues Hans de Goede
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Hans de Goede @ 2019-08-17 14:24 UTC (permalink / raw)
  To: Herbert Xu, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	H . Peter Anvin, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger
  Cc: Hans de Goede, Eric Biggers, Andy Lutomirski, Ard Biesheuvel,
	linux-crypto, x86, linux-s390, linux-kernel

Hi All,

Here is v2 of my patch series refactoring the current 2 separate SHA256
C implementations into 1 and put it into a separate library.

There are 3 reasons for this:

1) Remove the code duplication of having 2 separate implementations

2) Offer a separate library SHA256 implementation which can be used
without having to call crypto_alloc_shash first. This is especially
useful for use during early boot when crypto_alloc_shash does not
work yet.

3) Having the purgatory code using the same code as the crypto subsys means
that the purgratory code will be tested by the crypto subsys selftests.

This has been tested on x86, including checking that kecec still works.

This has NOT been tested on s390, if someone with access to s390 can
test that things still build with this series applied and that
kexec still works, that would be great.

Changes in v2:
- Use put_unaligned_be32 to store the hash to allow callers to use an
  unaligned buffer for storing the hash
- Add a comment to include/crypto/sha256.h explaining that these functions
  now may be used outside of the purgatory too (and that using the crypto
  API instead is preferred)
- Add sha224 support to the lib/crypto/sha256 library code
- Make crypto/sha256_generic.c not only use sha256_transform from
  lib/crypto/sha256.c but also switch it to using sha256_init, sha256_update
  and sha256_final from there so that the crypto subsys selftests fully test
  the lib/crypto/sha256.c implementation

Regards,

Hans


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-08-22  5:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-17 14:24 [PATCH v2 0/7] crypto: sha256 - Merge 2 separate C implementations into 1, put into separate library Hans de Goede
2019-08-17 14:24 ` [PATCH v2 1/7] crypto: sha256 - Fix some coding style issues Hans de Goede
2019-08-17 14:24 ` [PATCH v2 2/7] crypto: sha256_generic " Hans de Goede
2019-08-17 14:24 ` [PATCH v2 3/7] crypto: sha256 - Move lib/sha256.c to lib/crypto Hans de Goede
2019-08-17 14:24 ` [PATCH v2 4/7] crypto: sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit Hans de Goede
2019-08-17 14:24 ` [PATCH v2 5/7] crypto: sha256 - Make lib/crypto/sha256.c suitable for generic use Hans de Goede
2019-08-17 14:24 ` [PATCH v2 6/7] crypto: sha256 - Add sha224 support to sha256 library code Hans de Goede
2019-08-17 14:24 ` [PATCH v2 7/7] crypto: sha256_generic - Switch to the generic lib/crypto/sha256.c lib code Hans de Goede
2019-08-19 15:08 ` [PATCH v2 0/7] crypto: sha256 - Merge 2 separate C implementations into 1, put into separate library Ard Biesheuvel
2019-08-19 15:08   ` Ard Biesheuvel
2019-08-19 19:38   ` Hans de Goede
2019-08-19 19:38     ` Hans de Goede
2019-08-19 20:30     ` Ard Biesheuvel
2019-08-19 20:30       ` Ard Biesheuvel
2019-08-22  5:57 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.