-/** Our own sha1 implementation, see sha1.c. */
-#define hash_function sha1_hash
+static inline void hash_function(uint8_t table_version, const char *data,
+ unsigned long len, unsigned char *result)
+{
+ switch (table_version) {
+ case 1: return sha1_hash(data, len, result);
+ case 2: return sha3_hash(data, len, result);
+ case 3: return sha256_hash(data, len, result);
+ }
+ assert(0);
+}