From: Loup Vaillant Date: Fri, 13 Jan 2023 15:41:38 +0000 (+0100) Subject: Fix: crypto_blake2b_defaults should be constant X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=eaec12e089fa50ec797ad39c38e94efae6d73b2a;p=Monocypher.git Fix: crypto_blake2b_defaults should be constant --- 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,