From eaec12e089fa50ec797ad39c38e94efae6d73b2a Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Fri, 13 Jan 2023 16:41:38 +0100 Subject: [PATCH] Fix: crypto_blake2b_defaults should be constant --- src/monocypher.c | 2 +- src/monocypher.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monocypher.c b/src/monocypher.c index f0a0baf..6787c83 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -524,7 +524,7 @@ static void blake2b_set_input(crypto_blake2b_ctx *ctx, u8 input, size_t index) } // Defaults are no key, 64 byte hash -crypto_blake2b_config crypto_blake2b_defaults = { 0, 0, 64 }; +const crypto_blake2b_config crypto_blake2b_defaults = { 0, 0, 64 }; void crypto_blake2b_init(crypto_blake2b_ctx *ctx, crypto_blake2b_config config) { diff --git a/src/monocypher.h b/src/monocypher.h index 8dc5869..77e2d43 100644 --- a/src/monocypher.h +++ b/src/monocypher.h @@ -132,7 +132,7 @@ typedef struct { size_t hash_size; } crypto_blake2b_config; -extern crypto_blake2b_config crypto_blake2b_defaults; +extern const crypto_blake2b_config crypto_blake2b_defaults; // Direct interface void crypto_blake2b(uint8_t *hash, crypto_blake2b_config config, -- 2.47.3