From b8b5f8c7725d7431b82cb065b2b18891c1bc3fc9 Mon Sep 17 00:00:00 2001 From: ame Date: Thu, 4 Apr 2024 10:06:53 -0500 Subject: all basic hash funcs --- src/hash/xor.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/hash/xor.h') diff --git a/src/hash/xor.h b/src/hash/xor.h index bd9aaed..6065524 100644 --- a/src/hash/xor.h +++ b/src/hash/xor.h @@ -1,12 +1,16 @@ #include "../lua.h" #include -/** - * calculates a xor hash of (len) bytes - * - * @param {uint8_t*} input bytes - * @param {size_t} input length - * @return {uint8_t} 8 bit checksum -*/ + +struct xor8_hash { + uint8_t a; +}; + +struct xor8_hash xor8_init(); +void xor8_update(uint8_t*, size_t, struct xor8_hash*); +uint8_t xor8_final(struct xor8_hash*); uint8_t xor8(uint8_t*, size_t); int l_xor8(lua_State*); +int l_xor8_init(lua_State*); +int l_xor8_update(lua_State*); +int l_xor8_final(lua_State*); \ No newline at end of file -- cgit v1.2.3