Clean up alignment handling for SHA-512.
authorjsing <jsing@openbsd.org>
Sat, 27 May 2023 09:18:17 +0000 (09:18 +0000)
committerjsing <jsing@openbsd.org>
Sat, 27 May 2023 09:18:17 +0000 (09:18 +0000)
commit825d9bb4e54edc704a260383f5114c4752bbd3e5
tree59e956e00c3e08147e937f7aee25665781930bb1
parentd88bac1a87f4e2fb709184b1dc83624df7da8a92
Clean up alignment handling for SHA-512.

This recommits r1.37 of sha512.c, however uses uint8_t * instead of void *
for the crypto_load_* functions and primarily uses const uint8_t * to track
input, only casting to const SHA_LONG64 * once we know that it is suitably
aligned. This prevents the compiler from implying alignment based on type.

Tested by tb@ and deraadt@ on platforms with gcc and strict alignment.

ok tb@
lib/libcrypto/crypto_internal.h
lib/libcrypto/sha/sha512.c