uint##n x; \
octet b[SZ_##W]; \
if (!PyArg_ParseTuple(arg, "O&:hashu" #w, convu##n, &x)) goto end; \
- STORE##W(b, n); poly1305_hash(P1305_CTX(me), b, sizeof(b)); \
+ STORE##W(b, x); poly1305_hash(P1305_CTX(me), b, sizeof(b)); \
RETURN_ME; \
end: \
return (0); \
octet b[SZ_##W]; \
if (!PyArg_ParseTuple(arg, "s#:hashbuf" #w, &p, &sz)) goto end; \
if (sz > MASK##n) TYERR("string too long"); \
- STORE##W(b, n); poly1305_hash(P1305_CTX(me), b, sizeof(b)); \
+ STORE##W(b, sz); poly1305_hash(P1305_CTX(me), b, sizeof(b)); \
poly1305_hash(P1305_CTX(me), p, sz); \
RETURN_ME; \
end: \
RETURN_ME;
}
+static PyObject *polymeth_flushzero(PyObject *me, PyObject *arg)
+{
+ if (!PyArg_ParseTuple(arg, ":flushzero")) return (0);
+ poly1305_flushzero(P1305_CTX(me));
+ RETURN_ME;
+}
+
static PyObject *polymeth_concat(PyObject *me, PyObject *arg)
{
PyObject *pre, *suff;
#undef METHBUF_
METH (hashstrz, "P.hashstrz(STRING)")
METH (flush, "P.flush()")
+ METH (flushzero, "P.flushzero()")
METH (concat, "P.concat(PREFIX, SUFFIX)")
METH (done, "P.done() -> TAG")
#undef METHNAME