+ *
+ * Returns: ---
+ *
+ * Use: Scans a buffer of data and updates the testing context.
+ */
+
+void maurer_test(maurer_ctx *m, const void *buf, size_t sz)
+{
+ const octet *p = buf, *l = p + sz;
+ unsigned long q = 10 << m->l;
+ unsigned x;
+
+ /* --- Initialize the table --- */
+
+ while (m->n < q) {
+ if (!bits(m, &p, l, &x))
+ return;
+ m->t[x] = m->n;
+ }
+
+ /* --- Update the statistic --- */
+
+ while (bits(m, &p, l, &x)) {
+ m->x += log(m->n - m->t[x]);
+ m->t[x] = m->n;
+ }
+}
+
+/* --- @maurer_done@ --- *
+ *
+ * Arguments: @maurer_ctx *m@ = pointer to a Maurer testing context