t/t-algorithms.py: Add tests for other HSalsa20 and HChaCha key sizes.
[catacomb-python] / catacomb.c
index daa404a..e9c9513 100644 (file)
@@ -52,6 +52,8 @@ static const struct nameval consts[] = {
   C(ED25519_KEYSZ), C(ED25519_PUBSZ), C(ED25519_SIGSZ),
     C(ED25519_MAXPERSOSZ),
   C(ED448_KEYSZ), C(ED448_PUBSZ), C(ED448_SIGSZ), C(ED448_MAXPERSOSZ),
+  C(AEADF_PCHSZ), C(AEADF_PCMSZ), C(AEADF_PCTSZ),
+  C(AEADF_AADNDEP), C(AEADF_AADFIRST), C(AEADF_NOAAD),
 #define ENTRY(tag, val, str) C(KERR_##tag),
   KEY_ERRORS(ENTRY)
 #undef ENTRY
@@ -76,7 +78,8 @@ PyObject *mexp_common(PyObject *me, PyObject *arg,
     arg = PyTuple_GetItem(arg, 0);
   Py_INCREF(arg);
   if (!PySequence_Check(arg)) TYERR("not a sequence");
-  n = PySequence_Size(arg); if (!n) { z = id(me); goto end; }
+  n = PySequence_Size(arg); if (n < 0) goto end;
+  if (!n) { z = id(me); goto end; }
   x = PySequence_GetItem(arg, 0);
   if (PySequence_Check(x))
     flat = 0;