]> git.codecow.com Git - Monocypher.git/commitdiff
Fix: crypto_blake2b_defaults should be constant
authorLoup Vaillant <loup@loup-vaillant.fr>
Fri, 13 Jan 2023 15:41:38 +0000 (16:41 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 13 Jan 2023 15:41:38 +0000 (16:41 +0100)
src/monocypher.c
src/monocypher.h

index f0a0bafe13450312d9f47d38f447e583c315dfa2..6787c83f19bf3fe2dab49431da3afb87821e1314 100644 (file)
@@ -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)
 {
index 8dc58696318a9df59975c2ad128ae5ec6bb5814f..77e2d43f5cdefbd4f26349172b7b8f6b7704cd89 100644 (file)
@@ -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,