aboutsummaryrefslogtreecommitdiff
path: root/src/hash/bsdchecksum.h
diff options
context:
space:
mode:
authorame <[email protected]>2024-03-27 13:34:34 -0500
committerame <[email protected]>2024-03-27 13:34:34 -0500
commita735c538144f8cc4e059d47d06093a17edd5b31c (patch)
tree11db0e99732c9851c4a2c94f3e318da1cdec7716 /src/hash/bsdchecksum.h
parent28a9d801572cf69d20d1f0a12c383ca7dbae3a67 (diff)
fixed a few hashes
Diffstat (limited to 'src/hash/bsdchecksum.h')
-rw-r--r--src/hash/bsdchecksum.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/hash/bsdchecksum.h b/src/hash/bsdchecksum.h
index 8e41893..9344e9a 100644
--- a/src/hash/bsdchecksum.h
+++ b/src/hash/bsdchecksum.h
@@ -1,6 +1,10 @@
#include "../lua.h"
#include <stdint.h>
+struct bsdchecksum_hash {
+ uint16_t check;
+};
+
/**
* calculates a bsdchecksum of (len) bytes
*
@@ -8,6 +12,12 @@
* @param {size_t} input length
* @return {uint16_t} 16 bit checksum
*/
-uint16_t i_bsdchecksum(uint8_t*, size_t);
+uint16_t bsdchecksum(uint8_t*, size_t);
+struct bsdchecksum_hash bsdchecksum_init();
+void bsdchecksum_update(uint8_t*, size_t, struct bsdchecksum_hash*);
+uint16_t bsdchecksum_final(struct bsdchecksum_hash*);
int l_bsdchecksum(lua_State*);
+int l_bsdchecksum_init(lua_State*);
+int l_bsdchecksum_update(lua_State*);
+int l_bsdchecksum_final(lua_State*);