chiark / gitweb /
Qualify name given to @bres_byname@.
[mLib] / unihash.h
index 5fb57416946c8b8c84051a2301475bbe16dab3b8..dfc5b796163ff95d8a616d0146b9ba0905946fcb 100644 (file)
--- a/unihash.h
+++ b/unihash.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: unihash.h,v 1.1 2003/10/12 14:43:24 mdw Exp $
+ * $Id: unihash.h,v 1.2 2003/12/14 14:45:30 mdw Exp $
  *
  * Simple and efficient universal hashing for hashtables
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: unihash.h,v $
+ * Revision 1.2  2003/12/14 14:45:30  mdw
+ * Test universal hashing and fix bugs.
+ *
  * Revision 1.1  2003/10/12 14:43:24  mdw
  * Universal hashing.
  *
@@ -50,7 +53,7 @@
  * $m_{n-1}, m_{n-2}, \ldots, m_2, m_1, m_0$% in %$\gf{q}%.
  * Then we compute
  *
- *   %$H_k(M) = k^{n+1} \sum_{0\le i<n} m_i k^{i+1}.$%
+ *   %$H_k(M) = k^{n+1} \sum_{0\le i<n} m_i k^{i+1}.$%
  *
  * Note that %$H_0(M) = 0$% for all messages %$M$%.
  *
  * computationally unbounded adversaries.  Simply XOR the hash with a random
  * string indexed from a large random pad by some nonce sent with the
  * message.  The probability of a forgery attempt being successful is then
- * %$(\ell + 1)/2^t$%, where %$t$% is the tag length and %$n$% is the longest
- * message permitted.
+ * %$(\ell + 1)/2^t$%, where %$t$% is the tag length and %$\ell$% is the
+ * longest message permitted.
  */
 
 /*----- Practicalities ----------------------------------------------------*
  *
  * We work in %$\gf{2^32}$%, represented as a field of polynomials modulo
- * %$\{104c11db7}_x$% (this is the standard CRC-32 polynomial).  Our blocks
- * are bytes.  We append a big-endian byte length.
+ * %$\texttt{104c11db7}_x$% (this is the standard CRC-32 polynomial).  Our
+ * blocks are bytes.
  *
  * The choice of a 32-bit hash is made for pragmatic reasons: we're never
  * likely to actually want all 32 bits for a real hashtable anyway.  The
@@ -156,7 +159,7 @@ extern void unihash_setkey(unihash_info */*i*/, uint32 /*k*/);
  *             @const void *p@ = pointer to data to hash
  *             @size_t sz@ = size of the data
  *
- * Returns:    ---
+ * Returns:    Hash of data so far.
  *
  * Use:                Hashes data.  Call this as many times as needed.  
  */