+ return (0);
+}
+
+static PyObject *gcnrand_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
+{
+ const gccrand_info *info = GCCRAND_INFO(ty);
+ static char *kwlist[] = { "key", "nonce", 0 };
+ char *k, *n;
+ int ksz, nsz;
+
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#s#:new", kwlist,
+ &k, &ksz, &n, &nsz))
+ goto end;
+ if (keysz(ksz, info->keysz) != ksz) VALERR("bad key length");
+ if (nsz != info->noncesz) VALERR("bad nonce length");
+ return (grand_dopywrap(ty,
+ ((gcnrand_func *)info->func)(k, ksz, n),
+ f_freeme));
+end:
+ return (0);