aboutsummaryrefslogtreecommitdiff
path: root/enums.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-07-04 16:46:24 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-07-04 16:46:24 -0400
commit78960b1461a8fb184de4ffddf2d2ec4df729fb05 (patch)
treef62f39c9d6b420c304bffba8143a41789980e68a /enums.c
parentdfb7bb1984b555519851d084ac8b5f8e760c55ce (diff)
Randomize hash key on startup and rename to TOMO_HASH_KEY.
Diffstat (limited to 'enums.c')
-rw-r--r--enums.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/enums.c b/enums.c
index 344b5f1a..4e632216 100644
--- a/enums.c
+++ b/enums.c
@@ -124,7 +124,7 @@ static CORD compile_hash_method(env_t *env, ast_t *ast)
return CORD_all("static uint32_t ", full_name, "$hash(const ", full_name, "_t *obj, const TypeInfo *info) {\n"
"(void)info;\n"
"uint32_t hash;\n"
- "halfsiphash(&obj->$tag, sizeof(obj->$tag), TOMO_HASH_VECTOR, (uint8_t*)&hash, sizeof(hash));\n"
+ "halfsiphash(&obj->$tag, sizeof(obj->$tag), TOMO_HASH_KEY, (uint8_t*)&hash, sizeof(hash));\n"
"return hash;"
"\n}\n");
}
@@ -144,7 +144,7 @@ static CORD compile_hash_method(env_t *env, ast_t *ast)
}
hash_func = CORD_all(hash_func, "}\n"
"uint32_t hash;\n"
- "halfsiphash(&hashes, sizeof(hashes), TOMO_HASH_VECTOR, (uint8_t*)&hash, sizeof(hash));\n"
+ "halfsiphash(&hashes, sizeof(hashes), TOMO_HASH_KEY, (uint8_t*)&hash, sizeof(hash));\n"
"return hash;\n}\n");
return hash_func;
}