crypto: sha256 - Merge 2 separate C implementations into 1, put into separate library
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest7 patches 4 repliesIn review
- v16 patches 8 repliesSuperseded
Changes in v2 from the cover letter
- 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
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | crypto: sha256 - Fix some coding style issueslib/ | +49 | 0 replies | |
| 2/7 | crypto: sha256_generic - Fix some coding style issuescrypto/ | +134 | 0 replies | |
| 3/7 | crypto: sha256 - Move lib/sha256.c to lib/cryptoarch/ arch/ arch/ +3 more | +6 | 0 replies | |
| 4/7 | crypto: sha256 - Use get/put_unaligned_be32 to get input, memzero_explicitlib/ | +4 | 0 replies | |
| 5/7 | crypto: sha256 - Make lib/crypto/sha256.c suitable for generic usearch/ arch/ crypto/ +3 more | +17 | 0 replies | |
| 6/7 | crypto: sha256 - Add sha224 support to sha256 library codeinclude/ lib/ | +40 | 0 replies | |
| 7/7 | crypto: sha256_generic - Switch to the generic lib/crypto/sha256.c lib codecrypto/ crypto/ | +19 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/7] crypto: sha256 - Merge 2 separate C implementations into 1, put into separate library
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