if (!PyArg_ParseTuple(arg, "s#s#:" #hdance "_prf", \
&k, &ksz, &n, &nsz)) \
goto end; \
- if (ksz != DANCE##_KEYSZ) VALERR("bad key length"); \
+ if (ksz != keysz(ksz, dance##_keysz)) VALERR("bad key length"); \
if (nsz != HDANCE##_INSZ) VALERR("bad input length"); \
rc = bytestring_pywrap(0, HSALSA20_OUTSZ); \
dance##_init(&dance, k, ksz, 0); \
unsigned i;
unsigned n;
- if (!PyArg_ParseTuple(arg, "O&:mix", convuint, &n)) goto end;
+ if (!PyArg_ParseTuple(arg, "O&:extract", convuint, &n)) goto end;
if (n > 200) VALERR("out of range");
rc = bytestring_pywrap(0, n);
q = (octet *)PyString_AS_STRING(rc);
rc->h = *SHAKE_H(me);
rc->st = SHAKE_ST(me);
end:
- return ((PyObject *)me);
+ return ((PyObject *)rc);
}
static PyObject *shakemeth_get(PyObject *me, PyObject *arg)