/* -*-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
*
/*----- 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.
*
* $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
* @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.
*/