]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Add typedef nettle_output_func.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 11 Mar 2025 19:35:28 +0000 (20:35 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 11 Mar 2025 19:35:28 +0000 (20:35 +0100)
nettle-types.h
testsuite/shake128-test.c
testsuite/shake256-test.c
testsuite/testutils.h

index 3151bb2de8eecc029ad6e1e06107a0ff4e46cae2..04febc7c65bf58f0fd2a85d31f9642693719181a 100644 (file)
@@ -70,9 +70,13 @@ union nettle_block8
   uint64_t u64;
 };
 
-/* Randomness. Used by key generation and dsa signature creation. */
-typedef void nettle_random_func(void *ctx,
+
+/* Used for generating randomness, as well as for extendable output
+   functions like shake. */
+typedef void nettle_output_func(void *ctx,
                                size_t length, uint8_t *dst);
+/* Old name used for key generation and (ec)dsa signature creation. */
+typedef nettle_output_func nettle_random_func;
 
 /* Progress report function, mainly for key generation. */
 typedef void nettle_progress_func(void *ctx, int c);
index c724b9f34129975b40d5c079ce087774d2e67640..fd55b4b2fab2c68b16181726cfc80775188bffa2 100644 (file)
@@ -41,8 +41,8 @@ const struct nettle_xof nettle_shake128 =
    SHA3_128_BLOCK_SIZE,
    (nettle_hash_init_func *) sha3_128_init,
    (nettle_hash_update_func *) sha3_128_update,
-   (nettle_random_func *) sha3_128_shake,
-   (nettle_random_func *) sha3_128_shake_output,
+   (nettle_output_func *) sha3_128_shake,
+   (nettle_output_func *) sha3_128_shake_output,
   };
 
 void
index 1421239f1f48a7e8828cc5e395b4f44a511db285..93e1107e0cf43af5f77077e22099802b4bc018cf 100644 (file)
@@ -43,8 +43,8 @@ const struct nettle_xof nettle_shake256 =
    SHA3_256_BLOCK_SIZE,
    (nettle_hash_init_func *) sha3_256_init,
    (nettle_hash_update_func *) sha3_256_update,
-   (nettle_random_func *) sha3_256_shake,
-   (nettle_random_func *) sha3_256_shake_output,
+   (nettle_output_func *) sha3_256_shake,
+   (nettle_output_func *) sha3_256_shake_output,
   };
 
 void
index 84b4998c255dc91aebe9efb0dd963448c3fa5d66..49b813ab85ec8e54d159ca5747d166e7befd7dbe 100644 (file)
@@ -114,9 +114,8 @@ struct nettle_xof {
   unsigned block_size;
   nettle_hash_init_func *init;
   nettle_hash_update_func *update;
-  /* FIXME: Rename to, e.g., nettle_output_func. */
-  nettle_random_func *digest;
-  nettle_random_func *output;
+  nettle_output_func *digest;
+  nettle_output_func *output;
 };
 
 void