From: Niels Möller Date: Tue, 13 May 2025 18:35:35 +0000 (+0200) Subject: Define old sha3_*_ctx and sha3_*_init as aliases. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31e38fa9b3255646b69b55c59d2c17cca995f0b8;p=thirdparty%2Fnettle.git Define old sha3_*_ctx and sha3_*_init as aliases. --- diff --git a/ChangeLog b/ChangeLog index 18cb7e6b..6e7b99ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,7 @@ Reduce size of sha3 context size to 216 bytes. * sha3.h (struct sha3_ctx): New struct, replacing all sha3_*_ctx. (struct sha3_128_ctx, struct sha3_224_ctx, struct sha3_256_ctx, struct sha3_384_ctx) - (struct sha3_512_ctx): Deleted. + (struct sha3_512_ctx): Redefined as aliases to sha3_ctx. * sha3-internal.h (_NETTLE_SHA3_HASH): New macro. @@ -26,11 +26,12 @@ (_nettle_sha3_shake_output) [!WORDS_BIGENDIAN]: No buffering, copy output directly from state. - * shake128.c (sha3_128_init): Deleted. - * sha3-224.c (sha3_224_init): Deleted. - * sha3-256.c (sha3_256_init): Deleted. - * sha3-384.c (sha3_384_init): Deleted. - * sha3-512.c (sha3_512_init): Deleted. + * shake128.c (sha3_128_init): Deleted (redefined as alias for + sha3_init in sha3.h). + * sha3-224.c (sha3_224_init): Likewise. + * sha3-256.c (sha3_256_init): Likewise. + * sha3-384.c (sha3_384_init): Likewise. + * sha3-512.c (sha3_512_init): Likewise. * nettle-internal.h (NETTLE_MAX_HASH_CONTEXT_SIZE): Lower, streebog512_ctx is now the largest hash context struct. diff --git a/sha3.h b/sha3.h index 7e4a7963..41299015 100644 --- a/sha3.h +++ b/sha3.h @@ -153,6 +153,19 @@ sha3_512_update (struct sha3_ctx *ctx, size_t length, const uint8_t *data); void sha3_512_digest(struct sha3_ctx *ctx, uint8_t *digest); +/* Old names, for compatibility with nettle-3. */ +#define sha3_128_ctx sha3_ctx +#define sha3_224_ctx sha3_ctx +#define sha3_256_ctx sha3_ctx +#define sha3_384_ctx sha3_ctx +#define sha3_512_ctx sha3_ctx + +#define sha3_128_init sha3_init +#define sha3_224_init sha3_init +#define sha3_256_init sha3_init +#define sha3_384_init sha3_init +#define sha3_512_init sha3_init + #ifdef __cplusplus } #endif