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
Drop the duplicate generic sha256 (and sha224) implementation from
crypto/sha256_generic.c and use the implementation from
lib/crypto/sha256.c instead.
"diff -u lib/crypto/sha256.c sha256_generic.c" shows that the core
sha256_transform function from both implementations is identical and
the other
Generic crypto implementations belong under lib/crypto not directly in
lib, likewise the header should be in include/crypto, not include/linux.
Note that the code in lib/crypto/sha256.c is not yet available for
generic use after this commit, it is still only used by the s390 and x86
purgatory code
Add a bunch of missing spaces after commas and arround operators.
Note the main goal of this is to make sha256_transform and its helpers
identical in formatting too the duplcate implementation in lib/sha256.c,
so that "diff -u" can be used to compare them to prove that no functional
changes are ma
Use get/put_unaligned_be32 in lib/crypto/sha256.c to load / store data
so that it can be used with unaligned buffers too, making it more generic.
And use memzero_explicit for better clearing of sensitive data.
Note unlike other patches in this series this commit actually makes
functional changes
Before this commit lib/crypto/sha256.c has only been used in the s390 and
x86 purgatory code, make it suitable for generic use:
* Export interesting symbols
* Add -D__DISABLE_EXPORTS to CFLAGS_sha256.o for purgatory builds to
avoid the exports for the purgatory builds
* Add to lib/crypto/Makefi
Add sha224 support to the lib/crypto/sha256 library code. This will allow
us to replace both the sha256 and sha224 parts of crypto/sha256_generic.c
when we remove the code duplication in further patches in this series.
Suggested-by: Eric Biggers
Signed-off-by: Hans de Goede
---
include/crypto/s
For some reason after the first 15 steps the last statement of each
step ends with "t1+t2", missing spaces around the "+". This commit
fixes this. This was done with a 's/= t1+t2/= t1 + t2/' to make sure
no functional changes are introduced.
Note the main goal of this is to make lib/sha256.c's sha
Hi Eric,
Thank you for the review and for the quick turn around time
on the review.
On 17-08-19 07:35, Eric Biggers wrote:
On Fri, Aug 16, 2019 at 10:13:18PM -0700, Eric Biggers wrote:
On Fri, Aug 16, 2019 at 11:16:11PM +0200, Hans de Goede wrote:
Drop the duplicate sha256_transform function
On Thu, Aug 08, 2019 at 12:38:32PM +0200, Jiri Slaby wrote:
> Use the newly added SYM_FUNC_START_LOCAL to annotate starts of all
> functions which do not have ".globl" annotation, but their ends are
> annotated by ENDPROC. This is needed to balance ENDPROC for tools that
> generate debuginfo.
>
>
Hi,
On 17-08-19 07:19, Eric Biggers wrote:
On Fri, Aug 16, 2019 at 11:16:08PM +0200, Hans de Goede wrote:
diff --git a/include/linux/sha256.h b/include/crypto/sha256.h
similarity index 100%
rename from include/linux/sha256.h
rename to include/crypto/sha256.h
already has the declarations for
11 matches
Mail list logo