]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Define old sha3_*_ctx and sha3_*_init as aliases.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 13 May 2025 18:35:35 +0000 (20:35 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 13 May 2025 18:35:35 +0000 (20:35 +0200)
ChangeLog
sha3.h

index 18cb7e6b36d70eba98565f1c823d1a77d3772747..6e7b99acbdd1e9b562f08631079e2db2b5f49d1f 100644 (file)
--- 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.
 
        (_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 7e4a7963922b2c60e5237ec4843c0b3ecefb15b9..412990150d3810a916d2367ca52d08f73cf4fdea 100644 (file)
--- 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