chiark / gitweb /
Actually implement the right transformation!
[mLib] / man / unihash.3
index 49ef2e03e018f9947a3865b8fa06e1d0f5a3f68f..bc565b8581e7223ca6428bc8a17ac67e9afa0c00 100644 (file)
@@ -45,10 +45,12 @@ unihash \- simple and efficient universal hashing for hashtables
 .nf
 .B "#include <mLib/unihash.h>"
 
+.B "unihash_info unihash_global;"
+
 .BI "void unihash_setkey(unihash_info *" i ", uint32 " k );
 .BI "uint32 UNIHASH_INIT(const unihash_info *" i );
-.BI "void unihash_hash(const unihash_info *" st ", uint32 " a ,
-.BI "                  const void *" p ", size_t " sz );
+.BI "uint32 unihash_hash(const unihash_info *" i ", uint32 " a ,
+.BI "                    const void *" p ", size_t " sz );
 .BI "uint32 unihash(const unihash_info *" i ", const void *" p ", size_t " sz );
 .BI "uint32 UNIHASH(const unihash_info *" i ", const void *" p ", size_t " sz );
 .fi
@@ -125,6 +127,18 @@ and function
 are convenient interfaces to
 .B unihash_hash
 if you only wanted to hash one chunk.
+.SS "Global hash info table"
+There's no problem with using the same key for several purposes, as long
+as it's secret from all of your adversaries.  Therefore, there is a
+global
+.B unihash_info
+table define, called
+.BR unihash_global .
+This initially contains information for a fixed key which the author
+chose at random, but if you need to you can set a different key into it
+.I before
+it gets used to hash any data (otherwise your hash tables will become
+messed up).
 .SS "Theoretical issues"
 The hash function implemented by
 .B unihash
@@ -176,7 +190,8 @@ dependent on any unproven assumptions (unlike many `proofs' of
 cryptographic security, which actually reduce the security of some
 construction to the security of its components).  It's just a fact.
 .SH SEE ALSO
+.BR unihash-mkstatic (3),
 .BR crc32 (3),
 .BR mLib (3).
 .SH AUTHOR
-Mark Wooding (mdw@nsict.org).
+Mark Wooding (mdw@distorted.org.uk).